|
Lines 69-75
Link Here
|
| 69 |
* Generate and store last login message. This must be done before |
69 |
* Generate and store last login message. This must be done before |
| 70 |
* login_login() is called and lastlog is updated. |
70 |
* login_login() is called and lastlog is updated. |
| 71 |
*/ |
71 |
*/ |
|
|
72 |
|
| 73 |
#ifdef __hpux |
| 74 |
void |
| 75 |
#else |
| 72 |
static void |
76 |
static void |
|
|
77 |
#endif |
| 73 |
store_lastlog_message(const char *user, uid_t uid) |
78 |
store_lastlog_message(const char *user, uid_t uid) |
| 74 |
{ |
79 |
{ |
| 75 |
char *time_string, hostname[MAXHOSTNAMELEN] = "", buf[512]; |
80 |
char *time_string, hostname[MAXHOSTNAMELEN] = "", buf[512]; |
|
Lines 93-98
Link Here
|
| 93 |
snprintf(buf, sizeof(buf), "Last login: %s from %s\r\n", |
98 |
snprintf(buf, sizeof(buf), "Last login: %s from %s\r\n", |
| 94 |
time_string, hostname); |
99 |
time_string, hostname); |
| 95 |
buffer_append(&loginmsg, buf, strlen(buf)); |
100 |
buffer_append(&loginmsg, buf, strlen(buf)); |
|
|
101 |
#ifdef __hpux |
| 102 |
if(options.use_login) |
| 103 |
printf("%s", (char *)buffer_ptr(&loginmsg)); |
| 104 |
#endif |
| 105 |
|
| 96 |
} |
106 |
} |
| 97 |
#endif /* NO_SSH_LASTLOG */ |
107 |
#endif /* NO_SSH_LASTLOG */ |
| 98 |
} |
108 |
} |
|
Lines 117-128
Link Here
|
| 117 |
} |
127 |
} |
| 118 |
#ifdef LOGIN_NEEDS_UTMPX |
128 |
#ifdef LOGIN_NEEDS_UTMPX |
|
|
129 |
#ifdef __hpux |
| 119 |
void |
130 |
void |
| 120 |
record_utmp_only(pid_t pid, const char *ttyname, const char *user, |
131 |
record_utmp_only(pid_t pid, const char *ttyname, const char *user, uid_t uid, |
| 121 |
const char *host, struct sockaddr * addr, socklen_t addrlen) |
132 |
const char *host, struct sockaddr * addr, socklen_t addrlen) |
|
|
133 |
#else |
| 134 |
void |
| 135 |
record_utmp_only(pid_t pid, const char *ttyname, const char *user, |
| 136 |
const char *host, struct sockaddr * addr, socklen_t addrlen) |
| 137 |
#endif |
| 122 |
{ |
138 |
{ |
| 123 |
struct logininfo *li; |
139 |
struct logininfo *li; |
|
|
140 |
#ifdef __hpux |
| 141 |
/* save previous login details before writing new */ |
| 142 |
store_lastlog_message(user, uid); |
| 143 |
#endif |
| 144 |
|
| 124 |
li = login_alloc_entry(pid, user, host, ttyname); |
145 |
li = login_alloc_entry(pid, user, host, ttyname); |
| 125 |
login_set_addr(li, addr, addrlen); |
146 |
login_set_addr(li, addr, addrlen); |
| 126 |
login_utmp_only(li); |
147 |
login_utmp_only(li); |