From 0a881e862dfb365e5e50be9139f78c633ad22ac2 Mon Sep 17 00:00:00 2001 From: jmarcus Date: Thu, 7 Mar 2002 15:59:53 +0000 Subject: [PATCH] Wrap the case of no shell into a #ifndef DISABLE_SHELLCHECK block. Also, throw a log message if this situation is encountered. Prompted by: Rolf Schoepfer MFH after: 3 days --- etc/afpd/uam.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/etc/afpd/uam.c b/etc/afpd/uam.c index 76077fd4..acd9d71c 100644 --- a/etc/afpd/uam.c +++ b/etc/afpd/uam.c @@ -1,5 +1,5 @@ /* - * $Id: uam.c,v 1.20 2002-02-13 16:44:59 srittau Exp $ + * $Id: uam.c,v 1.21 2002-03-07 15:59:53 jmarcus Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -242,9 +242,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')) { + LOG(log_info, logtype_default, "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; -- 2.39.2