# $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
d_endpent=''
d_endpwent=''
d_endsent=''
+d_endspent=''
d_fchmod=''
d_fchown=''
d_fcntl=''
d_getpwent=''
d_getsent=''
d_getservprotos=''
+d_getspent=''
+d_getspnam=''
d_getsbyname=''
d_getsbyport=''
d_gnulibc=''
d_setruid=''
d_setsent=''
d_setsid=''
+d_setspent=''
d_setvbuf=''
d_sfio=''
usesfio=''
d_pwquota=''
i_pwd=''
i_sfio=''
+i_shadow=''
i_stddef=''
i_stdlib=''
i_string=''
: 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.
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'
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
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
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
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'
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'
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'
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'
*/
#$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).
*/
#$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.
*/
#$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.
*/
#$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.
#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
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
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));
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");
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");