summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-12-07 15:38:31 +1100
committerDamien Miller <djm@mindrot.org>1999-12-07 15:38:31 +1100
commit037a0dc0835bb5a442bdcbeecdd5baed723f0b45 (patch)
treed02954d57ac437fd036e3e9544f24559ca8f0f0f /channels.c
parenteabf3417bc73ca9546a3ed489cd809ffdf303853 (diff)
- Merged more OpenBSD changes:
- [atomicio.c authfd.c scp.c serverloop.c ssh.h sshconnect.c sshd.c] move atomicio into it's own file. wrap all socket write()s which were doing write(sock, buf, len) != len, with atomicio() calls. - [auth-skey.c] fd leak - [authfile.c] properly name fd variable - [channels.c] display great hatred towards strcpy - [pty.c pty.h sshd.c] use openpty() if it exists (it does on BSD4_4) - [tildexpand.c] check for ~ expansion past MAXPATHLEN - Modified helper.c to use new atomicio function. - Reformat Makefile a little - Moved RC4 routines from rc4.[ch] into helper.c - Added autoconf code to detect /dev/ptmx (Solaris) and /dev/ptc (AIX)
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/channels.c b/channels.c
index 013823659..6c2fb73aa 100644
--- a/channels.c
+++ b/channels.c
@@ -16,7 +16,7 @@
16 */ 16 */
17 17
18#include "includes.h" 18#include "includes.h"
19RCSID("$Id: channels.c,v 1.9 1999/12/06 00:47:29 damien Exp $"); 19RCSID("$Id: channels.c,v 1.10 1999/12/07 04:38:32 damien Exp $");
20 20
21#include "ssh.h" 21#include "ssh.h"
22#include "packet.h" 22#include "packet.h"
@@ -921,7 +921,7 @@ channel_request_local_forwarding(u_short port, const char *host,
921 /* Allocate a channel number for the socket. */ 921 /* Allocate a channel number for the socket. */
922 ch = channel_allocate(SSH_CHANNEL_PORT_LISTENER, sock, 922 ch = channel_allocate(SSH_CHANNEL_PORT_LISTENER, sock,
923 xstrdup("port listener")); 923 xstrdup("port listener"));
924 strcpy(channels[ch].path, host); 924 strlcpy(channels[ch].path, host, sizeof(channels[ch].path));
925 channels[ch].host_port = host_port; 925 channels[ch].host_port = host_port;
926 channels[ch].listening_port = port; 926 channels[ch].listening_port = port;
927} 927}
@@ -1498,7 +1498,8 @@ auth_input_request_forwarding(struct passwd * pw)
1498 /* Allocate a channel for the authentication agent socket. */ 1498 /* Allocate a channel for the authentication agent socket. */
1499 newch = channel_allocate(SSH_CHANNEL_AUTH_SOCKET, sock, 1499 newch = channel_allocate(SSH_CHANNEL_AUTH_SOCKET, sock,
1500 xstrdup("auth socket")); 1500 xstrdup("auth socket"));
1501 strcpy(channels[newch].path, channel_forwarded_auth_socket_name); 1501 strlcpy(channels[newch].path, channel_forwarded_auth_socket_name,
1502 sizeof(channels[newch].path));
1502} 1503}
1503 1504
1504/* This is called to process an SSH_SMSG_AGENT_OPEN message. */ 1505/* This is called to process an SSH_SMSG_AGENT_OPEN message. */