diff options
Diffstat (limited to 'sshlogin.c')
-rw-r--r-- | sshlogin.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sshlogin.c b/sshlogin.c index cc35d6024..33bd652fb 100644 --- a/sshlogin.c +++ b/sshlogin.c | |||
@@ -86,13 +86,20 @@ get_last_login_time(uid_t uid, const char *logname, | |||
86 | static void | 86 | static void |
87 | store_lastlog_message(const char *user, uid_t uid) | 87 | store_lastlog_message(const char *user, uid_t uid) |
88 | { | 88 | { |
89 | #ifndef NO_SSH_LASTLOG | ||
89 | char *time_string, hostname[MAXHOSTNAMELEN] = "", buf[512]; | 90 | char *time_string, hostname[MAXHOSTNAMELEN] = "", buf[512]; |
90 | time_t last_login_time; | 91 | time_t last_login_time; |
91 | 92 | ||
92 | #ifndef NO_SSH_LASTLOG | ||
93 | if (!options.print_lastlog) | 93 | if (!options.print_lastlog) |
94 | return; | 94 | return; |
95 | 95 | ||
96 | # ifdef CUSTOM_SYS_AUTH_GET_LASTLOGIN_MSG | ||
97 | time_string = sys_auth_get_lastlogin_msg(user, uid); | ||
98 | if (time_string != NULL) { | ||
99 | buffer_append(&loginmsg, time_string, strlen(time_string)); | ||
100 | xfree(time_string); | ||
101 | } | ||
102 | # else | ||
96 | last_login_time = get_last_login_time(uid, user, hostname, | 103 | last_login_time = get_last_login_time(uid, user, hostname, |
97 | sizeof(hostname)); | 104 | sizeof(hostname)); |
98 | 105 | ||
@@ -107,6 +114,7 @@ store_lastlog_message(const char *user, uid_t uid) | |||
107 | time_string, hostname); | 114 | time_string, hostname); |
108 | buffer_append(&loginmsg, buf, strlen(buf)); | 115 | buffer_append(&loginmsg, buf, strlen(buf)); |
109 | } | 116 | } |
117 | # endif /* CUSTOM_SYS_AUTH_GET_LASTLOGIN_MSG */ | ||
110 | #endif /* NO_SSH_LASTLOG */ | 118 | #endif /* NO_SSH_LASTLOG */ |
111 | } | 119 | } |
112 | 120 | ||