From 97e38d866778f1c36486af5f7f1a238c41693d58 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Wed, 16 Oct 2002 00:13:52 +0000 Subject: 20021015 - (bal) Fix bug id 383 and only call loginrestrict for AIX if not root. --- auth.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'auth.c') diff --git a/auth.c b/auth.c index 48720da8..4e1dc164 100644 --- a/auth.c +++ b/auth.c @@ -202,7 +202,13 @@ allowed_user(struct passwd * pw) } #ifdef WITH_AIXAUTHENTICATE - if (loginrestrictions(pw->pw_name, S_RLOGIN, NULL, &loginmsg) != 0) { + /* + * Don't check loginrestrictions() for root account (use + * PermitRootLogin to control logins via ssh), or if running as + * non-root user (since loginrestrictions will always fail). + */ + if ( (pw->pw_uid != 0) && (geteuid() == 0) && + loginrestrictions(pw->pw_name, S_RLOGIN, NULL, &loginmsg) != 0) { if (loginmsg && *loginmsg) { /* Remove embedded newlines (if any) */ char *p; -- cgit v1.2.3