comparison svr-tcpfwd.c @ 1541:bb55dffab5ba

don't log server listen ports
author Matt Johnston <matt@ucc.asn.au>
date Mon, 26 Feb 2018 22:12:39 +0800
parents 73aa542e76fe
children 2c902644036d
comparison
equal deleted inserted replaced
1540:03a42f41cf2c 1541:bb55dffab5ba
92 if (DROPBEAR_SUCCESS == ret) { 92 if (DROPBEAR_SUCCESS == ret) {
93 CHECKCLEARTOWRITE(); 93 CHECKCLEARTOWRITE();
94 buf_putbyte(ses.writepayload, SSH_MSG_REQUEST_SUCCESS); 94 buf_putbyte(ses.writepayload, SSH_MSG_REQUEST_SUCCESS);
95 buf_putint(ses.writepayload, allocated_listen_port); 95 buf_putint(ses.writepayload, allocated_listen_port);
96 encrypt_packet(); 96 encrypt_packet();
97 wantreply = 0; //so out does not do so 97 wantreply = 0; /* avoid out: below sending another reply */
98 } 98 }
99 } else if (strcmp("cancel-tcpip-forward", reqname) == 0) { 99 } else if (strcmp("cancel-tcpip-forward", reqname) == 0) {
100 ret = svr_cancelremotetcp(); 100 ret = svr_cancelremotetcp();
101 } else { 101 } else {
102 TRACE(("reqname isn't tcpip-forward: '%s'", reqname)) 102 TRACE(("reqname isn't tcpip-forward: '%s'", reqname))
210 210
211 ret = listen_tcpfwd(tcpinfo); 211 ret = listen_tcpfwd(tcpinfo);
212 if (DROPBEAR_SUCCESS == ret) { 212 if (DROPBEAR_SUCCESS == ret) {
213 tcpinfo->listenport = get_sock_port(ses.listeners[0]->socks[0]); 213 tcpinfo->listenport = get_sock_port(ses.listeners[0]->socks[0]);
214 *allocated_listen_port = tcpinfo->listenport; 214 *allocated_listen_port = tcpinfo->listenport;
215 dropbear_log(LOG_INFO, "tcpip-forward %s:%d '%s'",
216 ((NULL == tcpinfo->listenaddr)?"localhost":tcpinfo->listenaddr),
217 tcpinfo->listenport, ses.authstate.pw_name);
218 } 215 }
219 216
220 out: 217 out:
221 if (ret == DROPBEAR_FAILURE) { 218 if (ret == DROPBEAR_FAILURE) {
222 /* we only free it if a listener wasn't created, since the listener 219 /* we only free it if a listener wasn't created, since the listener