X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=driver%2Fpasswd-pam.c;h=a4b132123f7c8ce63078961b80617466efef6a54;hp=52347aad5f3fcd10e7e00e5545f48cfaea1be149;hb=07faf451b99879183ed7e909e43a0e065be1ee7f;hpb=447db08c956099b3b183886729108bf5b364c4b8 diff --git a/driver/passwd-pam.c b/driver/passwd-pam.c index 52347aad..a4b13212 100644 --- a/driver/passwd-pam.c +++ b/driver/passwd-pam.c @@ -89,6 +89,8 @@ struct pam_closure { Bool verbose_p; }; +Bool pam_passwd_valid_p (const char *typed_passwd, Bool verbose_p); +Bool pam_priv_init (int argc, char **argv, Bool verbose_p); #ifdef HAVE_PAM_FAIL_DELAY /* We handle delays ourself.*/ @@ -286,6 +288,7 @@ pam_passwd_valid_p (const char *typed_passwd, Bool verbose_p) goto DONE; } +#ifdef ALLOW_ROOT_PASSWD /* If that didn't work, set the user to root, and try to authenticate again. */ if (user) free (user); @@ -308,6 +311,8 @@ pam_passwd_valid_p (const char *typed_passwd, Bool verbose_p) fprintf (stderr, "%s: pam_authenticate (...) ==> %d (%s)\n", blurb(), status, PAM_STRERROR(pamh, status)); +#endif /* ALLOW_ROOT_PASSWD */ + DONE: if (user) free (user); if (pamh) @@ -339,7 +344,11 @@ pam_priv_init (int argc, char **argv, Bool verbose_p) const char file2[] = "/etc/pam.conf"; struct stat st; - if (stat (dir, &st) == 0 && st.st_mode & S_IFDIR) +# ifndef S_ISDIR +# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +# endif + + if (stat (dir, &st) == 0 && S_ISDIR(st.st_mode)) { if (stat (file, &st) != 0) fprintf (stderr,