- Update to version 1.1.4

Support for using getaddrinfo() and inet_ntop() was originally added to
  support IPv6, and only used if IPv6 support was enabled. Two decades later,
  these interfaces are ubiquitous and OS'es have starting marking the old
  interfaces as deprecated, so this release changes to use the modern interface
  whenever we can now.  (Note that code included from libxtrans will only use
  these interfaces when IPv6 is disabled if building against libxtrans 1.6.0
  or later.)
- refreshed xauth-tolerant-hostname-changes.diff

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xauth?expand=0&rev=22
This commit is contained in:
Stefan Dirsch 2025-03-09 04:03:45 +00:00 committed by Git OBS Bridge
commit de111b58b2
7 changed files with 395 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -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

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

BIN
xauth-1.1.3.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

3
xauth-1.1.4.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e9318141464ad7b4dc0f8564a580f0d20f977c85a388cc40d5a766206151c690
size 163696

View File

@ -0,0 +1,175 @@
Index: xauth-1.1.4/gethost.c
===================================================================
--- xauth-1.1.4.orig/gethost.c
+++ xauth-1.1.4/gethost.c
@@ -162,7 +162,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;
@@ -188,7 +189,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;
@@ -270,7 +271,7 @@ struct addrlist *get_address_info (
src = &(sin->sin_addr);
if (*(const in_addr_t *) src == htonl(INADDR_LOOPBACK)) {
family = FamilyLocal;
- if (get_local_hostname (buf, sizeof buf)) {
+ if (get_local_hostname (buf, sizeof buf, localhostname)) {
src = buf;
len = strlen (buf);
} else
@@ -286,7 +287,7 @@ struct addrlist *get_address_info (
if (!IN6_IS_ADDR_V4MAPPED((const struct in6_addr *)src)) {
if (IN6_IS_ADDR_LOOPBACK((const struct in6_addr *)src)) {
family = FamilyLocal;
- if (get_local_hostname (buf, sizeof buf)) {
+ if (get_local_hostname (buf, sizeof buf, localhostname)) {
src = buf;
len = strlen (buf);
} else
@@ -342,7 +343,7 @@ struct addrlist *get_address_info (
src = (char *) &hostinetaddr;
if (*(const in_addr_t *) src == htonl(INADDR_LOOPBACK)) {
family = FamilyLocal;
- if (get_local_hostname (buf, sizeof buf)) {
+ if (get_local_hostname (buf, sizeof buf, localhostname)) {
src = buf;
len = strlen (buf);
} else {
Index: xauth-1.1.4/parsedpy.c
===================================================================
--- xauth-1.1.4.orig/parsedpy.c
+++ xauth-1.1.4/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.1.4/process.c
===================================================================
--- xauth-1.1.4.orig/process.c
+++ xauth-1.1.4/process.c
@@ -491,7 +491,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;
@@ -511,11 +511,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;
@@ -1295,6 +1297,12 @@ iterdpy (const char *inputfilename, int
int errors = 0;
/*
+ * get saved local address from environment in case the host
+ * name has changed after the credential was added.
+ */
+ char *xlocalhostname = getenv("XAUTHLOCALHOSTNAME");
+
+ /*
* iterate
*/
for (int i = start; i < argc; i++) {
@@ -1303,7 +1311,7 @@ iterdpy (const char *inputfilename, int
AuthList *next;
int status;
- if (!get_displayname_auth (displayname, &proto_head)) {
+ if (!get_displayname_auth (displayname, &proto_head, xlocalhostname)) {
prefix (inputfilename, lineno);
baddisplayname (displayname, argv[0]);
errors++;
@@ -1666,7 +1674,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.1.4/xauth.h
===================================================================
--- xauth-1.1.4.orig/xauth.h
+++ xauth-1.1.4/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 );

132
xauth.changes Normal file
View File

@ -0,0 +1,132 @@
-------------------------------------------------------------------
Sun Mar 9 04:00:16 UTC 2025 - Stefan Dirsch <sndirsch@suse.com>
- Update to version 1.1.4
Support for using getaddrinfo() and inet_ntop() was originally added to
support IPv6, and only used if IPv6 support was enabled. Two decades later,
these interfaces are ubiquitous and OS'es have starting marking the old
interfaces as deprecated, so this release changes to use the modern interface
whenever we can now. (Note that code included from libxtrans will only use
these interfaces when IPv6 is disabled if building against libxtrans 1.6.0
or later.)
- refreshed xauth-tolerant-hostname-changes.diff
-------------------------------------------------------------------
Mon Mar 4 03:59:59 UTC 2024 - Stefan Dirsch <sndirsch@suse.com>
- Update to version 1.1.3
* config: Add missing AC_CONFIG_SRCDIR
* Variable scope reductions, as suggested by cppcheck
* Remove unnecessary casts from malloc() calls
* Handle -Wempty-body warning for WRITES() macro
* configure: Use AC_SYS_LARGEFILE to enable large file support
* configure: raise minimum autoconf requirement to 2.70
* unifdef hpux
* unifdef Lynx
- adjusted xauth-tolerant-hostname-changes.diff
-------------------------------------------------------------------
Mon Feb 26 12:04:39 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Use %autosetup macro. Allows to eliminate the usage of deprecated
PatchN.
-------------------------------------------------------------------
Wed Apr 20 08:51:00 UTC 2022 - Stefan Dirsch <sndirsch@suse.com>
- update to version 1.1.2
* tests: make tests work in out-of-tree builds
* tests: Fix failure to make distcheck
* tests: report failure if stderr has unexpected output
* configure.ac: fail build if xtrans is not found
* gitlab CI: add a basic build test
* Build xz tarballs instead of bzip2
* Fix off-by-one in quote-stripping routines
* gitlab CI: stop requiring Signed-off-by in commits
* Improve portability
* Removed build requirement "cmdtest".
* Fix warning -Wstringop-truncation for strncpy by using memcpy instead
* Expand checks of socket file with S_ISSOCK
-------------------------------------------------------------------
Mon Nov 29 15:29:09 UTC 2021 - Stefan Dirsch <sndirsch@suse.com>
- update to version 1.1.1
* This is a minor bugfix release, including fixes for reported
crashes.
-------------------------------------------------------------------
Mon Mar 15 15:19:29 UTC 2021 - Dirk Müller <dmueller@suse.com>
- modernize spec file (move license to licensedir)
-------------------------------------------------------------------
Fri Jul 12 10:41:09 UTC 2019 - Stefan Dirsch <sndirsch@suse.com>
- Update to version 1.1
* This release fixes a race condition where an existing
authority file would be unlinked (possibly causing other
clients to fail to connect), and fixes sorting and merging
of authority file entries.
-------------------------------------------------------------------
Wed Feb 1 13:27:01 UTC 2017 - sndirsch@suse.com
- Update to version 1.0.10
* include POSIX-standard limits.h for PATH_MAX instead of sys/syslimits.h
* autogen.sh: Honor NOCONFIGURE=1
* Clarified RELEASING in README
* Fix for xauth failing on ENOSPC (= disk full)
* autogen.sh: use quoted string variables
* Update DISPLAY parsing to work with new launchd paths in Yosemite
* Fix !HAVE_STRLCPY case
* Build xauth before running tests.
* autogen: add default patch prefix
* autogen.sh: stop using maintainer mode
* autogen.sh: use exec instead of waiting for configure to finish
* usage(): Print summary for the -n option
-------------------------------------------------------------------
Wed May 7 10:01:28 UTC 2014 - sndirsch@suse.com
- Update to version 1.0.9
* Add AC_USE_SYSTEM_EXTENSIONS to expose non-standard extensions
* Do not install test_xauth during "make install" as it is
* Fix warning about warn_unused_result triggered by WRITES.
* Fixed missing EXTRA_DIST in tests. Extended README for releasing.
-------------------------------------------------------------------
Fri Oct 25 14:48:02 UTC 2013 - sndirsch@suse.com
- Update to version 1.0.8
* Fix a long standing problem that for ssh tunneled connections a
display variable of the form: localhost:<N>.<M> leads to correct
authorization when an X client is started but "xauth list $DISPLAY"
returns nothing.
* Fix for: If using GDM with XDMCP, then ssh is not able to start X11
clients on the remote side. You get a "No xauth data; using fake
authentication data for X11 forwarding." from SSH.
- obsoletes xauth-1.0.2.diff,
u_xauth_Look-for-FamilyLocal-if-inet-or-inet6-addr.patch
- adjusted xauth-tolerant-hostname-changes.diff
- added new test_xauth tool to %files section
-------------------------------------------------------------------
Sat Apr 14 21:47:40 UTC 2012 - dimstar@opensuse.org
- Update to version 1.0.7:
+ Remove alarm handler in get_hostname
+ Add const attributes to fix gcc -Wwrite-strings warnings
+ convert strlen/malloc/strcpy combo to strdup
- Changes from version 1.0.6:
+ auth_finalize: Attempt to rename() if link() fails
+ Error out and avoid a call to malloc(0) if given a bad hex
string
+ Build system fixes.
- Rebase xauth-tolerant-hostname-changes.diff.
-------------------------------------------------------------------
Fri Apr 13 08:46:08 UTC 2012 - vuntz@opensuse.org
- Split xauth from xorg-x11. Initial version: 1.0.5.

58
xauth.spec Normal file
View File

@ -0,0 +1,58 @@
#
# spec file for package xauth
#
# Copyright (c) 2025 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
Name: xauth
Version: 1.1.4
Release: 0
Summary: Utility to edit and display the X authorization information
License: MIT
Group: System/X11/Utilities
URL: https://xorg.freedesktop.org/
Source0: https://xorg.freedesktop.org/releases/individual/app/%{name}-%{version}.tar.xz
Patch1: xauth-tolerant-hostname-changes.diff
BuildRequires: pkgconfig
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
%description
The xauth program is used to edit and display the authorization
information used in connecting to the X server.
%prep
%autosetup -p1
%build
%configure
%make_build
%install
%make_install
%files
%license COPYING
%doc ChangeLog README.md
%{_bindir}/xauth
%{_mandir}/man1/xauth.1%{?ext_man}
%changelog