diff options
Diffstat (limited to 'auth.c')
-rw-r--r-- | auth.c | 29 |
1 files changed, 4 insertions, 25 deletions
@@ -203,31 +203,10 @@ allowed_user(struct passwd * pw) | |||
203 | ga_free(); | 203 | ga_free(); |
204 | } | 204 | } |
205 | 205 | ||
206 | #ifdef WITH_AIXAUTHENTICATE | 206 | #ifdef CUSTOM_SYS_AUTH_ALLOWED_USER |
207 | /* | 207 | if (!sys_auth_allowed_user(pw)) |
208 | * Don't check loginrestrictions() for root account (use | 208 | return 0; |
209 | * PermitRootLogin to control logins via ssh), or if running as | 209 | #endif |
210 | * non-root user (since loginrestrictions will always fail). | ||
211 | */ | ||
212 | if ((pw->pw_uid != 0) && (geteuid() == 0)) { | ||
213 | char *msg; | ||
214 | |||
215 | if (loginrestrictions(pw->pw_name, S_RLOGIN, NULL, &msg) != 0) { | ||
216 | int loginrestrict_errno = errno; | ||
217 | |||
218 | if (msg && *msg) { | ||
219 | buffer_append(&loginmsg, msg, strlen(msg)); | ||
220 | aix_remove_embedded_newlines(msg); | ||
221 | logit("Login restricted for %s: %.100s", | ||
222 | pw->pw_name, msg); | ||
223 | } | ||
224 | /* Don't fail if /etc/nologin set */ | ||
225 | if (!(loginrestrict_errno == EPERM && | ||
226 | stat(_PATH_NOLOGIN, &st) == 0)) | ||
227 | return 0; | ||
228 | } | ||
229 | } | ||
230 | #endif /* WITH_AIXAUTHENTICATE */ | ||
231 | 210 | ||
232 | /* We found no reason not to let this user try to log on... */ | 211 | /* We found no reason not to let this user try to log on... */ |
233 | return 1; | 212 | return 1; |