diff options
Diffstat (limited to 'auth.c')
-rw-r--r-- | auth.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -202,7 +202,13 @@ allowed_user(struct passwd * pw) | |||
202 | } | 202 | } |
203 | 203 | ||
204 | #ifdef WITH_AIXAUTHENTICATE | 204 | #ifdef WITH_AIXAUTHENTICATE |
205 | if (loginrestrictions(pw->pw_name, S_RLOGIN, NULL, &loginmsg) != 0) { | 205 | /* |
206 | * Don't check loginrestrictions() for root account (use | ||
207 | * PermitRootLogin to control logins via ssh), or if running as | ||
208 | * non-root user (since loginrestrictions will always fail). | ||
209 | */ | ||
210 | if ( (pw->pw_uid != 0) && (geteuid() == 0) && | ||
211 | loginrestrictions(pw->pw_name, S_RLOGIN, NULL, &loginmsg) != 0) { | ||
206 | if (loginmsg && *loginmsg) { | 212 | if (loginmsg && *loginmsg) { |
207 | /* Remove embedded newlines (if any) */ | 213 | /* Remove embedded newlines (if any) */ |
208 | char *p; | 214 | char *p; |