summaryrefslogtreecommitdiff
path: root/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/auth.c b/auth.c
index ee21149df..7deded205 100644
--- a/auth.c
+++ b/auth.c
@@ -218,6 +218,8 @@ allowed_user(struct passwd * pw)
218 */ 218 */
219 if ( (pw->pw_uid != 0) && (geteuid() == 0) && 219 if ( (pw->pw_uid != 0) && (geteuid() == 0) &&
220 loginrestrictions(pw->pw_name, S_RLOGIN, NULL, &loginmsg) != 0) { 220 loginrestrictions(pw->pw_name, S_RLOGIN, NULL, &loginmsg) != 0) {
221 int loginrestrict_errno = errno;
222
221 if (loginmsg && *loginmsg) { 223 if (loginmsg && *loginmsg) {
222 /* Remove embedded newlines (if any) */ 224 /* Remove embedded newlines (if any) */
223 char *p; 225 char *p;
@@ -227,9 +229,13 @@ allowed_user(struct passwd * pw)
227 } 229 }
228 /* Remove trailing newline */ 230 /* Remove trailing newline */
229 *--p = '\0'; 231 *--p = '\0';
230 log("Login restricted for %s: %.100s", pw->pw_name, loginmsg); 232 log("Login restricted for %s: %.100s", pw->pw_name,
233 loginmsg);
231 } 234 }
232 return 0; 235 /* Don't fail if /etc/nologin set */
236 if (!(loginrestrict_errno == EPERM &&
237 stat(_PATH_NOLOGIN, &st) == 0))
238 return 0;
233 } 239 }
234#endif /* WITH_AIXAUTHENTICATE */ 240#endif /* WITH_AIXAUTHENTICATE */
235 241