http://ftp.x.org/contrib/applications/xscreensaver-2.34.tar.gz
[xscreensaver] / driver / passwd.c
index cc1212212828fef32c1f40e4df45fa20fecb79ec..2b2eadbb81b5b58bd3438cd5bcb132ceed08e238 100644 (file)
@@ -1,5 +1,5 @@
 /* passwd.c --- verifying typed passwords with the OS.
- * xscreensaver, Copyright (c) 1993-1997 Jamie Zawinski <jwz@netscape.com>
+ * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
 # include <unistd.h>
 #endif
 
+#ifdef HAVE_CRYPT_H
+# include <crypt.h>
+#endif
+
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
 #ifndef VMS
 # include <pwd.h>
+# include <grp.h>
 #else /* VMS */
 # include "vms-pwd.h"
 #endif /* VMS */
@@ -61,7 +66,7 @@
 #   include <sys/audit.h>
 #   include <pwdadj.h>
 
-#   define PRTYPE   passwd_adjunct *
+#   define PWTYPE   struct passwd_adjunct *
 #   define PWPSLOT  pwa_passwd
 #   define GETPW    getpwanam
 
@@ -70,7 +75,7 @@
 #   include <hpsecurity.h>
 #   include <prot.h>
 
-#   define PRTYPE   struct s_passwd *
+#   define PWTYPE   struct s_passwd *
 #   define PWPSLOT  pw_passwd
 #   define GETPW    getspwnam
 #   define crypt    bigcrypt
@@ -87,7 +92,7 @@
 #define False 0
 
 
-extern char *progname;
+extern const char *blurb(void);
 
 static char *encrypted_root_passwd = 0;
 static char *encrypted_user_passwd = 0;
@@ -170,7 +175,7 @@ get_encrypted_passwd(const char *user)
     }
 
   fprintf (stderr, "%s: couldn't get password of \"%s\"\n",
-          progname, (user ? user : "(null)"));
+          blurb(), (user ? user : "(null)"));
 
   return 0;
 }
@@ -178,7 +183,7 @@ get_encrypted_passwd(const char *user)
 
 
 /* This has to be called before we've changed our effective user ID,
-   because it might need priveleges to get at the encrypted passwords.
+   because it might need privileges to get at the encrypted passwords.
    Returns false if we weren't able to get any passwords, and therefore,
    locking isn't possible.  (It will also have written to stderr.)
  */
@@ -236,5 +241,4 @@ passwd_valid_p (const char *typed_passwd)
 Bool lock_init (int argc, char **argv) { return True; }
 #endif /* VMS */
 
-
 #endif /* NO_LOCKING -- whole file */