diff options
author | Damien Miller <djm@mindrot.org> | 2000-05-17 22:00:02 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-05-17 22:00:02 +1000 |
commit | d2c208a2d37104c5c429659ac708d6288400ecd2 (patch) | |
tree | 595741836a9444811c123b6555c1d47f5def2a95 /auth.c | |
parent | 8d1fd57a971159c828ab778136ca6332f0ba8f34 (diff) |
- Applied Tom Bertelson's <tbert@abac.com> AIX authentication fix
Diffstat (limited to 'auth.c')
-rw-r--r-- | auth.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -19,6 +19,9 @@ RCSID("$OpenBSD: auth.c,v 1.6 2000/04/26 21:28:31 markus Exp $"); #include "compat.h" #include "channels.h" #include "match.h" +#ifdef HAVE_LOGIN_H +#include <login.h> +#endif #include "bufaux.h" #include "ssh2.h" @@ -111,8 +114,20 @@ allowed_user(struct passwd * pw) } #ifdef WITH_AIXAUTHENTICATE - if (loginrestrictions(pw->pw_name,S_LOGIN,NULL,&loginmsg) != 0) + if (loginrestrictions(pw->pw_name,S_RLOGIN,NULL,&loginmsg) != 0) { + if (loginmsg && *loginmsg) { + /* Remove embedded newlines (if any) */ + char *p; + for (p = loginmsg; *p; p++) + if (*p == '\n') + *p = ' '; + /* Remove trailing newline */ + *--p = '\0'; + log("Login restricted for %s: %.100s", + pw->pw_name, loginmsg); + } return 0; + } #endif /* WITH_AIXAUTHENTICATE */ /* We found no reason not to let this user try to log on... */ |