diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | ssh.c | 13 |
2 files changed, 9 insertions, 7 deletions
@@ -34,6 +34,7 @@ | |||
34 | [sshd.c] | 34 | [sshd.c] |
35 | set_nonblock() instead of fnctl(...,O_NONBLOCK); "looks sane" deraadt@ | 35 | set_nonblock() instead of fnctl(...,O_NONBLOCK); "looks sane" deraadt@ |
36 | - (djm) Fix Makefile.in for connection sharing changes | 36 | - (djm) Fix Makefile.in for connection sharing changes |
37 | - (djm) [ssh.c] Use separate var for address length | ||
37 | 38 | ||
38 | 20040603 | 39 | 20040603 |
39 | - (dtucker) [auth-pam.c] Don't use pam_* namespace for sshd's PAM functions. | 40 | - (dtucker) [auth-pam.c] Don't use pam_* namespace for sshd's PAM functions. |
@@ -1218,4 +1219,4 @@ | |||
1218 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 1219 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
1219 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 1220 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
1220 | 1221 | ||
1221 | $Id: ChangeLog,v 1.3384 2004/06/15 00:44:40 djm Exp $ | 1222 | $Id: ChangeLog,v 1.3385 2004/06/15 01:14:45 djm Exp $ |
@@ -1042,13 +1042,14 @@ ssh_control_listener(void) | |||
1042 | { | 1042 | { |
1043 | struct sockaddr_un addr; | 1043 | struct sockaddr_un addr; |
1044 | mode_t old_umask; | 1044 | mode_t old_umask; |
1045 | 1045 | int addr_len; | |
1046 | |||
1046 | if (options.control_path == NULL || options.control_master != 1) | 1047 | if (options.control_path == NULL || options.control_master != 1) |
1047 | return; | 1048 | return; |
1048 | 1049 | ||
1049 | memset(&addr, '\0', sizeof(addr)); | 1050 | memset(&addr, '\0', sizeof(addr)); |
1050 | addr.sun_family = AF_UNIX; | 1051 | addr.sun_family = AF_UNIX; |
1051 | addr.sun_len = offsetof(struct sockaddr_un, sun_path) + | 1052 | addr_len = offsetof(struct sockaddr_un, sun_path) + |
1052 | strlen(options.control_path) + 1; | 1053 | strlen(options.control_path) + 1; |
1053 | 1054 | ||
1054 | if (strlcpy(addr.sun_path, options.control_path, | 1055 | if (strlcpy(addr.sun_path, options.control_path, |
@@ -1059,7 +1060,7 @@ ssh_control_listener(void) | |||
1059 | fatal("%s socket(): %s\n", __func__, strerror(errno)); | 1060 | fatal("%s socket(): %s\n", __func__, strerror(errno)); |
1060 | 1061 | ||
1061 | old_umask = umask(0177); | 1062 | old_umask = umask(0177); |
1062 | if (bind(control_fd, (struct sockaddr*)&addr, addr.sun_len) == -1) { | 1063 | if (bind(control_fd, (struct sockaddr*)&addr, addr_len) == -1) { |
1063 | control_fd = -1; | 1064 | control_fd = -1; |
1064 | if (errno == EINVAL) | 1065 | if (errno == EINVAL) |
1065 | fatal("ControlSocket %s already exists", | 1066 | fatal("ControlSocket %s already exists", |
@@ -1229,13 +1230,13 @@ static void | |||
1229 | control_client(const char *path) | 1230 | control_client(const char *path) |
1230 | { | 1231 | { |
1231 | struct sockaddr_un addr; | 1232 | struct sockaddr_un addr; |
1232 | int r, sock, exitval; | 1233 | int r, sock, exitval, addr_len; |
1233 | Buffer m; | 1234 | Buffer m; |
1234 | char *cp; | 1235 | char *cp; |
1235 | 1236 | ||
1236 | memset(&addr, '\0', sizeof(addr)); | 1237 | memset(&addr, '\0', sizeof(addr)); |
1237 | addr.sun_family = AF_UNIX; | 1238 | addr.sun_family = AF_UNIX; |
1238 | addr.sun_len = offsetof(struct sockaddr_un, sun_path) + | 1239 | addr_len = offsetof(struct sockaddr_un, sun_path) + |
1239 | strlen(path) + 1; | 1240 | strlen(path) + 1; |
1240 | 1241 | ||
1241 | if (strlcpy(addr.sun_path, path, | 1242 | if (strlcpy(addr.sun_path, path, |
@@ -1245,7 +1246,7 @@ control_client(const char *path) | |||
1245 | if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) | 1246 | if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) |
1246 | fatal("%s socket(): %s", __func__, strerror(errno)); | 1247 | fatal("%s socket(): %s", __func__, strerror(errno)); |
1247 | 1248 | ||
1248 | if (connect(sock, (struct sockaddr*)&addr, addr.sun_len) == -1) | 1249 | if (connect(sock, (struct sockaddr*)&addr, addr_len) == -1) |
1249 | fatal("Couldn't connect to %s: %s", path, strerror(errno)); | 1250 | fatal("Couldn't connect to %s: %s", path, strerror(errno)); |
1250 | 1251 | ||
1251 | if ((cp = getenv("TERM")) == NULL) | 1252 | if ((cp = getenv("TERM")) == NULL) |