ftp://ftp.krokus.ru/pub/OpenBSD/distfiles/xscreensaver-5.01.tar.gz
[xscreensaver] / driver / passwd-pwent.c
index 6e83e0f4a5440f757353b2c7dcb108b01a28f42f..e5ed51d9bd5b3a14b8b056563374104c1902b327 100644 (file)
@@ -104,6 +104,11 @@ static char *encrypted_user_passwd = 0;
 # define ROOT "root"
 #endif
 
+#ifndef VMS
+Bool pwent_priv_init (int argc, char **argv, Bool verbose_p);
+Bool pwent_lock_init (int argc, char **argv, Bool verbose_p);
+Bool pwent_passwd_valid_p (const char *typed_passwd, Bool verbose_p);
+#endif
 
 
 #ifndef VMS
@@ -195,9 +200,15 @@ get_encrypted_passwd(const char *user)
        *s = 0;
     }
 
+#ifndef HAVE_PAM
+  /* We only issue this warning if not compiled with support for PAM.
+     If we're using PAM, it's not unheard of that normal pwent passwords
+     would be unavailable. */
+
   if (!result)
     fprintf (stderr, "%s: couldn't get password of \"%s\"\n",
             blurb(), (user ? user : "(null)"));
+#endif /* !HAVE_PAM */
 
   return result;
 }
@@ -213,7 +224,7 @@ get_encrypted_passwd(const char *user)
 #ifndef VMS
 
 Bool
-pwent_lock_init (int argc, char **argv, Bool verbose_p)
+pwent_priv_init (int argc, char **argv, Bool verbose_p)
 {
   char *u;
 
@@ -234,6 +245,17 @@ pwent_lock_init (int argc, char **argv, Bool verbose_p)
 }
 
 
+Bool
+pwent_lock_init (int argc, char **argv, Bool verbose_p)
+{
+  if (encrypted_user_passwd)
+    return True;
+  else
+    return False;
+}
+
+
+
 static Bool
 passwds_match_p (const char *cleartext, const char *ciphertext)
 {