mirror of
https://github.com/clearml/dropbear
synced 2025-02-12 07:25:30 +00:00
Move remotehost into svr_ses structure since we can't look it up
once we've forked (the connection socket has been closed). Fixes inetd mode. --HG-- extra : convert_revision : 7d5d152ec84fb11a188966c1400d213c908cc511
This commit is contained in:
parent
c35e38c5e9
commit
4dfb834f7c
@ -211,6 +211,9 @@ struct serversession {
|
|||||||
/* The numeric address they connected from, used for logging */
|
/* The numeric address they connected from, used for logging */
|
||||||
char * addrstring;
|
char * addrstring;
|
||||||
|
|
||||||
|
/* The resolved remote address, used for lastlog etc */
|
||||||
|
char *remotehost;
|
||||||
|
|
||||||
#ifdef __uClinux__
|
#ifdef __uClinux__
|
||||||
pid_t server_pid;
|
pid_t server_pid;
|
||||||
#endif
|
#endif
|
||||||
|
@ -253,12 +253,9 @@ static int newchansess(struct Channel *channel) {
|
|||||||
|
|
||||||
static struct logininfo*
|
static struct logininfo*
|
||||||
chansess_login_alloc(struct ChanSess *chansess) {
|
chansess_login_alloc(struct ChanSess *chansess) {
|
||||||
char *remotehost;
|
|
||||||
struct logininfo * li;
|
struct logininfo * li;
|
||||||
get_socket_address(ses.sock_in, NULL, NULL, &remotehost, NULL, 1);
|
|
||||||
li = login_alloc_entry(chansess->pid, ses.authstate.username,
|
li = login_alloc_entry(chansess->pid, ses.authstate.username,
|
||||||
remotehost, chansess->tty);
|
svr_ses.remotehost, chansess->tty);
|
||||||
m_free(remotehost);
|
|
||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,6 +101,9 @@ void svr_session(int sock, int childpipe) {
|
|||||||
m_free(host);
|
m_free(host);
|
||||||
m_free(port);
|
m_free(port);
|
||||||
|
|
||||||
|
get_socket_address(ses.sock_in, NULL, NULL,
|
||||||
|
&svr_ses.remotehost, NULL, 1);
|
||||||
|
|
||||||
/* set up messages etc */
|
/* set up messages etc */
|
||||||
ses.remoteclosed = svr_remoteclosed;
|
ses.remoteclosed = svr_remoteclosed;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user