rpms/libxcb/devel libxcb-1.0-abstract-socket.patch, NONE, 1.1 libxcb.spec, 1.2, 1.3

Adam Jackson (ajax) fedora-extras-commits at redhat.com
Fri Aug 24 21:44:37 UTC 2007


Author: ajax

Update of /cvs/pkgs/rpms/libxcb/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4479

Modified Files:
	libxcb.spec 
Added Files:
	libxcb-1.0-abstract-socket.patch 
Log Message:
* Fri Aug 24 2007 Adam Jackson <ajax at redhat.com> 1.0-3
- libxcb-1.0-abstract-socket.patch: When connecting to the X server, prefer
  abstract-namespace unix sockets to filesystem-bound sockets.


libxcb-1.0-abstract-socket.patch:

--- NEW FILE libxcb-1.0-abstract-socket.patch ---
diff -up libxcb-1.0/src/xcb_util.c.jx libxcb-1.0/src/xcb_util.c
--- libxcb-1.0/src/xcb_util.c.jx	2006-11-21 23:20:15.000000000 -0500
+++ libxcb-1.0/src/xcb_util.c	2007-08-24 14:02:08.000000000 -0400
@@ -213,14 +213,23 @@ static int _xcb_open_tcp(char *host, con
 static int _xcb_open_unix(const char *file)
 {
     int fd;
-    struct sockaddr_un addr = { AF_UNIX };
-    strcpy(addr.sun_path, file);
+    struct sockaddr_un addr;
+    memset(&addr, 0, sizeof(addr));
+    addr.sun_family = AF_UNIX;
 
     fd = socket(AF_UNIX, SOCK_STREAM, 0);
     if(fd == -1)
         return -1;
+
+    /* try the abstract socket first */
+    strcpy(addr.sun_path + 1, file);
+    if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) != -1)
+        return fd;
+
+    strcpy(addr.sun_path, file);
     if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1)
         return -1;
+
     return fd;
 }
 


Index: libxcb.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libxcb/devel/libxcb.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- libxcb.spec	22 Aug 2007 18:50:23 -0000	1.2
+++ libxcb.spec	24 Aug 2007 21:44:02 -0000	1.3
@@ -1,6 +1,6 @@
 Name:           libxcb
 Version:        1.0
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        A C binding to the X11 protocol
 
 Group:          System Environment/Libraries
@@ -10,6 +10,7 @@
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Patch0:         libxcb-1.0-no-pthread-stubs.patch
+Patch1:		libxcb-1.0-abstract-socket.patch
 
 BuildRequires:  autoconf automake libtool pkgconfig
 BuildRequires:  doxygen
@@ -44,7 +45,8 @@
 
 %prep
 %setup -q
-%patch -p1 -b .pthread-stubs
+%patch0 -p1 -b .pthread-stubs
+%patch1 -p1 -b .abstract
 
 %build
 autoreconf -v --install
@@ -78,6 +80,10 @@
 %{_datadir}/doc/%{name}-%{version}
 
 %changelog
+* Fri Aug 24 2007 Adam Jackson <ajax at redhat.com> 1.0-3
+- libxcb-1.0-abstract-socket.patch: When connecting to the X server, prefer
+  abstract-namespace unix sockets to filesystem-bound sockets.
+
 * Wed Aug 22 2007 Adam Jackson <ajax at redhat.com> - 1.0-2
 - Rebuild for PPC toolchain bug
 




More information about the fedora-extras-commits mailing list