version 1.302, 2018/07/09 21:20:26 |
version 1.303, 2018/07/09 21:26:02 |
|
|
#include "ssh2.h" |
#include "ssh2.h" |
#include "sshpty.h" |
#include "sshpty.h" |
#include "packet.h" |
#include "packet.h" |
#include "buffer.h" |
#include "sshbuf.h" |
|
#include "ssherr.h" |
#include "match.h" |
#include "match.h" |
#include "uidswap.h" |
#include "uidswap.h" |
#include "compat.h" |
#include "compat.h" |
|
|
extern u_int utmp_len; |
extern u_int utmp_len; |
extern int startup_pipe; |
extern int startup_pipe; |
extern void destroy_sensitive_data(void); |
extern void destroy_sensitive_data(void); |
extern Buffer loginmsg; |
extern struct sshbuf *loginmsg; |
extern struct sshauthopt *auth_opts; |
extern struct sshauthopt *auth_opts; |
char *tun_fwd_ifnames; /* serverloop.c */ |
char *tun_fwd_ifnames; /* serverloop.c */ |
|
|
|
|
static void |
static void |
display_loginmsg(void) |
display_loginmsg(void) |
{ |
{ |
if (buffer_len(&loginmsg) > 0) { |
int r; |
buffer_append(&loginmsg, "\0", 1); |
|
printf("%s", (char *)buffer_ptr(&loginmsg)); |
if (sshbuf_len(loginmsg) == 0) |
buffer_clear(&loginmsg); |
return; |
} |
if ((r = sshbuf_put_u8(loginmsg, 0)) != 0) |
|
fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
|
printf("%s", (char *)sshbuf_ptr(loginmsg)); |
|
sshbuf_reset(loginmsg); |
} |
} |
|
|
static void |
static void |
|
|
* it to the user, otherwise multiple sessions may accumulate |
* it to the user, otherwise multiple sessions may accumulate |
* multiple copies of the login messages. |
* multiple copies of the login messages. |
*/ |
*/ |
buffer_clear(&loginmsg); |
sshbuf_reset(loginmsg); |
|
|
return ret; |
return ret; |
} |
} |