From 12a0495e4f3fb7b1cc71c33069ec842b634d25ed1249d00473e012e0488e15bf Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Sat, 14 Apr 2012 09:32:44 +0000 Subject: [PATCH] Accepting request 113485 from home:vuntz:branches:X11:XOrg Split xauth out of xorg-x11; no change to the content OBS-URL: https://build.opensuse.org/request/show/113485 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xauth?expand=0&rev=1 --- .gitattributes | 23 +++ .gitignore | 1 + ...or-FamilyLocal-if-inet-or-inet6-addr.patch | 62 ++++++++ xauth-1.0.2.diff | 17 ++ xauth-1.0.5.tar.bz2 | 3 + xauth-tolerant-hostname-changes.diff | 148 ++++++++++++++++++ xauth.changes | 5 + xauth.spec | 64 ++++++++ 8 files changed, 323 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 u_xauth_Look-for-FamilyLocal-if-inet-or-inet6-addr.patch create mode 100644 xauth-1.0.2.diff create mode 100644 xauth-1.0.5.tar.bz2 create mode 100644 xauth-tolerant-hostname-changes.diff create mode 100644 xauth.changes create mode 100644 xauth.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/u_xauth_Look-for-FamilyLocal-if-inet-or-inet6-addr.patch b/u_xauth_Look-for-FamilyLocal-if-inet-or-inet6-addr.patch new file mode 100644 index 0000000..bfcf1c6 --- /dev/null +++ b/u_xauth_Look-for-FamilyLocal-if-inet-or-inet6-addr.patch @@ -0,0 +1,62 @@ +--- gethost.c.orig 2010-09-04 01:04:27.000000000 +0200 ++++ gethost.c 2012-01-10 17:57:22.072108000 +0100 +@@ -318,16 +318,36 @@ struct addrlist *get_address_info ( + for (ai = firstai; ai != NULL; ai = ai->ai_next) { + struct addrlist *duplicate; + ++ len = 0; + if (ai->ai_family == AF_INET) { + struct sockaddr_in *sin = (struct sockaddr_in *)ai->ai_addr; + src = &(sin->sin_addr); +- len = sizeof(sin->sin_addr); +- family = FamilyInternet; ++ if (*(in_addr_t *) src == htonl(INADDR_LOOPBACK)) { ++ family = FamilyLocal; ++ if(get_local_hostname (buf, sizeof buf, localhostname)) { ++ src = buf; ++ len = strlen (buf); ++ } else ++ src = NULL; ++ } else { ++ len = sizeof(sin->sin_addr); ++ family = FamilyInternet; ++ } + } else if (ai->ai_family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)ai->ai_addr; + src = &(sin6->sin6_addr); +- len = sizeof(sin6->sin6_addr); +- family = FamilyInternet6; ++ if (IN6_IS_ADDR_V4MAPPED((struct sockaddr_in6 *)src) ++ || IN6_IS_ADDR_LOOPBACK((struct sockaddr_in6 *)src)) { ++ family = FamilyLocal; ++ if (get_local_hostname (buf, sizeof buf, localhostname)) { ++ src = buf; ++ len = strlen (buf); ++ } else ++ src = NULL; ++ } else { ++ len = sizeof(sin6->sin6_addr); ++ family = FamilyInternet6; ++ } + } + + for(duplicate = retval; duplicate != NULL; duplicate = duplicate->next) { +@@ -366,7 +386,17 @@ struct addrlist *get_address_info ( + #else + if (!get_inet_address (host, &hostinetaddr)) return NULL; + src = (char *) &hostinetaddr; +- len = 4; /* sizeof inaddr.sin_addr, would fail on Cray */ ++ if (*(in_addr_t *) src == htonl(INADDR_LOOPBACK)) { ++ family = FamilyLocal; ++ if (get_local_hostname (buf, sizeof buf)) { ++ src = buf; ++ len = strlen (buf); ++ } else { ++ len = 0; ++ src = NULL; ++ } ++ } else ++ len = 4; /* sizeof inaddr.sin_addr, would fail on Cray */ + break; + #endif /* IPv6 */ + #else diff --git a/xauth-1.0.2.diff b/xauth-1.0.2.diff new file mode 100644 index 0000000..1f3b780 --- /dev/null +++ b/xauth-1.0.2.diff @@ -0,0 +1,17 @@ +Index: process.c +=================================================================== +--- process.c.orig ++++ process.c +@@ -1296,8 +1296,11 @@ remove_entry(char *inputfilename, int li + /* + * unlink the auth we were asked to + */ +- while (!eq_auth((list = *listp)->auth, auth)) ++ while (!eq_auth((list = *listp)->auth, auth)) { + listp = &list->next; ++ if (!*listp) ++ return 0; ++ } + *listp = list->next; + XauDisposeAuth (list->auth); /* free the auth */ + free (list); /* free the link */ diff --git a/xauth-1.0.5.tar.bz2 b/xauth-1.0.5.tar.bz2 new file mode 100644 index 0000000..9dbbe5a --- /dev/null +++ b/xauth-1.0.5.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d139500ff1daf806525adf071f8c1778ad138a0378c73ea831ad18847ad746c +size 129568 diff --git a/xauth-tolerant-hostname-changes.diff b/xauth-tolerant-hostname-changes.diff new file mode 100644 index 0000000..67e7778 --- /dev/null +++ b/xauth-tolerant-hostname-changes.diff @@ -0,0 +1,148 @@ +Index: xauth-1.0.5/gethost.c +=================================================================== +--- xauth-1.0.5.orig/gethost.c ++++ xauth-1.0.5/gethost.c +@@ -244,7 +244,8 @@ struct addrlist *get_address_info ( + int family, + char *fulldpyname, + int prefix, +- char *host) ++ char *host, ++ char *localhostname) + { + struct addrlist *retval = NULL; + int len = 0; +@@ -274,7 +275,7 @@ struct addrlist *get_address_info ( + if (prefix == 0 && (strncmp (fulldpyname, "unix:", 5) == 0 || + fulldpyname[0] == ':')) { + +- if (!get_local_hostname (buf, sizeof buf)) { ++ if (!get_local_hostname (buf, sizeof buf, localhostname)) { + len = 0; + } else { + src = buf; +Index: xauth-1.0.5/parsedpy.c +=================================================================== +--- xauth-1.0.5.orig/parsedpy.c ++++ xauth-1.0.5/parsedpy.c +@@ -74,20 +74,24 @@ copystring (char *src, int len) + + + char * +-get_local_hostname (char *buf, int maxlen) ++get_local_hostname (char *buf, int maxlen, char *localhostname) + { + buf[0] = '\0'; ++ if (localhostname) ++ strncpy(buf, localhostname, maxlen); ++ else + (void) XmuGetHostname (buf, maxlen); ++ + return (buf[0] ? buf : NULL); + } + + #ifndef UNIXCONN + static char * +-copyhostname (void) ++copyhostname (char *localhostname) + { + char buf[256]; + +- return (get_local_hostname (buf, sizeof buf) ? ++ return (get_local_hostname (buf, sizeof buf, localhostname) ? + copystring (buf, strlen (buf)) : NULL); + } + #endif +@@ -97,6 +101,7 @@ copyhostname (void) + */ + Bool + parse_displayname (char *displayname, ++ char *localhostname, + int *familyp, /* return */ + char **hostp, /* return */ + int *dpynump, /* return */ +@@ -138,7 +143,7 @@ parse_displayname (char *displayname, + host = copystring ("0", 1); + family = FamilyDECnet; + } else { +- host = copyhostname (); ++ host = copyhostname (localhostname); + family = FamilyInternet; + } + #endif +Index: xauth-1.0.5/process.c +=================================================================== +--- xauth-1.0.5.orig/process.c ++++ xauth-1.0.5/process.c +@@ -466,7 +466,7 @@ read_auth_entries(FILE *fp, Bool numeric + } + + static Bool +-get_displayname_auth(char *displayname, AuthList **authl) ++get_displayname_auth(char *displayname, AuthList **authl, char *localhostname) + { + int family; + char *host = NULL, *rest = NULL; +@@ -486,11 +486,13 @@ get_displayname_auth(char *displayname, + prelen = (cp - displayname); + + if (!parse_displayname (displayname + ((prelen > 0) ? prelen + 1 : 0), ++ localhostname, + &family, &host, &dpynum, &scrnum, &rest)) { + return False; + } + +- addrlist_head = get_address_info(family, displayname, prelen, host); ++ addrlist_head = get_address_info(family, displayname, prelen, host, ++ localhostname); + if (addrlist_head) { + char buf[40]; /* want to hold largest display num */ + unsigned short dpylen; +@@ -1220,13 +1222,19 @@ iterdpy (char *inputfilename, int lineno + Xauth *tmp_auth; + AuthList *proto_head, *proto; + AuthList *l, *next; ++ /* ++ * get saved local address from environment in case the host ++ * name has changed after the credential was added. ++ */ ++ char *xlocalhostname = getenv("XAUTHLOCALHOSTNAME"); ++ + + /* + * iterate + */ + for (i = start; i < argc; i++) { + char *displayname = argv[i]; +- if (!get_displayname_auth (displayname, &proto_head)) { ++ if (!get_displayname_auth (displayname, &proto_head, xlocalhostname)) { + prefix (inputfilename, lineno); + baddisplayname (displayname, argv[0]); + errors++; +@@ -1569,7 +1577,7 @@ do_add(char *inputfilename, int lineno, + } + } + +- if (!get_displayname_auth (dpyname, &list)) { ++ if (!get_displayname_auth (dpyname, &list, NULL)) { + prefix (inputfilename, lineno); + baddisplayname (dpyname, argv[0]); + free (key); +Index: xauth-1.0.5/xauth.h +=================================================================== +--- xauth-1.0.5.orig/xauth.h ++++ xauth-1.0.5/xauth.h +@@ -51,10 +51,10 @@ struct addrlist { + }; + + extern char *get_hostname ( Xauth *auth ); +-extern struct addrlist *get_address_info ( int family, char *fulldpyname, int prefix, char *host); ++extern struct addrlist *get_address_info ( int family, char *fulldpyname, int prefix, char *host, char *localhostname); + extern char *copystring ( char *src, int len ); +-extern char *get_local_hostname ( char *buf, int maxlen ); +-extern Bool parse_displayname ( char *displayname, int *familyp, char **hostp, int *dpynump, int *scrnump, char **restp ); ++extern char *get_local_hostname ( char *buf, int maxlen , char *localhostname); ++extern Bool parse_displayname ( char *displayname, char *localhostname, int *familyp, char **hostp, int *dpynump, int *scrnump, char **restp ); + extern int auth_initialize ( char *authfilename ); + extern int auth_finalize ( void ); + extern int process_command ( char *inputfilename, int lineno, int argc, char **argv ); diff --git a/xauth.changes b/xauth.changes new file mode 100644 index 0000000..e562f3b --- /dev/null +++ b/xauth.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Fri Apr 13 08:46:08 UTC 2012 - vuntz@opensuse.org + +- Split xauth from xorg-x11. Initial version: 1.0.5. + diff --git a/xauth.spec b/xauth.spec new file mode 100644 index 0000000..2e5dff9 --- /dev/null +++ b/xauth.spec @@ -0,0 +1,64 @@ +# +# spec file for package xauth +# +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +Name: xauth +Version: 1.0.5 +Release: 0 +License: MIT +Summary: Utility to edit and display the X authorization information +Url: http://xorg.freedesktop.org/ +Group: System/X11/Utilities +Source0: http://xorg.freedesktop.org/releases/individual/app/%{name}-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM xauth-1.0.2.diff fdo#48642 -- Fix crash on removing non-existant entry +Patch0: xauth-1.0.2.diff +Patch1: xauth-tolerant-hostname-changes.diff +Patch2: u_xauth_Look-for-FamilyLocal-if-inet-or-inet6-addr.patch +BuildRequires: pkg-config +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(xau) +BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(xmuu) +BuildRequires: pkgconfig(xorg-macros) >= 1.8 +# Name of subpackage when this was part of the xorg-x11 package up to version 7.6 +Provides: xorg-x11-xauth = 7.6 +Obsoletes: xorg-x11-xauth <= 7.6 +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +The xauth program is used to edit and display the authorization +information used in connecting to the X server. + +%prep +%setup -q +%patch0 -p0 +%patch1 -p1 +%patch2 -p0 + +%build +%configure +make %{?_smp_mflags} + +%install +%make_install + +%files +%defattr(-,root,root) +%doc ChangeLog COPYING README +%{_bindir}/xauth +%{_mandir}/man1/xauth.1%{?ext_man} + +%changelog