From df8c0ba7cfe0d3527794630c9cc1dd04badf01503802451a35d38856c800b3dd Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Mon, 11 Dec 2017 12:18:13 +0000 Subject: [PATCH 1/2] - fixes build against python3 (package rename of python-xcb-proto-devel to python3-xcb-proto-devel) OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libxcb?expand=0&rev=44 --- libxcb.changes | 6 ++++++ libxcb.spec | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/libxcb.changes b/libxcb.changes index 6cdc9fe..5cf96f2 100644 --- a/libxcb.changes +++ b/libxcb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Dec 11 12:13:21 UTC 2017 - sndirsch@suse.com + +- fixes build against python3 (package rename of + python-xcb-proto-devel to python3-xcb-proto-devel) + ------------------------------------------------------------------- Thu May 19 09:40:43 UTC 2016 - sndirsch@suse.com diff --git a/libxcb.spec b/libxcb.spec index f882c4a..47d40fa 100644 --- a/libxcb.spec +++ b/libxcb.spec @@ -1,7 +1,7 @@ # # spec file for package libxcb # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,12 @@ # +%if %suse_version >= 1500 +%define have_python2 0 +%else +%define have_python2 1 +%endif + Name: libxcb %define lname libxcb1 Version: 1.12 @@ -50,7 +56,11 @@ BuildRequires: xsltproc %else BuildRequires: libxslt %endif +%if %{have_python2} BuildRequires: python-xcb-proto-devel >= 7.6_1.12 +%else +BuildRequires: python3-xcb-proto-devel >= 7.6_1.12 +%endif %description The X protocol C-language Binding (XCB) is a replacement for Xlib @@ -59,8 +69,8 @@ protocol, improved threading support, and extensibility. %package -n libxcb1 Summary: X11 core protocol C library -Group: System/Libraries # O/P added for 12.2 +Group: System/Libraries Provides: xorg-x11-libxcb = 7.6_%version-%release Obsoletes: xorg-x11-libxcb < 7.6_%version-%release From 62d4e8587cbc3232637f08c017a878019f89a3f7090a3377796933a66f14760e Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Tue, 12 Dec 2017 09:06:20 +0000 Subject: [PATCH 2/2] Accepting request 556398 from home:michalsrb:branches:X11:XOrg - n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch * Modify this patch to do what it say - retry not only if the current hostname is not found in the xauthority file, but also when it is rejected by X server. (bnc#1043221) OBS-URL: https://build.opensuse.org/request/show/556398 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libxcb?expand=0&rev=45 --- libxcb.changes | 8 ++ ...-fails-retry-with-XAUTHLOCALHOSTNAME.patch | 102 ++++++++++++------ 2 files changed, 80 insertions(+), 30 deletions(-) diff --git a/libxcb.changes b/libxcb.changes index 5cf96f2..c2e63c5 100644 --- a/libxcb.changes +++ b/libxcb.changes @@ -4,6 +4,14 @@ Mon Dec 11 12:13:21 UTC 2017 - sndirsch@suse.com - fixes build against python3 (package rename of python-xcb-proto-devel to python3-xcb-proto-devel) +------------------------------------------------------------------- +Thu Nov 30 15:11:43 UTC 2017 - msrb@suse.com + +- n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch + * Modify this patch to do what it say - retry not only if the current hostname is + not found in the xauthority file, but also when it is rejected by X server. + (bnc#1043221) + ------------------------------------------------------------------- Thu May 19 09:40:43 UTC 2016 - sndirsch@suse.com diff --git a/n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch b/n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch index ae42195..2475558 100644 --- a/n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch +++ b/n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch @@ -11,11 +11,11 @@ Signed-off-by: Egbert Eich src/xcb_auth.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) -diff --git a/src/xcb_auth.c b/src/xcb_auth.c -index 6eb6528..777c772 100644 ---- a/src/xcb_auth.c -+++ b/src/xcb_auth.c -@@ -109,7 +109,7 @@ static int authname_match(enum auth_protos kind, char *name, size_t namelen) +Index: libxcb-1.12/src/xcb_auth.c +=================================================================== +--- libxcb-1.12.orig/src/xcb_auth.c ++++ libxcb-1.12/src/xcb_auth.c +@@ -109,7 +109,7 @@ static int authname_match(enum auth_prot #define SIN6_ADDR(s) (&((struct sockaddr_in6 *)s)->sin6_addr) @@ -24,7 +24,7 @@ index 6eb6528..777c772 100644 { char *addr = 0; int addrlen = 0; -@@ -119,6 +119,8 @@ static Xauth *get_authptr(struct sockaddr *sockname, int display) +@@ -119,6 +119,8 @@ static Xauth *get_authptr(struct sockadd int dispbuflen; Xauth *authptr = NULL; @@ -33,7 +33,7 @@ index 6eb6528..777c772 100644 family = FamilyLocal; /* 256 */ switch(sockname->sa_family) { -@@ -161,10 +163,13 @@ static Xauth *get_authptr(struct sockaddr *sockname, int display) +@@ -161,10 +163,13 @@ static Xauth *get_authptr(struct sockadd addrlen = strlen(addr); } @@ -51,7 +51,7 @@ index 6eb6528..777c772 100644 // && !phostname if ((!authptr || !authptr->data_length) && family == FamilyLocal) { if ( (addr = getenv("XAUTHLOCALHOSTNAME")) ) { -@@ -172,6 +177,7 @@ static Xauth *get_authptr(struct sockaddr *sockname, int display) +@@ -172,6 +177,7 @@ static Xauth *get_authptr(struct sockadd (unsigned short) strlen(addr), addr, (unsigned short) dispbuflen, dispbuf, N_AUTH_PROTOS, authnames, authnameslen); @@ -59,34 +59,76 @@ index 6eb6528..777c772 100644 } } return authptr; -@@ -328,6 +334,7 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) - int gotsockname = 0; - Xauth *authptr = 0; - int ret = 1; -+ int stage = 0; +@@ -320,7 +326,7 @@ static struct sockaddr *get_peer_sock_na + return NULL; + } - /* Some systems like hpux or Hurd do not expose peer names - * for UNIX Domain Sockets, but this is irrelevant, -@@ -344,8 +351,8 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) - } +-int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) ++int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display, int *stage) + { + /* code adapted from Xlib/ConnDis.c, xtrans/Xtranssocket.c, + xtrans/Xtransutils.c */ +@@ -345,7 +351,7 @@ int _xcb_get_auth_info(int fd, xcb_auth_ gotsockname = 1; } -- + - authptr = get_authptr(sockname, display); -+retry: -+ authptr = get_authptr(sockname, display, &stage); ++ authptr = get_authptr(sockname, display, stage); if (authptr == 0) { free(sockname); -@@ -371,7 +378,10 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) - if(!ret) - { - free(info->name); -- goto no_auth; /* cannot build auth record */ -+ info->name = 0; -+ info->namelen = 0; -+ XauDisposeAuth(authptr); -+ goto retry; /* cannot build auth record */ +Index: libxcb-1.12/src/xcbint.h +=================================================================== +--- libxcb-1.12.orig/src/xcbint.h ++++ libxcb-1.12/src/xcbint.h +@@ -219,7 +219,7 @@ int _xcb_conn_wait(xcb_connection_t *c, + + /* xcb_auth.c */ + +-int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display); ++int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display, int *stage); + + #ifdef GCC_HAS_VISIBILITY + #pragma GCC visibility pop +Index: libxcb-1.12/src/xcb_util.c +=================================================================== +--- libxcb-1.12.orig/src/xcb_util.c ++++ libxcb-1.12/src/xcb_util.c +@@ -494,6 +494,7 @@ xcb_connection_t *xcb_connect_to_display + char *protocol = NULL; + xcb_auth_info_t ourauth; + xcb_connection_t *c; ++ int stage = 0; + + int parsed = _xcb_parse_display(displayname, &host, &protocol, &display, screenp); + +@@ -510,6 +511,7 @@ xcb_connection_t *xcb_connect_to_display + } + #endif + ++ retry: + fd = _xcb_open(host, protocol, display); + + if(fd == -1) { +@@ -525,7 +527,7 @@ xcb_connection_t *xcb_connect_to_display + goto out; } - free(sockname); +- if(_xcb_get_auth_info(fd, &ourauth, display)) ++ if(_xcb_get_auth_info(fd, &ourauth, display, &stage)) + { + c = xcb_connect_to_fd(fd, &ourauth); + free(ourauth.name); +@@ -534,8 +536,11 @@ xcb_connection_t *xcb_connect_to_display + else + c = xcb_connect_to_fd(fd, 0); + +- if(c->has_error) ++ if(c->has_error) { ++ if (stage < 2) ++ goto retry; + goto out; ++ } + + /* Make sure requested screen number is in bounds for this server */ + if((screenp != NULL) && (*screenp >= (int) c->setup->roots_len)) {