From: jmarcus Date: Mon, 11 Mar 2002 17:54:44 +0000 (+0000) Subject: MFH: 1.21 X-Git-Tag: netatalk-1-5-3~46 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=9291bf0115fbf5520af9b0f21ce8f15fcde0eea1 MFH: 1.21 Wrap the case of no shell into a #ifndef DISABLE_SHELLCHECK block. Also, throw a log message if this situation is encountered. --- diff --git a/etc/afpd/uam.c b/etc/afpd/uam.c index b00b83be..a07787d8 100644 --- a/etc/afpd/uam.c +++ b/etc/afpd/uam.c @@ -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;