From: Jarkko Hietaniemi Date: Sat, 29 May 1999 10:44:44 +0000 (+0000) Subject: Make Configure support the change #3367, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f1066039eba92a2bb4d8de3ef991b7c813b020c9;p=p5sagit%2Fp5-mst-13.2.git Make Configure support the change #3367, SysV shadow passwords. p4raw-link: @3367 on //depot/perl: 8c0bfa080e85353d7675b8b2fb1a04c6cc60cd5f p4raw-id: //depot/cfgperl@3502 --- diff --git a/Configure b/Configure index 2cb821a..2c717fe 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Fri May 28 10:41:29 EET DST 1999 [metaconfig 3.0 PL70] +# Generated on Sat May 29 13:37:18 EET DST 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <open3.c <<'EOCP' @@ -8267,6 +8276,14 @@ echo " " set d_getservprotos getservent $i_netdb netdb.h eval $hasproto +: see if getspent exists +set getspent d_getspent +eval $inlibc + +: see if getspnam exists +set getspnam d_getspnam +eval $inlibc + : see if gettimeofday or ftime exists set gettimeofday d_gettimeod eval $inlibc @@ -9619,6 +9636,10 @@ eval $inlibc set setsid d_setsid eval $inlibc +: see if setspent exists +set setspent d_setspent +eval $inlibc + : see if setvbuf exists set setvbuf d_setvbuf eval $inlibc @@ -12390,6 +12411,10 @@ set i_termio; eval $setvar val=$val2; set i_sgtty; eval $setvar val=$val3; set i_termios; eval $setvar +: see if this is a shadow.h system +set shadow.h i_shadow +eval $inhdr + : see if stdarg is available echo " " if $test `./findhdr stdarg.h`; then @@ -12982,6 +13007,7 @@ d_endnent='$d_endnent' d_endpent='$d_endpent' d_endpwent='$d_endpwent' d_endsent='$d_endsent' +d_endspent='$d_endspent' d_eofnblk='$d_eofnblk' d_eunice='$d_eunice' d_fchmod='$d_fchmod' @@ -13041,6 +13067,8 @@ d_getsbyname='$d_getsbyname' d_getsbyport='$d_getsbyport' d_getsent='$d_getsent' d_getservprotos='$d_getservprotos' +d_getspent='$d_getspent' +d_getspnam='$d_getspnam' d_gettimeod='$d_gettimeod' d_gnulibc='$d_gnulibc' d_grpasswd='$d_grpasswd' @@ -13162,6 +13190,7 @@ d_setrgid='$d_setrgid' d_setruid='$d_setruid' d_setsent='$d_setsent' d_setsid='$d_setsid' +d_setspent='$d_setspent' d_setvbuf='$d_setvbuf' d_sfio='$d_sfio' d_shm='$d_shm' @@ -13298,6 +13327,7 @@ i_pwd='$i_pwd' i_rpcsvcdbm='$i_rpcsvcdbm' i_sfio='$i_sfio' i_sgtty='$i_sgtty' +i_shadow='$i_shadow' i_stdarg='$i_stdarg' i_stddef='$i_stddef' i_stdlib='$i_stdlib' diff --git a/config_h.SH b/config_h.SH index 97f084e..44d4379 100644 --- a/config_h.SH +++ b/config_h.SH @@ -2094,6 +2094,12 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_dlsymun DLSYM_NEEDS_UNDERSCORE /**/ +/* HAS_ENDSPENT: + * This symbol, if defined, indicates that the endspent system call is + * available to finalize the scan of SysV shadow password entries. + */ +#$d_endspent HAS_ENDSPENT /**/ + /* HAS_FSEEKO: * This symbol, if defined, indicates that the fseeko routine is * available to fseek beyond 32 bits (useful for ILP32 hosts). @@ -2112,6 +2118,18 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_getmntent HAS_GETMNTENT /**/ +/* HAS_GETSPENT: + * This symbol, if defined, indicates that the getspent system call is + * available to retrieve SysV shadow password entries sequentially. + */ +#$d_getspent HAS_GETSPENT /**/ + +/* HAS_GETSPNAM: + * This symbol, if defined, indicates that the getspnam system call is + * available to retrieve SysV shadow password entries by name. + */ +#$d_getspnam HAS_GETSPNAM /**/ + /* HAS_HASMNTOPT: * This symbol, if defined, indicates that the hasmntopt routine is * available to query the mount options of file systems. @@ -2137,6 +2155,12 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_readv HAS_READV /**/ +/* HAS_SETSPENT: + * This symbol, if defined, indicates that the setspent system call is + * available to initialize the scan of SysV shadow password entries. + */ +#$d_setspent HAS_SETSPENT /**/ + /* USE_SFIO: * This symbol, if defined, indicates that sfio should * be used. @@ -2276,6 +2300,12 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$i_poll I_POLL /**/ +/* I_SHADOW: + * This symbol, if defined, indicates that exists and + * should be included. + */ +#$i_shadow I_SHADOW /**/ + /* I_SYS_MMAN: * This symbol, if defined, indicates that exists and * should be included. diff --git a/pp_sys.c b/pp_sys.c index 1d1c849..642b8d2 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -17,8 +17,10 @@ #include "EXTERN.h" #include "perl.h" -#ifdef HAS_GETSPENT -/* Shadow password support for solaris - pdo@cs.umd.edu*/ +#ifdef I_SHADOW +/* Shadow password support for solaris - pdo@cs.umd.edu + * Not just Solaris: at least HP-UX, IRIX, Linux. + * the API is from SysV. --jhi */ #include #endif @@ -4564,11 +4566,13 @@ PP(pp_gpwent) else pwent = (struct passwd *)getpwent(); -#ifdef HAS_GETSPENT +#ifdef HAS_GETSPNAM if (which == OP_GPWNAM) spwent = getspnam(pwent->pw_name); +# ifdef HAS_GETSPUID /* AFAIK there isn't any anywhere. --jhi */ else if (which == OP_GPWUID) spwent = getspnam(pwent->pw_name); +# endif else spwent = (struct spwd *)getspent(); #endif @@ -4591,14 +4595,14 @@ PP(pp_gpwent) PUSHs(sv = sv_mortalcopy(&PL_sv_no)); #ifdef PWPASSWD -#ifdef HAS_GETSPENT +# ifdef HAS_GETSPENT if (spwent) sv_setpv(sv, spwent->sp_pwdp); else sv_setpv(sv, pwent->pw_passwd); -#else +# else sv_setpv(sv, pwent->pw_passwd); -#endif +# endif #endif PUSHs(sv = sv_mortalcopy(&PL_sv_no)); @@ -4662,9 +4666,9 @@ PP(pp_spwent) djSP; #if defined(HAS_PASSWD) && defined(HAS_SETPWENT) && !defined(CYGWIN32) setpwent(); -#ifdef HAS_GETSPENT +# ifdef HAS_SETSPENT setspent(); -#endif +# endif RETPUSHYES; #else DIE(PL_no_func, "setpwent"); @@ -4676,9 +4680,9 @@ PP(pp_epwent) djSP; #if defined(HAS_PASSWD) && defined(HAS_ENDPWENT) endpwent(); -#ifdef HAS_GETSPENT +# ifdef HAS_ENDSPENT endspent(); -#endif +# endif RETPUSHYES; #else DIE(PL_no_func, "endpwent");