Bugzilla – Attachment 1889 Details for
Bug 1789
On linux use abstract socket for X11 connections if possible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch solving the problem
openssh-5.5p1-x11.patch (text/plain), 1.32 KB, created by
jchadima
on 2010-06-30 21:07:19 AEST
(
hide
)
Description:
patch solving the problem
Filename:
MIME Type:
Creator:
jchadima
Created:
2010-06-30 21:07:19 AEST
Size:
1.32 KB
patch
obsolete
>diff -up openssh-5.5p1/channels.c.x11 openssh-5.5p1/channels.c >--- openssh-5.5p1/channels.c.x11 2010-06-30 12:30:19.000000000 +0200 >+++ openssh-5.5p1/channels.c 2010-06-30 12:46:07.000000000 +0200 >@@ -3332,7 +3332,7 @@ x11_create_display_inet(int x11_display_ > } > > static int >-connect_local_xsocket_path(const char *pathname) >+connect_local_xsocket_path(const char *pathname, int len) > { > int sock; > struct sockaddr_un addr; >@@ -3342,7 +3342,9 @@ connect_local_xsocket_path(const char *p > error("socket: %.100s", strerror(errno)); > memset(&addr, 0, sizeof(addr)); > addr.sun_family = AF_UNIX; >- strlcpy(addr.sun_path, pathname, sizeof addr.sun_path); >+ if (len > sizeof addr.sun_path) >+ len = sizeof addr.sun_path; >+ memcpy(addr.sun_path, pathname , len); > if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == 0) > return sock; > close(sock); >@@ -3354,8 +3356,18 @@ static int > connect_local_xsocket(u_int dnr) > { > char buf[1024]; >- snprintf(buf, sizeof buf, _PATH_UNIX_X, dnr); >- return connect_local_xsocket_path(buf); >+#ifdef linux >+ int len, ret; >+#endif >+ len = snprintf(buf, sizeof buf, _PATH_UNIX_X, dnr); >+#ifdef linux >+ /* try abstract socket first */ >+ buf[0] = '\0'; >+ if ((ret = connect_local_xsocket_path(buf, len)) >= 0) >+ return ret; >+ buf[0] = '/'; >+#endif >+ return connect_local_xsocket_path(buf, len); > } > > int
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1789
:
1889
|
1890
|
1891