Accepting request 561848 from home:michalsrb:branches:bnc1073996:X11:XOrg

- n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch
  * Prevent infinite loop also in case DISPLAY is non-local.

- Use spaces instead of tabs in the patches (as does the original
  source code) to avoid confusion.
- n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch
  * If authentication (with *stage == 0) failed and the variable
    XAUTHLOCALHOSTNAME wasn't set, we were never getting to stage 2
    in the original patch, causing calls to xcb_connect_to_display
    to be stuck in an infinite loop.
    Now we also go to stage 2 if the variable isn't set.

OBS-URL: https://build.opensuse.org/request/show/561848
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libxcb?expand=0&rev=47
This commit is contained in:
Michal Srb 2018-01-05 11:15:21 +00:00 committed by Git OBS Bridge
parent 62d4e8587c
commit f326c8fde7
4 changed files with 56 additions and 36 deletions

View File

@ -1,27 +1,24 @@
--- src/xcb_auth.c.orig 2009-05-29 17:48:24.000000000 +0200 --- src/xcb_auth.c.orig 2009-05-29 17:48:24.000000000 +0200
+++ src/xcb_auth.c 2009-05-29 17:56:01.000000000 +0200 +++ src/xcb_auth.c 2009-05-29 17:56:01.000000000 +0200
@@ -100,2 +100,3 @@ static Xauth *get_authptr(struct sockadd @@ -119,2 +119,3 @@ static Xauth *get_authptr(struct sockadd
int dispbuflen; int dispbuflen;
+ Xauth *authptr = NULL; + Xauth *authptr = NULL;
@@ -143,6 +143,16 @@ static Xauth *get_authptr(struct sockadd @@ -163,6 +163,16 @@ static Xauth *get_authptr(struct sockadd
- return XauGetBestAuthByAddr (family, - return XauGetBestAuthByAddr (family,
- (unsigned short) addrlen, addr,
- (unsigned short) dispbuflen, dispbuf,
- N_AUTH_PROTOS, authnames, authnameslen);
+ authptr = XauGetBestAuthByAddr (family, + authptr = XauGetBestAuthByAddr (family,
+ (unsigned short) addrlen, addr, (unsigned short) addrlen, addr,
+ (unsigned short) dispbuflen, dispbuf, (unsigned short) dispbuflen, dispbuf,
+ N_AUTH_PROTOS, authnames, authnameslen); N_AUTH_PROTOS, authnames, authnameslen);
+ // && !phostname + // && !phostname
+ if ((!authptr || !authptr->data_length) && family == FamilyLocal) { + if ((!authptr || !authptr->data_length) && family == FamilyLocal) {
+ if ( (addr = getenv("XAUTHLOCALHOSTNAME")) ) { + if ( (addr = getenv("XAUTHLOCALHOSTNAME")) ) {
+ authptr = XauGetBestAuthByAddr (family, + authptr = XauGetBestAuthByAddr (family,
+ (unsigned short) strlen(addr), addr, + (unsigned short) strlen(addr), addr,
+ (unsigned short) dispbuflen, dispbuf, + (unsigned short) dispbuflen, dispbuf,
+ N_AUTH_PROTOS, authnames, authnameslen); + N_AUTH_PROTOS, authnames, authnameslen);
+ } + }
+ } + }
+ return authptr; + return authptr;
} }

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Fri Jan 5 10:44:07 UTC 2018 - msrb@suse.com
- n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch
* Prevent infinite loop also in case DISPLAY is non-local.
-------------------------------------------------------------------
Wed Dec 20 21:07:38 UTC 2017 - aaronpuchert@alice-dsl.net
- Use spaces instead of tabs in the patches (as does the original
source code) to avoid confusion.
- n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch
* If authentication (with *stage == 0) failed and the variable
XAUTHLOCALHOSTNAME wasn't set, we were never getting to stage 2
in the original patch, causing calls to xcb_connect_to_display
to be stuck in an infinite loop.
Now we also go to stage 2 if the variable isn't set.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Dec 11 12:13:21 UTC 2017 - sndirsch@suse.com Mon Dec 11 12:13:21 UTC 2017 - sndirsch@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package libxcb # spec file for package libxcb
# #
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed

View File

@ -29,37 +29,42 @@ Index: libxcb-1.12/src/xcb_auth.c
Xauth *authptr = NULL; Xauth *authptr = NULL;
+ if (*stage == 2) + if (*stage == 2)
+ return NULL; + return NULL;
family = FamilyLocal; /* 256 */ family = FamilyLocal; /* 256 */
switch(sockname->sa_family) switch(sockname->sa_family)
{ {
@@ -161,10 +163,13 @@ static Xauth *get_authptr(struct sockadd @@ -161,18 +163,23 @@ static Xauth *get_authptr(struct sockadd
addrlen = strlen(addr); addrlen = strlen(addr);
} }
- authptr = XauGetBestAuthByAddr (family, - authptr = XauGetBestAuthByAddr (family,
- (unsigned short) addrlen, addr, - (unsigned short) addrlen, addr,
- (unsigned short) dispbuflen, dispbuf, - (unsigned short) dispbuflen, dispbuf,
- N_AUTH_PROTOS, authnames, authnameslen); - N_AUTH_PROTOS, authnames, authnameslen);
- // && !phostname
- if ((!authptr || !authptr->data_length) && family == FamilyLocal) {
- if ( (addr = getenv("XAUTHLOCALHOSTNAME")) ) {
+ if (*stage == 0) { + if (*stage == 0) {
+ authptr = XauGetBestAuthByAddr (family, + authptr = XauGetBestAuthByAddr (family,
+ (unsigned short) addrlen, addr, + (unsigned short) addrlen, addr,
+ (unsigned short) dispbuflen, dispbuf, + (unsigned short) dispbuflen, dispbuf,
+ N_AUTH_PROTOS, authnames, authnameslen); + N_AUTH_PROTOS, authnames, authnameslen);
+ *stage = 1; + *stage = 1;
+ return authptr;
+ } + }
// && !phostname + if (*stage == 1) {
if ((!authptr || !authptr->data_length) && family == FamilyLocal) { + if ((!authptr || !authptr->data_length) && family == FamilyLocal && (addr = getenv("XAUTHLOCALHOSTNAME"))) {
if ( (addr = getenv("XAUTHLOCALHOSTNAME")) ) { authptr = XauGetBestAuthByAddr (family,
@@ -172,6 +177,7 @@ static Xauth *get_authptr(struct sockadd (unsigned short) strlen(addr), addr,
(unsigned short) strlen(addr), addr, (unsigned short) dispbuflen, dispbuf,
(unsigned short) dispbuflen, dispbuf, N_AUTH_PROTOS, authnames, authnameslen);
N_AUTH_PROTOS, authnames, authnameslen); }
+ *stage = 2; + *stage = 2;
} + return authptr;
} }
return authptr; return authptr;
@@ -320,7 +326,7 @@ static struct sockaddr *get_peer_sock_na }
@@ -320,7 +327,7 @@ static struct sockaddr *get_peer_sock_na
return NULL; return NULL;
} }
@ -68,7 +73,7 @@ Index: libxcb-1.12/src/xcb_auth.c
{ {
/* code adapted from Xlib/ConnDis.c, xtrans/Xtranssocket.c, /* code adapted from Xlib/ConnDis.c, xtrans/Xtranssocket.c,
xtrans/Xtransutils.c */ xtrans/Xtransutils.c */
@@ -345,7 +351,7 @@ int _xcb_get_auth_info(int fd, xcb_auth_ @@ -345,7 +352,7 @@ int _xcb_get_auth_info(int fd, xcb_auth_
gotsockname = 1; gotsockname = 1;
} }