summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-05-29 10:44:44 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-05-29 10:44:44 +0000
commitf1066039eba92a2bb4d8de3ef991b7c813b020c9 (patch)
tree21d6aed35d87967fa424c04bd71867ae33ef2bb6
parent18bb47038c875d1c8e166d8a88f9ce1ece59f0e7 (diff)
downloadperl-f1066039eba92a2bb4d8de3ef991b7c813b020c9.tar.gz
Make Configure support the change #3367,
SysV shadow passwords. p4raw-link: @3367 on //depot/perl: 8c0bfa080e85353d7675b8b2fb1a04c6cc60cd5f p4raw-id: //depot/cfgperl@3502
-rwxr-xr-xConfigure34
-rw-r--r--config_h.SH30
-rw-r--r--pp_sys.c24
3 files changed, 76 insertions, 12 deletions
diff --git a/Configure b/Configure
index 2cb821a301..2c717fe094 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$$ <<EOF
@@ -338,6 +338,7 @@ d_endnent=''
d_endpent=''
d_endpwent=''
d_endsent=''
+d_endspent=''
d_fchmod=''
d_fchown=''
d_fcntl=''
@@ -383,6 +384,8 @@ d_getprotoprotos=''
d_getpwent=''
d_getsent=''
d_getservprotos=''
+d_getspent=''
+d_getspnam=''
d_getsbyname=''
d_getsbyport=''
d_gnulibc=''
@@ -474,6 +477,7 @@ d_setrgid=''
d_setruid=''
d_setsent=''
d_setsid=''
+d_setspent=''
d_setvbuf=''
d_sfio=''
usesfio=''
@@ -623,6 +627,7 @@ d_pwpasswd=''
d_pwquota=''
i_pwd=''
i_sfio=''
+i_shadow=''
i_stddef=''
i_stdlib=''
i_string=''
@@ -950,7 +955,7 @@ useopcode=true
: If anyone needs -lnet, put it in a hint file.
libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
libswanted="$libswanted dld ld sun m rt c cposix posix"
-libswanted="$libswanted ndir dir crypt"
+libswanted="$libswanted ndir dir crypt sec"
libswanted="$libswanted ucb bsd BSD PW x"
: We probably want to search /usr/shlib before most other libraries.
: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
@@ -7566,6 +7571,10 @@ eval $inlibc
set endservent d_endsent
eval $inlibc
+: see if endspent exists
+set endspent d_endspent
+eval $inlibc
+
: Locate the flags for 'open()'
echo " "
$cat >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 97f084e35c..44d4379851 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -2094,6 +2094,12 @@ sed <<!GROK!THIS! >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 <<!GROK!THIS! >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 <<!GROK!THIS! >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 <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$i_poll I_POLL /**/
+/* I_SHADOW:
+ * This symbol, if defined, indicates that <shadow.h> exists and
+ * should be included.
+ */
+#$i_shadow I_SHADOW /**/
+
/* I_SYS_MMAN:
* This symbol, if defined, indicates that <sys/mman.h> exists and
* should be included.
diff --git a/pp_sys.c b/pp_sys.c
index 1d1c849271..642b8d23d9 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 <shadow.h>
#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");