]> code.citadel.org Git - citadel.git/blobdiff - citadel/chkpwd.c
* Changed the comments at the beginning of each file to a consistent format
[citadel.git] / citadel / chkpwd.c
index 3dd3264f210f0b835caf7d052b5e7cca6f9d71c5..b96ac7392a54845d964fbd9572ffdde486864d24 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * chkpwd.c: a setuid helper program for machines which use shadow passwords
+ * $Id$
+ *
+ * a setuid helper program for machines which use shadow passwords
  * by Nathan Bryant, March 1999
  *
- * $Id$
  */
 
 #include <pwd.h>
@@ -25,8 +26,9 @@ int main(void)
   char buf[256];
 
   get_config();
+  uid = getuid();
 
-  if ((uid = getuid()) != BBSUID)
+  if (uid != BBSUID && uid)
     {
       pw = getpwuid(uid);
       openlog("chkpwd", LOG_CONS, LOG_AUTH);