[openssh-commits] [openssh] 08/17: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Jan 30 12:04:25 AEDT 2017


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 4ba15462ca38883b8a61a1eccc093c79462d5414
Author: guenther at openbsd.org <guenther at openbsd.org>
Date:   Sat Jan 21 11:32:04 2017 +0000

    upstream commit
    
    The POSIX APIs that that sockaddrs all ignore the s*_len
    field in the incoming socket, so userspace doesn't need to set it unless it
    has its own reasons for tracking the size along with the sockaddr.
    
    ok phessler@ deraadt@ florian@
    
    Upstream-ID: ca6e49e2f22f2b9e81d6d924b90ecd7e422e7437
---
 mux.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/mux.c b/mux.c
index 265c5f1..2d6639c 100644
--- a/mux.c
+++ b/mux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mux.c,v 1.63 2016/10/19 23:21:56 dtucker Exp $ */
+/* $OpenBSD: mux.c,v 1.64 2017/01/21 11:32:04 guenther Exp $ */
 /*
  * Copyright (c) 2002-2008 Damien Miller <djm at openbsd.org>
  *
@@ -2161,7 +2161,6 @@ int
 muxclient(const char *path)
 {
 	struct sockaddr_un addr;
-	socklen_t sun_len;
 	int sock;
 	u_int pid;
 
@@ -2185,8 +2184,6 @@ muxclient(const char *path)
 
 	memset(&addr, '\0', sizeof(addr));
 	addr.sun_family = AF_UNIX;
-	sun_len = offsetof(struct sockaddr_un, sun_path) +
-	    strlen(path) + 1;
 
 	if (strlcpy(addr.sun_path, path,
 	    sizeof(addr.sun_path)) >= sizeof(addr.sun_path))
@@ -2196,7 +2193,7 @@ muxclient(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, sun_len) == -1) {
+	if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
 		switch (muxclient_command) {
 		case SSHMUX_COMMAND_OPEN:
 		case SSHMUX_COMMAND_STDIO_FWD:

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list