X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp_sys.c;h=5d5b92dfe91925af294d92dc6002fc68ddea4464;hb=2e1d04bc4fa2d036f823d5251c731f594e0246dd;hp=9ea67e18a577831ed9ebdf515c94e3c4f65160f1;hpb=ee8c7f5465f003860e2347a2946abacac39bd9b9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp_sys.c b/pp_sys.c index 9ea67e1..5d5b92d 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -4773,8 +4773,50 @@ PP(pp_gpwent) register SV *sv; STRLEN n_a; struct passwd *pwent = NULL; -/* We do not use HAS_GETSPENT in pp_gpwent() but leave it here in the case - * somebody wants to write an XS to access the shadow passwords. --jhi */ + /* + * We currently support only the SysV getsp* shadow password interface. + * The interface is declared in and often one needs to link + * with -lsecurity or some such. + * This interface is used at least by Solaris, HP-UX, IRIX, and Linux. + * (and SCO?) + * + * AIX getpwnam() is clever enough to return the encrypted password + * only if the caller (euid?) is root. + * + * There are at least two other shadow password APIs. Many platforms + * seem to contain more than one interface for accessing the shadow + * password databases, possibly for compatibility reasons. + * The getsp*() is tby far he simplest one, the other two interfaces + * are much more complicated, but also very similar to each other. + * + * + * + * + * struct pr_passwd *getprpw*(); + * The password is in + * char getprpw*(...).ufld.fd_encrypt[AUTH_MAX_CIPHERTEXT_LENGTH] + * + * + * + * + * struct es_passwd *getespw*(); + * The password is in + * char *(getespw*(...).ufld.fd_encrypt) + * + * XXX Configure test needed for getprpwnam XXX + * XXX Configure test needed for getespwnam XXX + * + * In HP-UX for getprpw*() the manual page claims that one should include + * instead of , but that is not needed + * if one includes as that includes , + * and pp_sys.c already includes if there is such. + * + * In Digital UNIX/Tru64 if using the getespw*() (which seems to be + * be preferred interface, even though also the getprpw*() interface + * is available) one needs to link with -lsecurity -ldb -laud -lm. + * + * --jhi + */ # ifdef HAS_GETSPNAM struct spwd *spwent = NULL; # endif @@ -4902,9 +4944,6 @@ PP(pp_spwent) djSP; #if defined(HAS_PASSWD) && defined(HAS_SETPWENT) setpwent(); -# ifdef HAS_SETSPENT - setspent(); -# endif RETPUSHYES; #else DIE(aTHX_ PL_no_func, "setpwent"); @@ -4916,9 +4955,6 @@ PP(pp_epwent) djSP; #if defined(HAS_PASSWD) && defined(HAS_ENDPWENT) endpwent(); -# ifdef HAS_ENDSPENT - endspent(); -# endif RETPUSHYES; #else DIE(aTHX_ PL_no_func, "endpwent");