Bugzilla – Attachment 1636 Details for
Bug 1595
Server option PrintLastLog does not work on AIX
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
option 2: leave print_lastlog logic all in sshlogin.c
openssh-aix-printlastlogin-opt2.patch (text/plain), 2.91 KB, created by
Darren Tucker
on 2009-05-04 13:55:28 AEST
(
hide
)
Description:
option 2: leave print_lastlog logic all in sshlogin.c
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2009-05-04 13:55:28 AEST
Size:
2.91 KB
patch
obsolete
>Index: sshlogin.c >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/sshlogin.c,v >retrieving revision 1.34 >diff -u -p -r1.34 sshlogin.c >--- sshlogin.c 4 May 2009 02:52:47 -0000 1.34 >+++ sshlogin.c 4 May 2009 03:35:30 -0000 >@@ -93,6 +93,13 @@ store_lastlog_message(const char *user, > if (!options.print_lastlog) > return; > >+# ifdef CUSTOM_SYS_AUTH_GET_LASTLOGIN_MSG >+ time_string = sys_auth_get_lastlogin_msg(user, uid); >+ if (time_string != NULL) { >+ buffer_append(&loginmsg, time_string, strlen(time_string)); >+ xfree(time_string); >+ } >+# else > last_login_time = get_last_login_time(uid, user, hostname, > sizeof(hostname)); > >@@ -107,6 +114,7 @@ store_lastlog_message(const char *user, > time_string, hostname); > buffer_append(&loginmsg, buf, strlen(buf)); > } >+# endif /* CUSTOM_SYS_AUTH_GET_LASTLOGIN_MSG */ > #endif /* NO_SSH_LASTLOG */ > } > >Index: openbsd-compat/port-aix.c >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/openbsd-compat/port-aix.c,v >retrieving revision 1.43 >diff -u -p -r1.43 port-aix.c >--- openbsd-compat/port-aix.c 9 Mar 2008 05:36:55 -0000 1.43 >+++ openbsd-compat/port-aix.c 4 May 2009 03:44:45 -0000 >@@ -57,6 +57,8 @@ > > #include "port-aix.h" > >+static char *lastlogin_msg = NULL; >+ > # ifdef HAVE_SETAUTHDB > static char old_registry[REGISTRY_SIZE] = ""; > # endif >@@ -276,23 +278,30 @@ sys_auth_record_login(const char *user, > Buffer *loginmsg) > { > char *msg = NULL; >- static int msg_done = 0; > int success = 0; > > aix_setauthdb(user); > if (loginsuccess((char *)user, (char *)host, (char *)ttynm, &msg) == 0) { > success = 1; >- if (msg != NULL && loginmsg != NULL && !msg_done) { >+ if (msg != NULL) { > debug("AIX/loginsuccess: msg %s", msg); >- buffer_append(loginmsg, msg, strlen(msg)); >- xfree(msg); >- msg_done = 1; >+ if (lastlogin_msg == NULL) >+ lastlogin_msg = msg; > } > } > aix_restoreauthdb(); > return (success); > } > >+char * >+sys_auth_get_lastlogin_msg(const char *user, uid_t uid) >+{ >+ char *msg = lastlogin_msg; >+ >+ lastlogin_msg = NULL; >+ return msg; >+} >+ > # ifdef CUSTOM_FAILED_LOGIN > /* > * record_failed_login: generic "login failed" interface function >Index: openbsd-compat/port-aix.h >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/openbsd-compat/port-aix.h,v >retrieving revision 1.29 >diff -u -p -r1.29 port-aix.h >--- openbsd-compat/port-aix.h 9 Mar 2008 05:36:55 -0000 1.29 >+++ openbsd-compat/port-aix.h 4 May 2009 03:36:42 -0000 >@@ -87,6 +87,8 @@ void aix_usrinfo(struct passwd *); > int sys_auth_allowed_user(struct passwd *, Buffer *); > # define CUSTOM_SYS_AUTH_RECORD_LOGIN 1 > int sys_auth_record_login(const char *, const char *, const char *, Buffer *); >+# define CUSTOM_SYS_AUTH_GET_LASTLOGIN_MSG >+char *sys_auth_get_lastlogin_msg(const char *, uid_t); > # define CUSTOM_FAILED_LOGIN 1 > #endif >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1595
:
1631
|
1632
|
1633
|
1634
|
1635
| 1636