summaryrefslogtreecommitdiffstats
path: root/auth.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-05-17 22:00:02 +1000
committerDamien Miller <djm@mindrot.org>2000-05-17 22:00:02 +1000
commitd2c208a2d37104c5c429659ac708d6288400ecd2 (patch)
tree595741836a9444811c123b6555c1d47f5def2a95 /auth.c
parent8d1fd57a971159c828ab778136ca6332f0ba8f34 (diff)
- Applied Tom Bertelson's <tbert@abac.com> AIX authentication fix
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/auth.c b/auth.c
index 3bfcfd8e..c3063e42 100644
--- a/auth.c
+++ b/auth.c
@@ -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... */