]> andersk Git - openssh.git/commitdiff
- (djm) [ssh.c] Use separate var for address length
authordjm <djm>
Tue, 15 Jun 2004 01:14:45 +0000 (01:14 +0000)
committerdjm <djm>
Tue, 15 Jun 2004 01:14:45 +0000 (01:14 +0000)
ChangeLog
ssh.c

index f02cdf902813227c97aaca7a1ac99c98d7eb9c6b..3028e35663ca1321f1fe3771e2466ad4cd1e2acf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,7 @@
      [sshd.c]
      set_nonblock() instead of fnctl(...,O_NONBLOCK); "looks sane" deraadt@
  - (djm) Fix Makefile.in for connection sharing changes
+ - (djm) [ssh.c] Use separate var for address length
 
 20040603
  - (dtucker) [auth-pam.c] Don't use pam_* namespace for sshd's PAM functions.
diff --git a/ssh.c b/ssh.c
index 1c6ec8b6a29f5db1ca7e0a6ded314338c7158217..4badd2961d30810237e434dfcd97946ef0a2b663 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -1042,13 +1042,14 @@ ssh_control_listener(void)
 {
        struct sockaddr_un addr;
        mode_t old_umask;
-       
+       int addr_len;
+
        if (options.control_path == NULL || options.control_master != 1)
                return;
 
        memset(&addr, '\0', sizeof(addr));
        addr.sun_family = AF_UNIX;
-       addr.sun_len = offsetof(struct sockaddr_un, sun_path) +
+       addr_len = offsetof(struct sockaddr_un, sun_path) +
            strlen(options.control_path) + 1;
 
        if (strlcpy(addr.sun_path, options.control_path,
@@ -1059,7 +1060,7 @@ ssh_control_listener(void)
                fatal("%s socket(): %s\n", __func__, strerror(errno));
 
        old_umask = umask(0177);
-       if (bind(control_fd, (struct sockaddr*)&addr, addr.sun_len) == -1) {
+       if (bind(control_fd, (struct sockaddr*)&addr, addr_len) == -1) {
                control_fd = -1;
                if (errno == EINVAL)
                        fatal("ControlSocket %s already exists",
@@ -1229,13 +1230,13 @@ static void
 control_client(const char *path)
 {
        struct sockaddr_un addr;
-       int r, sock, exitval;
+       int r, sock, exitval, addr_len;
        Buffer m;
        char *cp;
        
        memset(&addr, '\0', sizeof(addr));
        addr.sun_family = AF_UNIX;
-       addr.sun_len = offsetof(struct sockaddr_un, sun_path) +
+       addr_len = offsetof(struct sockaddr_un, sun_path) +
            strlen(path) + 1;
 
        if (strlcpy(addr.sun_path, path,
@@ -1245,7 +1246,7 @@ control_client(const char *path)
        if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
                fatal("%s socket(): %s", __func__, strerror(errno));
 
-       if (connect(sock, (struct sockaddr*)&addr, addr.sun_len) == -1)
+       if (connect(sock, (struct sockaddr*)&addr, addr_len) == -1)
                fatal("Couldn't connect to %s: %s", path, strerror(errno));
 
        if ((cp = getenv("TERM")) == NULL)
This page took 0.044423 seconds and 5 git commands to generate.