diff options
author | Colin Watson <cjwatson@debian.org> | 2010-01-24 21:39:36 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2010-01-24 21:39:36 +0000 |
commit | 964476f91b66c475d5b8fa1e8b28d39a97a1b56e (patch) | |
tree | d12ff16d94cffc5d84dba0193eaaa616967c9c2c /openbsd-compat/port-aix.c | |
parent | cadac134eda6ed97478afdc528a68dd33f31dbc5 (diff) | |
parent | 1e4cfeee6c17b02af09418c5afe4a4d71aaaf0c8 (diff) |
import openssh-5.3p1-gsskex-all-20100124.patch
Diffstat (limited to 'openbsd-compat/port-aix.c')
-rw-r--r-- | openbsd-compat/port-aix.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index 5b1cb7387..d9c0876f3 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c | |||
@@ -57,6 +57,8 @@ | |||
57 | 57 | ||
58 | #include "port-aix.h" | 58 | #include "port-aix.h" |
59 | 59 | ||
60 | static char *lastlogin_msg = NULL; | ||
61 | |||
60 | # ifdef HAVE_SETAUTHDB | 62 | # ifdef HAVE_SETAUTHDB |
61 | static char old_registry[REGISTRY_SIZE] = ""; | 63 | static char old_registry[REGISTRY_SIZE] = ""; |
62 | # endif | 64 | # endif |
@@ -276,23 +278,30 @@ sys_auth_record_login(const char *user, const char *host, const char *ttynm, | |||
276 | Buffer *loginmsg) | 278 | Buffer *loginmsg) |
277 | { | 279 | { |
278 | char *msg = NULL; | 280 | char *msg = NULL; |
279 | static int msg_done = 0; | ||
280 | int success = 0; | 281 | int success = 0; |
281 | 282 | ||
282 | aix_setauthdb(user); | 283 | aix_setauthdb(user); |
283 | if (loginsuccess((char *)user, (char *)host, (char *)ttynm, &msg) == 0) { | 284 | if (loginsuccess((char *)user, (char *)host, (char *)ttynm, &msg) == 0) { |
284 | success = 1; | 285 | success = 1; |
285 | if (msg != NULL && loginmsg != NULL && !msg_done) { | 286 | if (msg != NULL) { |
286 | debug("AIX/loginsuccess: msg %s", msg); | 287 | debug("AIX/loginsuccess: msg %s", msg); |
287 | buffer_append(loginmsg, msg, strlen(msg)); | 288 | if (lastlogin_msg == NULL) |
288 | xfree(msg); | 289 | lastlogin_msg = msg; |
289 | msg_done = 1; | ||
290 | } | 290 | } |
291 | } | 291 | } |
292 | aix_restoreauthdb(); | 292 | aix_restoreauthdb(); |
293 | return (success); | 293 | return (success); |
294 | } | 294 | } |
295 | 295 | ||
296 | char * | ||
297 | sys_auth_get_lastlogin_msg(const char *user, uid_t uid) | ||
298 | { | ||
299 | char *msg = lastlogin_msg; | ||
300 | |||
301 | lastlogin_msg = NULL; | ||
302 | return msg; | ||
303 | } | ||
304 | |||
296 | # ifdef CUSTOM_FAILED_LOGIN | 305 | # ifdef CUSTOM_FAILED_LOGIN |
297 | /* | 306 | /* |
298 | * record_failed_login: generic "login failed" interface function | 307 | * record_failed_login: generic "login failed" interface function |