Bugzilla – Attachment 899 Details for
Bug 1032
PrintLastLog is not working with UseLogin yes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Print the Login messages if UseLogin is enabled
PrintLastLog-UseLogin.patch (text/plain), 2.21 KB, created by
senthilkumar
on 2005-05-06 18:34:36 AEST
(
hide
)
Description:
Print the Login messages if UseLogin is enabled
Filename:
MIME Type:
Creator:
senthilkumar
Created:
2005-05-06 18:34:36 AEST
Size:
2.21 KB
patch
obsolete
>diff -Nur openssh-4.0p1/session.c openssh-4.0p1-lastlog/session.c >--- openssh-4.0p1/session.c 2005-03-06 17:08:52.000000000 +0530 >+++ openssh-4.0p1-lastlog/session.c 2005-05-06 12:51:49.000000000 +0530 >@@ -646,7 +646,7 @@ > } > } > >- record_utmp_only(pid, s->tty, s->pw->pw_name, >+ record_utmp_only(pid, s->tty, s->pw->pw_name, s->pw->pw_uid, > get_remote_name_or_ip(utmp_len, options.use_dns), > (struct sockaddr *)&from, fromlen); > } >diff -Nur openssh-4.0p1/sshlogin.c openssh-4.0p1-lastlog/sshlogin.c >--- openssh-4.0p1/sshlogin.c 2004-08-13 16:51:47.000000000 +0530 >+++ openssh-4.0p1-lastlog/sshlogin.c 2005-05-06 12:53:29.000000000 +0530 >@@ -93,6 +93,9 @@ > snprintf(buf, sizeof(buf), "Last login: %s from %s\r\n", > time_string, hostname); > buffer_append(&loginmsg, buf, strlen(buf)); >+ if(options.use_login) >+ printf("%s", (char *)buffer_ptr(&loginmsg)); >+ > } > #endif /* NO_SSH_LASTLOG */ > } >@@ -118,11 +121,14 @@ > > #ifdef LOGIN_NEEDS_UTMPX > void >-record_utmp_only(pid_t pid, const char *ttyname, const char *user, >+record_utmp_only(pid_t pid, const char *ttyname, const char *user, uid_t uid, > const char *host, struct sockaddr * addr, socklen_t addrlen) > { > struct logininfo *li; > >+ /* save previous login details before writing new */ >+ store_lastlog_message(user, uid); >+ > li = login_alloc_entry(pid, user, host, ttyname); > login_set_addr(li, addr, addrlen); > login_utmp_only(li); >diff -Nur openssh-4.0p1/sshlogin.h openssh-4.0p1-lastlog/sshlogin.h >--- openssh-4.0p1/sshlogin.h 2003-01-02 05:13:56.000000000 +0530 >+++ openssh-4.0p1-lastlog/sshlogin.h 2005-05-06 12:54:32.000000000 +0530 >@@ -21,8 +21,10 @@ > u_long get_last_login_time(uid_t, const char *, char *, u_int); > > #ifdef LOGIN_NEEDS_UTMPX >-void record_utmp_only(pid_t, const char *, const char *, const char *, >+void record_utmp_only(pid_t, const char *, const char *, uid_t, const char *, > struct sockaddr *, socklen_t); > #endif > >+store_lastlog_message(const char *user, uid_t uid); >+ > #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 1032
:
899
|
901
|
905
|
921