Accepting request 356078 from X11:XOrg
- n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch: If auth with credentials for hostname fails retry with XAUTHLOCALHOSTNAME (boo#906622). OBS-URL: https://build.opensuse.org/request/show/356078 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libxcb?expand=0&rev=20
This commit is contained in:
commit
952b350564
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Dec 23 23:16:43 UTC 2015 - eich@suse.com
|
||||||
|
|
||||||
|
- n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch:
|
||||||
|
If auth with credentials for hostname fails retry with XAUTHLOCALHOSTNAME
|
||||||
|
(boo#906622).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Sep 6 16:21:14 UTC 2015 - tobias.johannes.klausmann@mni.thm.de
|
Sun Sep 6 16:21:14 UTC 2015 - tobias.johannes.klausmann@mni.thm.de
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package libxcb
|
# spec file for package libxcb
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
# Copyright (c) 2016 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
|
||||||
@ -31,7 +31,7 @@ Url: http://xcb.freedesktop.org/
|
|||||||
Source: %{name}-%{version}.tar.bz2
|
Source: %{name}-%{version}.tar.bz2
|
||||||
Source1: baselibs.conf
|
Source1: baselibs.conf
|
||||||
Patch1: bug-262309_xcb-xauthlocalhostname.diff
|
Patch1: bug-262309_xcb-xauthlocalhostname.diff
|
||||||
|
Patch2: n_If-auth-with-credentials-for-hostname-fails-retry-with-XAUTHLOCALHOSTNAME.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildRequires: autoconf >= 2.57
|
BuildRequires: autoconf >= 2.57
|
||||||
BuildRequires: automake
|
BuildRequires: automake
|
||||||
@ -401,6 +401,7 @@ libxcb.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch -P 1 -p0
|
%patch -P 1 -p0
|
||||||
|
%patch2 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
|
@ -0,0 +1,92 @@
|
|||||||
|
From: Egbert Eich <eich@suse.de>
|
||||||
|
Date: Thu Dec 24 00:11:43 2015 +0100
|
||||||
|
Subject: [PATCH]If auth with credentials for hostname fails retry with XAUTHLOCALHOSTNAME
|
||||||
|
Patch-mainline: never
|
||||||
|
|
||||||
|
References: boo#906622
|
||||||
|
Signed-off-by: Egbert Eich <eich@suse.com>
|
||||||
|
|
||||||
|
Signed-off-by: Egbert Eich <eich@suse.de>
|
||||||
|
---
|
||||||
|
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)
|
||||||
|
|
||||||
|
#define SIN6_ADDR(s) (&((struct sockaddr_in6 *)s)->sin6_addr)
|
||||||
|
|
||||||
|
-static Xauth *get_authptr(struct sockaddr *sockname, int display)
|
||||||
|
+static Xauth *get_authptr(struct sockaddr *sockname, int display, int *stage)
|
||||||
|
{
|
||||||
|
char *addr = 0;
|
||||||
|
int addrlen = 0;
|
||||||
|
@@ -119,6 +119,8 @@ static Xauth *get_authptr(struct sockaddr *sockname, int display)
|
||||||
|
int dispbuflen;
|
||||||
|
Xauth *authptr = NULL;
|
||||||
|
|
||||||
|
+ if (*stage == 2)
|
||||||
|
+ return NULL;
|
||||||
|
family = FamilyLocal; /* 256 */
|
||||||
|
switch(sockname->sa_family)
|
||||||
|
{
|
||||||
|
@@ -161,10 +163,13 @@ static Xauth *get_authptr(struct sockaddr *sockname, int display)
|
||||||
|
addrlen = strlen(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
- authptr = XauGetBestAuthByAddr (family,
|
||||||
|
- (unsigned short) addrlen, addr,
|
||||||
|
- (unsigned short) dispbuflen, dispbuf,
|
||||||
|
- N_AUTH_PROTOS, authnames, authnameslen);
|
||||||
|
+ if (*stage == 0) {
|
||||||
|
+ authptr = XauGetBestAuthByAddr (family,
|
||||||
|
+ (unsigned short) addrlen, addr,
|
||||||
|
+ (unsigned short) dispbuflen, dispbuf,
|
||||||
|
+ N_AUTH_PROTOS, authnames, authnameslen);
|
||||||
|
+ *stage = 1;
|
||||||
|
+ }
|
||||||
|
// && !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)
|
||||||
|
(unsigned short) strlen(addr), addr,
|
||||||
|
(unsigned short) dispbuflen, dispbuf,
|
||||||
|
N_AUTH_PROTOS, authnames, authnameslen);
|
||||||
|
+ *stage = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
|
||||||
|
/* 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)
|
||||||
|
}
|
||||||
|
gotsockname = 1;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- authptr = get_authptr(sockname, display);
|
||||||
|
+retry:
|
||||||
|
+ 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 */
|
||||||
|
}
|
||||||
|
|
||||||
|
free(sockname);
|
Loading…
x
Reference in New Issue
Block a user