Skip to content

Commit a307c9b

Browse files
committed
Update libXau to 1.0.12
1 parent d8eb308 commit a307c9b

27 files changed

+17369
-15961
lines changed

lib/libXau/AuDispose.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ XauDisposeAuth (Xauth *auth)
3939
free (auth->name);
4040
if (auth->data) {
4141
#ifdef HAVE_EXPLICIT_BZERO
42-
(void) explicit_bzero (auth->data, auth->data_length);
42+
explicit_bzero (auth->data, auth->data_length);
43+
#elif HAVE_EXPLICIT_MEMSET
44+
explicit_memset (auth->data, 0, auth->data_length);
4345
#else
44-
(void) bzero (auth->data, auth->data_length);
46+
bzero (auth->data, auth->data_length);
4547
#endif
46-
(void) free (auth->data);
48+
free (auth->data);
4749
}
4850
free (auth);
4951
}

lib/libXau/AuGetAddr.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ in this Software without prior written authorization from The Open Group.
3030
#include <X11/Xauth.h>
3131
#include <X11/Xos.h>
3232

33+
#ifdef O_CLOEXEC
34+
#define FOPEN_CLOEXEC "e"
35+
#else
36+
#define FOPEN_CLOEXEC ""
37+
#endif
38+
3339
#define binaryEqual(a, b, len) (memcmp(a, b, len) == 0)
3440

