The PrintLastLog directive is not displaying the Last Login messages when UseLogin is enabled.
Created attachment 899 [details] Print the Login messages if UseLogin is enabled The attached patch solves the problem in HP-UX. Im not sure about portability problems on other platforms. Comments are welcome for the Patch. The problem is that searching the wtmp record for Last Login is skipped when UseLogin is enabled.
Created attachment 901 [details] Update on patch for hpux I feel it is specific for HP-UX. Hence a update in patch.
Created attachment 905 [details] Optimized Patch for HP-UX The current Patch is optimized and tested. Some unwanted declarations are removed from the previous patch.
Comment on attachment 905 [details] Optimized Patch for HP-UX > #ifdef LOGIN_NEEDS_UTMPX >-void record_utmp_only(pid_t, const char *, const char *, const char *, >+#ifdef __hpux >+void record_utmp_only(pid_t, const char *, const char *, uid_t, const char *, > struct sockaddr *, socklen_t); >+#else >+void record_utmp_only(pid_t, const char *, const char *, const char *, >+ struct sockaddr *, socklen_t); >+#endif The prototype should never be dependant on the OS in use - that is the whole point of the loginrec.c code. Please read the long coment at the top of loginrec.c.
Ok,let me remove the OS tag and make the change as global. Will this addition of one more argument creates problem in other platforms? 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
Yes, that approach is fine - it is better to pass arguments that are unused on some systems than make the list of arguments system dependant.
Created attachment 921 [details] Patch with removed OS dependent prototypes The patch is modified based on Damien's feedback. Let me know the comments.
UseLogin is deprecated in OpenSSH 7.4
closing resolved bugs as of 8.6p1 release