]> arthur.barton.de Git - netatalk.git/commitdiff
MFH: 1.21
authorjmarcus <jmarcus>
Mon, 11 Mar 2002 17:54:44 +0000 (17:54 +0000)
committerjmarcus <jmarcus>
Mon, 11 Mar 2002 17:54:44 +0000 (17:54 +0000)
Wrap the case of no shell into a #ifndef DISABLE_SHELLCHECK block.  Also,
throw a log message if this situation is encountered.

etc/afpd/uam.c

index b00b83be875ae3326ee9c1e9fc4e14b27e993f78..a07787d8d061d0aad7a576b834ead48b549bf092 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uam.c,v 1.15.2.2 2002-01-14 02:54:47 srittau Exp $
+ * $Id: uam.c,v 1.15.2.3 2002-03-11 17:54:44 jmarcus Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -239,9 +239,16 @@ int uam_checkuser(const struct passwd *pwd)
 {
     const char *p;
 
-    if (!pwd || !pwd->pw_shell || (*pwd->pw_shell == '\0'))
+    if (!pwd)
         return -1;
 
+#ifndef DISABLE_SHELLCHECK
+       if (!pwd->pw_shell || (*pwd->pw_shell == '\0')) {
+               syslog(LOG_INFO, "uam_checkuser: User %s does not have a shell", pwd->pw_name);
+               return -1;
+       }
+#endif
+
     while ((p = getusershell())) {
         if ( strcmp( p, pwd->pw_shell ) == 0 )
             break;