3541
Xauth *
@@ -64,7 +70,7 @@ _Xconst char* name)
6470
return NULL;
6571
if (access (auth_name, R_OK) != 0) /* checks REAL id */
6672
return NULL;
67-
auth_file = fopen (auth_name, "rb");
73+
auth_file = fopen (auth_name, "rb" FOPEN_CLOEXEC);
6874
if (!auth_file)
6975
return NULL;
7076
for (;;) {

lib/libXau/AuGetBest.c

+6-35
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ in this Software without prior written authorization from The Open Group.
3232
#ifdef XTHREADS
3333
#include <X11/Xthreads.h>
3434
#endif
35-
#ifdef hpux
36-
#define X_INCLUDE_NETDB_H
37-
#define XOS_USE_NO_LOCKING
38-
#include <X11/Xos_r.h>
35+
36+
#ifdef O_CLOEXEC
37+
#define FOPEN_CLOEXEC "e"
38+
#else
39+
#define FOPEN_CLOEXEC ""
3940
#endif
4041

4142
#define binaryEqual(a, b, len) (memcmp(a, b, len) == 0)
@@ -66,40 +67,16 @@ XauGetBestAuthByAddr (
6667
Xauth *best;
6768
int best_type;
6869
int type;
69-
#ifdef hpux
70-
char *fully_qual_address;
71-
unsigned short fully_qual_address_length;
72-
#endif
7370

7471
auth_name = XauFileName ();
7572
if (!auth_name)
7673
return NULL;
7774
if (access (auth_name, R_OK) != 0) /* checks REAL id */
7875
return NULL;
79-
auth_file = fopen (auth_name, "rb");
76+
auth_file = fopen (auth_name, "rb" FOPEN_CLOEXEC);
8077
if (!auth_file)
8178
return NULL;
8279

83-
#ifdef hpux
84-
if (family == FamilyLocal) {
85-
#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
86-
_Xgethostbynameparams hparams;
87-
#endif
88-
struct hostent *hostp;
89-
90-
/* make sure we try fully-qualified hostname */
91-
if ((hostp = _XGethostbyname(address,hparams)) != NULL) {
92-
fully_qual_address = hostp->h_name;
93-
fully_qual_address_length = strlen(fully_qual_address);
94-
}
95-
else
96-
{
97-
fully_qual_address = NULL;
98-
fully_qual_address_length = 0;
99-
}
100-
}
101-
#endif /* hpux */
102-
10380
best = NULL;
10481
best_type = types_length;
10582
for (;;) {
@@ -123,12 +100,6 @@ XauGetBestAuthByAddr (
123100
(entry->family == family &&
124101
((address_length == entry->address_length &&
125102
binaryEqual (entry->address, address, address_length))
126-
#ifdef hpux
127-
|| (family == FamilyLocal &&
128-
fully_qual_address_length == entry->address_length &&
129-
binaryEqual (entry->address, fully_qual_address,
130-
fully_qual_address_length))
131-
#endif
132103
))) &&
133104
(number_length == 0 || entry->number_length == 0 ||
134105
(number_length == entry->number_length &&

lib/libXau/AuLock.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ in this Software without prior written authorization from The Open Group.
4141
# define link rename
4242
#endif
4343

44+
#ifndef O_CLOEXEC
45+
#define O_CLOEXEC 0
46+
#endif
47+
4448
int
4549
XauLockAuth (
4650
_Xconst char *file_name,
@@ -71,7 +75,8 @@ long dead)
7175

7276
while (retries > 0) {
7377
if (creat_fd == -1) {
74-
creat_fd = open (creat_name, O_WRONLY | O_CREAT | O_EXCL, 0600);
78+
creat_fd = open (creat_name, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC,
79+
0600);
7580
if (creat_fd == -1) {
7681
if (errno != EACCES && errno != EEXIST)
7782
return LOCK_ERROR;

lib/libXau/AuRead.c

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ read_counted_string (unsigned short *countp, char **stringp, FILE *file)
5858
if (fread (data, sizeof (char), len, file) != len) {
5959
#ifdef HAVE_EXPLICIT_BZERO
6060
explicit_bzero (data, len);
61+
#elif HAVE_EXPLICIT_MEMSET
62+
explicit_memset (data, 0, len);
6163
#else
6264
bzero (data, len);
6365
#endif
@@ -107,6 +109,8 @@ XauReadAuth (FILE *auth_file)
107109
if (local.data) {
108110
#ifdef HAVE_EXPLICIT_BZERO
109111
explicit_bzero (local.data, local.data_length);
112+
#elif HAVE_EXPLICIT_MEMSET
113+
explicit_memset (local.data, 0, local.data_length);
110114
#else
111115
bzero (local.data, local.data_length);
112116
#endif

lib/libXau/ChangeLog

+164
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,167 @@
1+
commit a9c65683e68b3a4349afee5d7673b393fb924d2e
2+
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
3+
Date: Fri Dec 13 17:23:57 2024 -0800
4+
5+
libXau 1.0.12
6+
7+
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
8+
9+
commit 6b2e9a63d8306282a2b384762bea004c19f301a1
10+
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
11+
Date: Mon Aug 26 10:22:33 2024 -0700
12+
13+
XauDisposeAuth: remove void casts from functions that return void
14+
15+
We rely on having included headers with proper prototypes to know
16+
that these functions are declared to return void instead of adding
17+
casts to paper over missing prototypes.
18+
19+
Clears warnings from gcc 14.1:
20+
21+
AuDispose.c: In function ‘XauDisposeAuth’:
22+
AuDispose.c:42:13: warning: useless cast to type ‘void’ [-Wuseless-cast]
23+
42 | (void) explicit_bzero (auth->data, auth->data_length);
24+
| ^
25+
AuDispose.c:48:13: warning: useless cast to type ‘void’ [-Wuseless-cast]
26+
48 | (void) free (auth->data);
27+
| ^
28+
29+
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
30+
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxau/-/merge_requests/18>
31+
32+
commit 89429bb36de409b204ef105e8b73126a639ccb03
33+
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
34+
Date: Sat Feb 17 13:23:58 2024 -0800
35+
36+
unifdef hpux
37+
38+
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
39+
40+
commit c7b0ac2c894bbeebc337867388a8b338692550b8
41+
Author: Thierry LARONDE <tlaronde@kergis.com>
42+
Date: Thu Feb 1 20:43:38 2024 +0100
43+
44+
Autest.c includes Xauth.h that depends on other headers.
45+
46+
Xauth.h includes headers provided by xproto. So add for test
47+
also the dependency.
48+
49+
commit a5d1f88c3a74a099030ffbbb30ad3fd361fdd1af
50+
Author: Thierry LARONDE <tlaronde@kergis.com>
51+
Date: Thu Feb 1 20:42:02 2024 +0100
52+
53+
Allow to use POSIX.2 compliant sed(1)
54+
55+
POSIX.2 sed(1) doesn't allow file to be anywhere else than, if given,
56+
last. Allow to use whatever compliant sed(1) is there, not only GNU
57+
sed(1).
58+
59+
commit 4866e00d737a1ece81c519ea867cfe16a0ae36b4
60+
Author: Thierry LARONDE <tlaronde@kergis.com>
61+
Date: Thu Feb 1 20:40:25 2024 +0100
62+
63+
Also test for explicit_memset(3) support
64+
65+
explicit_bzero(3) is not provided by every system, and some provide
66+
explicit_memset(3) that is in the process of being standardized
67+
(furthermore, POSIX deprecates bzero(3) since memset(3) can do
68+
same or more).
69+
70+
commit caa2d8e29adf43bb77fc00d718f7a0db4c2c35b1
71+
Author: Thierry LARONDE <tlaronde@kergis.com>
72+
Date: Thu Feb 1 20:37:42 2024 +0100
73+
74+
Gcc < 11 doesn't allow opt. deallocator arg for __attribute((malloc))
75+
76+
commit f4fc44202b554e68093828b556f8c7fd9644ddb0
77+
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
78+
Date: Sat Sep 16 11:51:11 2023 -0700
79+
80+
gitlab CI: run meson build with both gcc & clang compilers
81+
82+
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
83+
84+
commit 5acc34b51625676f8f297516e4f7915b18dd4cb2
85+
Author: Alex Richardson <arichardson@FreeBSD.org>
86+
Date: Sun Sep 10 21:49:36 2023 -0700
87+
88+
Allow building with clang after aec9d7266777e0b9243ef0f112fe0e07256bd446
89+
90+
Clang also supports the malloc attribute but unlike GCC does not accept
91+
the deallocator argument. This has been reported as
92+
https://github.com/llvm/llvm-project/issues/51607
93+
94+
Signed-off-by: Alex Richardson <arichardson@FreeBSD.org>
95+
96+
commit aec9d7266777e0b9243ef0f112fe0e07256bd446
97+
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
98+
Date: Sun Jul 30 10:30:52 2023 -0700
99+
100+
Xauth.h: add access & malloc attributes to function prototypes
101+
102+
May aid in static analysis by gcc
103+
104+
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
105+
106+
commit 68e74d37b99f56bbd1a5f2fb8cb4ad6116f27bd3
107+
Author: Dylan Baker <dylan@pnwbakers.com>
108+
Date: Tue Jun 20 15:46:23 2023 -0700
109+
110+
add Meson build system
111+
112+
This is, I think, equal to the autotools build-system in every practical
113+
way. The man pages have hardcoded numbers. I think this is okay, as all
114+
modern operating systems seem to use the same man page numbering now.
115+
116+
I've also chosen to not generate a config.h file with Meson. This makes
117+
using libXau as a subproject safer, since we don't have to worry about
118+
conflicting config.h files, plus there are only a couple of declarations
119+
that are actually used. This also saves some configure time in writing
120+
out an additional file.
121+
122+
commit df1bf4fe528a5a9eef420f78efb225e4696ac467
123+
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
124+
Date: Sat Mar 25 12:44:39 2023 -0700
125+
126+
Set close-on-exec when opening files
127+
128+
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
129+
130+
commit 41c43bdf85c91293af80b0b843947380b9b3378c
131+
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
132+
Date: Sat Feb 25 09:21:23 2023 -0800
133+
134+
Remove "All rights reserved" from Oracle copyright notices
135+
136+
Oracle no longer includes this term in our copyright & license notices.
137+
138+
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
139+
140+
commit c52f54e9533046a52edf84bcc02abedc2dbcb1a7
141+
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
142+
Date: Mon Feb 6 15:27:43 2023 -0800
143+
144+
Require LT_INIT from libtool 2 instead of deprecated AC_PROG_LIBTOOL
145+
146+
AC_PROG_LIBTOOL was replaced by LT_INIT in libtool 2 in 2008,
147+
so it's time to rely on it.
148+
149+
configure.ac:35: warning: The macro `AC_LIBTOOL_WIN32_DLL' is obsolete.
150+
configure.ac:35: You should run autoupdate.
151+
aclocal.m4:11889: AC_LIBTOOL_WIN32_DLL is expanded from...
152+
configure.ac:35: the top level
153+
configure.ac:35: warning: AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you
154+
configure.ac:35: put the 'win32-dll' option into LT_INIT's first parameter.
155+
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
156+
aclocal.m4:11889: AC_LIBTOOL_WIN32_DLL is expanded from...
157+
configure.ac:35: the top level
158+
configure.ac:36: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
159+
configure.ac:36: You should run autoupdate.
160+
aclocal.m4:3465: AC_PROG_LIBTOOL is expanded from...
161+
configure.ac:36: the top level
162+
163+
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
164+
1165
commit 14fdf25db9f21c8f3ad37f0d32a5b8e726efdc0d
2166
Author: Matt Turner <mattst88@gmail.com>
3167
Date: Thu Dec 8 10:36:36 2022 -0500

lib/libXau/Makefile.am

+4
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ ChangeLog:
6161
$(CHANGELOG_CMD)
6262

6363
dist-hook: ChangeLog INSTALL
64+
65+
ACLOCAL_AMFLAGS = -I m4
66+
67+
EXTRA_DIST = meson.build meson_options.txt

lib/libXau/Makefile.in

+6-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
6161
$(xauinclude_HEADERS) AUTHORS COPYING ChangeLog INSTALL \
6262
config.guess config.sub depcomp install-sh ltmain.sh missing
6363
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
64-
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
64+
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
65+
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
66+
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
67+
$(top_srcdir)/configure.ac
6568
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
6669
$(ACLOCAL_M4)
6770
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -238,7 +241,6 @@ CC = @CC@
238241
CCDEPMODE = @CCDEPMODE@
239242
CFLAGS = @CFLAGS@
240243
CHANGELOG_CMD = @CHANGELOG_CMD@
241-
CPP = @CPP@
242244
CPPFLAGS = @CPPFLAGS@
243245
CWARNFLAGS = @CWARNFLAGS@
244246
CYGPATH_W = @CYGPATH_W@
@@ -393,6 +395,8 @@ Autest_LDADD = libXau.la
393395
@MAKE_LINT_LIB_TRUE@lintlib_DATA = $(LINTLIB)
394396
CLEANFILES = $(lintlib_DATA)
395397
MAINTAINERCLEANFILES = ChangeLog INSTALL
398+
ACLOCAL_AMFLAGS = -I m4
399+
EXTRA_DIST = meson.build meson_options.txt
396400
all: config.h
397401
$(MAKE) $(AM_MAKEFLAGS) all-recursive
398402

0 commit comments

Comments
 (0)