summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-15 13:38:33 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-11-15 13:38:33 -0800
commit591829757772fb6ca7aaf9abe121fe99597b155e (patch)
tree65495ca1f8bc05286ecd84ce291cc95f0071cefe
parentb420462eae8ed86a0ab50a1d91cf0b5c5b1d986a (diff)
downloadxauth-591829757772fb6ca7aaf9abe121fe99597b155e.tar.gz
xauth-591829757772fb6ca7aaf9abe121fe99597b155e.tar.bz2
xauth-591829757772fb6ca7aaf9abe121fe99597b155e.zip
-rw-r--r--packaging/u_xauth_Look-for-FamilyLocal-if-inet-or-inet6-addr.patch62
-rw-r--r--packaging/xauth-1.0.2.diff17
-rw-r--r--packaging/xauth-tolerant-hostname-changes.diff147
-rw-r--r--packaging/xauth.spec30
4 files changed, 1 insertions, 255 deletions
diff --git a/packaging/u_xauth_Look-for-FamilyLocal-if-inet-or-inet6-addr.patch b/packaging/u_xauth_Look-for-FamilyLocal-if-inet-or-inet6-addr.patch
deleted file mode 100644
index 49b9fd1..0000000
--- a/packaging/u_xauth_Look-for-FamilyLocal-if-inet-or-inet6-addr.patch
+++ /dev/null
@@ -1,62 +0,0 @@
---- 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/packaging/xauth-1.0.2.diff b/packaging/xauth-1.0.2.diff
deleted file mode 100644
index fd1ae5a..0000000
--- a/packaging/xauth-1.0.2.diff
+++ /dev/null
@@ -1,17 +0,0 @@
-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/packaging/xauth-tolerant-hostname-changes.diff b/packaging/xauth-tolerant-hostname-changes.diff
deleted file mode 100644
index eadf9f9..0000000
--- a/packaging/xauth-tolerant-hostname-changes.diff
+++ /dev/null
@@ -1,147 +0,0 @@
-Index: xauth-1.0.7/gethost.c
-===================================================================
---- xauth-1.0.7.orig/gethost.c
-+++ xauth-1.0.7/gethost.c
-@@ -201,7 +201,8 @@ struct addrlist *get_address_info (
- int family,
- const char *fulldpyname,
- int prefix,
-- char *host)
-+ char *host,
-+ char *localhostname)
- {
- struct addrlist *retval = NULL;
- int len = 0;
-@@ -231,7 +232,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.7/parsedpy.c
-===================================================================
---- xauth-1.0.7.orig/parsedpy.c
-+++ xauth-1.0.7/parsedpy.c
-@@ -70,20 +70,23 @@ copystring (const 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
-@@ -93,6 +96,7 @@ copyhostname (void)
- */
- Bool
- parse_displayname (const char *displayname,
-+ char *localhostname,
- int *familyp, /* return */
- char **hostp, /* return */
- int *dpynump, /* return */
-@@ -134,7 +138,7 @@ parse_displayname (const char *displayna
- host = copystring ("0", 1);
- family = FamilyDECnet;
- } else {
-- host = copyhostname ();
-+ host = copyhostname (localhostname);
- family = FamilyInternet;
- }
- #endif
-Index: xauth-1.0.7/process.c
-===================================================================
---- xauth-1.0.7.orig/process.c
-+++ xauth-1.0.7/process.c
-@@ -463,7 +463,7 @@ read_auth_entries(FILE *fp, Bool numeric
- }
-
- static Bool
--get_displayname_auth(const char *displayname, AuthList **authl)
-+get_displayname_auth(const char *displayname, AuthList **authl, char *localhostname)
- {
- int family;
- char *host = NULL, *rest = NULL;
-@@ -483,11 +483,13 @@ get_displayname_auth(const char *display
- 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;
-@@ -1217,13 +1219,18 @@ iterdpy (const char *inputfilename, int
- 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++) {
- const 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++;
-@@ -1567,7 +1574,7 @@ do_add(const char *inputfilename, int li
- }
- }
-
-- 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.7/xauth.h
-===================================================================
---- xauth-1.0.7.orig/xauth.h
-+++ xauth-1.0.7/xauth.h
-@@ -48,10 +48,10 @@ struct addrlist {
- };
-
- extern const char *get_hostname ( Xauth *auth );
--extern struct addrlist *get_address_info ( int family, const char *fulldpyname, int prefix, char *host);
-+extern struct addrlist *get_address_info ( int family, const char *fulldpyname, int prefix, char *host, char *localhostname);
- extern char *copystring ( const char *src, int len );
--extern char *get_local_hostname ( char *buf, int maxlen );
--extern Bool parse_displayname ( const 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 ( const char *displayname, char *localhostname, int *familyp, char **hostp, int *dpynump, int *scrnump, char **restp );
- extern int auth_initialize ( const char *authfilename );
- extern int auth_finalize ( void );
- extern int process_command ( const char *inputfilename, int lineno, int argc, const char **argv );
diff --git a/packaging/xauth.spec b/packaging/xauth.spec
index ebdf530..e542359 100644
--- a/packaging/xauth.spec
+++ b/packaging/xauth.spec
@@ -1,20 +1,3 @@
-#
-# 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.7
Release: 1
@@ -23,20 +6,12 @@ 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
@@ -44,9 +19,6 @@ information used in connecting to the X server.
%prep
%setup -q
-%patch0 -p0
-%patch1 -p1
-%patch2 -p0
%build
%configure
@@ -57,7 +29,7 @@ make %{?_smp_mflags}
%files
%defattr(-,root,root)
-%doc ChangeLog COPYING README
+%doc COPYING
%{_bindir}/xauth
%{_mandir}/man1/xauth.1%{?ext_man}