Update to xtrans 1.5.0

pull/1/head
matthieu 2023-07-03 12:53:59 +00:00
parent 01f781e04d
commit 874d89fb4e
17 changed files with 4168 additions and 4526 deletions

View File

@ -48,7 +48,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
______________________________________________________________________________
Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2002, 2005, Oracle and/or its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

View File

@ -1,3 +1,203 @@
commit 3b3a3bd75d86aec78f6ef893b198c3efc378bc64
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Jun 2 17:29:41 2023 -0700
xtrans 1.5.0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 232a11a947564762689e63c3a6603d3f956f696d
Author: Demi Marie Obenour <demiobenour@gmail.com>
Date: Thu Dec 15 14:48:13 2022 -0500
DISPLAY starting with unix: or / is always a socket path
Do not consider anything else in this case.
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
commit b898f415e7c31de5b4beb06b22a5498049852e53
Author: Demi Marie Obenour <demiobenour@gmail.com>
Date: Thu Dec 15 14:43:37 2022 -0500
Allow full paths to sockets on non-macOS
This adds explicit checks for addresses that start with / or unix: and
uses full paths in this case.
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
commit e24adec1203cd25423ab2835a5be4f6b828b72a5
Author: Demi Marie Obenour <demiobenour@gmail.com>
Date: Thu Dec 17 03:28:45 2020 +0000
Remove client-side abstract socket support
CVE-2020-25697 and the Flatpak documentation show that clients using
abstract sockets without mutual authentication is unsafe.
TRANS_ABSTRACT remains supported, but it is now a no-op on the client
side. Abstract sockets are still supported for servers, as the X server
authenticates the client via other methods.
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
commit 9d77996f9f972da63c06099fd8c0f0529159b98f
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Feb 25 09:33:29 2023 -0800
Remove "All rights reserved" from Oracle copyright notices
Oracle no longer includes this term in our copyright & license notices.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 9ae32feef793082a302e65d31514a958604c761d
Author: Olivier Fourdan <ofourdan@redhat.com>
Date: Tue Jun 25 14:59:59 2019 +0200
Allow partial connection to succeed
Xwayland can optionally be socket-activated by the Wayland compositor,
in which case it would use only the sockets provided by the compositor.
However, that prevents other transport protocols from working, because
when it's given a socket from the Wayland compositor, it would disable
all other connections and rely solely on the given socket.
Change `MakeAllCOTSServerListeners` to allow for partial connections so
that if `partial` is set to a non-zero value by the caller, we do not
bail out in the address is already in use.
That allows to continue trying with other protocols even if the local
connection fails (as this is already handled by the socket from the
Wayland compositor).
Related: https://gitlab.freedesktop.org/xorg/xserver/issues/817
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
commit c761c6505d49e8381a3eae94f2e5e118cbdf6487
Author: Keith Packard <keithp@keithp.com>
Date: Wed Jan 29 12:54:26 2014 -0800
Use font server ErrorF/VErrorF instead of private versions
XTrans creates custom ErrorF/VErrorF functions when the including
project doesn't provide them, however the test for that is weak and xtrans
ends up using the private versions for the font server as well.
This means that all xtrans error messages will not be included in the
font server log. It also causes redefinition warnings when building
the font server (which is how this problem was identified).
However, the font server doesn't currently provide a VErrorF function,
so instead of just always relying on the font server to provide these
functions, this patch uses a new TRANS_HAS_ERRORF define to select
whether the project-provided or internal versions will be used. A
patch to the font server that adds VErrorF and defines
TRANS_HAS_ERRORF will be required to fix this bug.
Signed-off-by: Keith Packard <keithp@keithp.com>
commit 8c0f5228e75aa949963aa8d27dcfa2648db2e197
Author: Keith Packard <keithp@keithp.com>
Date: Wed Jan 29 12:54:25 2014 -0800
move is_numeric to Xtranssock.c and only define for TCPCONN or TRANS_REOPEN
Don't define this function unless it is actually going to be used.
Signed-off-by: Keith Packard <keithp@keithp.com>
commit 3309c75906a56de86607f59481304b3a2812162f
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue May 10 09:18:15 2022 -0700
gitlab CI: add a basic build test
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit c069ede3c97f543d9bbe9ed67e56c74142921cc5
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue May 10 09:15:11 2022 -0700
Fix spelling/wording issues
Found by using:
codespell --builtin clear,rare,usage,informal,code,names
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 16a015524f3820f969362c2d10a3664999a12c3b
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue May 10 09:11:07 2022 -0700
Build xz tarballs instead of bzip2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 7898badde44cf518da6879c2622b6db9cd709c7d
Author: Ray Strode <rstrode@redhat.com>
Date: Fri May 6 14:23:59 2022 -0400
Automatically disable inet6 transport if ipv6 is disabled on machine
If a machine is booted with ipv6.disable=1, trying to bind to an
AF_INET6 socket will fail with AFNOSUPPORT.
The tcp transport automatically falls back to ipv4 in this case, but
the more specific inet6 transport just fails.
This failure leads to MakeAllCOTSServerListeners returning a partial
success.
Unfortunately, the X server can't really contiue with partial successes
from this function if -displayfd is in use, since that would, in other
cases, potentially lead to the -displayfd electing a display number that
is potentially partially in use by a rogue program.
This commit addresses the issue by automatically disabling transports
when they fail with AFNOSUPPORT, leading them to get ignored, rather than
proceeding and ultimately returning from MakeAllCOTSServerListerns with
partial=TRUE.
commit 3b5df889f58a99980a35a7b4a18eb4e7d2abeac4
Author: Adam Jackson <ajax@redhat.com>
Date: Wed Oct 9 14:05:47 2019 -0400
TEST_t is never defined
This didn't even correspond to any of the testing protocol extensions!
Apparently there used to be some test programs in xtrans itself, and
they've not been a thing since 1994:
https://cgit.freedesktop.org/~alanc/xc-historical/commit/?id=73bf4832c427855b2ce111d47dd1f181564b8d06
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit d0d471579ca69365d4cd5a548ce6fc8b4662d467
Author: Adam Jackson <ajax@redhat.com>
Date: Wed Sep 25 11:09:52 2019 -0400
Remove non-Solaris SysV support
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 521682b8b72e3ad50c9ae66a9b35249100188eb2
Author: Adam Jackson <ajax@redhat.com>
Date: Tue Sep 24 21:29:46 2019 -0400
Delete SCO support
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 3f8b27a9dff68792fdc448782459a6d41cade9ff
Author: Adam Jackson <ajax@redhat.com>
Date: Tue Sep 24 19:48:17 2019 -0400
unifdef USG and NCR
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit c4262efc9688e495261d8b23a12f956ab38e006f
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Mar 16 14:25:35 2019 -0700
@ -398,7 +598,7 @@ Date: Wed Jul 10 16:29:12 2013 +0100
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
commit e1e6121a1638d43d9929589b4723da2b38cb6b44
Author: Łukasz Stelmach <l.stelmach@samsung.com>
Author: Łukasz Stelmach <l.stelmach@samsung.com>
Date: Mon Nov 25 11:11:54 2013 +0100
Enable systemd socket activation
@ -419,7 +619,7 @@ Date: Mon Nov 25 11:11:54 2013 +0100
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
commit b895d45e225dd3d1bf9d598774d3ae4f29fcbc25
Author: Łukasz Stelmach <l.stelmach@samsung.com>
Author: Łukasz Stelmach <l.stelmach@samsung.com>
Date: Thu Nov 28 12:57:21 2013 +0100
Define TRANS_RECEIVED flag for transports
@ -634,7 +834,7 @@ Date: Fri Jan 18 16:47:30 2013 -0800
Signed-off-by: Keith Packard <keithp@keithp.com>
commit f6a161f2a003f4da0a2e414b4faa0ee0de0c01f0
Author: Łukasz Stelmach <l.stelmach@samsung.com>
Author: Łukasz Stelmach <l.stelmach@samsung.com>
Date: Tue Jul 9 16:24:43 2013 +0200
Add const qualifier to unix_nolisten
@ -1318,7 +1518,7 @@ Date: Thu Jan 14 21:11:43 2010 -0800
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
commit dab2bcdaf60977643ec55d71a81e67c1e3a162a9
Author: Rémi Cardona <remi@gentoo.org>
Author: Rémi Cardona <remi@gentoo.org>
Date: Thu Dec 17 08:31:20 2009 +0100
require autoconf 2.60 because of $(docdir) use
@ -1776,7 +1976,7 @@ Date: Tue Apr 15 12:32:35 2008 -0700
<http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6688467>
commit 556a351de83fc6f401b02213dae95731553c216d
Author: Loïc Minier <lool@dooz.org>
Author: Loïc Minier <lool@dooz.org>
Date: Mon Mar 24 15:38:27 2008 -0400
Bug #10489: Don't retry unix socket connect()s on ENOENT.
@ -2193,7 +2393,7 @@ Date: Sat Jul 2 18:00:50 2005 +0000
Make includedir=@includedir@ in xtrans.pc.in, not with /X11/Xtrans.
commit b413f4c1dddc467014adf16bfe31627e65508c12
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Wed Jun 22 22:46:39 2005 +0000
Apply these patches from Theo van Klaveren:
@ -2209,7 +2409,7 @@ Date: Wed Jun 22 22:36:51 2005 +0000
platforms that don't define it in the system headers.
commit f5a6a188407cec6e567070d192aac2db72cacd92
Author: Kristian Høgsberg <krh@redhat.com>
Author: Kristian Høgsberg <krh@redhat.com>
Date: Wed Jun 22 01:21:24 2005 +0000
Apply patch by Alan Coopersmith from #1605 to fix address resolution of
@ -2237,7 +2437,7 @@ Date: Wed Jun 8 06:24:53 2005 +0000
prefix's aclocal dir is not in a default path for system aclocal.
commit 58c7263ca5b64a21dc101bb4b24201ba67a8d068
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Wed May 25 21:47:56 2005 +0000
- Add FSlib to symlink.sh
@ -2284,7 +2484,7 @@ Date: Thu May 19 00:10:08 2005 +0000
Require automake 1.7 in AM_INIT_AUTOMAKE
commit daa7168e9e0cdff5eb06b0c9a7155f8880681fff
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Fri May 13 22:53:43 2005 +0000
- For now put xtrans in X11/Xtrans/X11, since libX11 is looking for it in
@ -2298,32 +2498,32 @@ Date: Fri May 13 22:53:43 2005 +0000
- Conditionally include config.h in Xlib source
commit d11d95fa4faec21655625b7de27d8a71c08ffe2d
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Fri May 13 15:16:43 2005 +0000
Dummy changes to ChangeLog/configure.ac to see if that fixes group
permissions
commit b8a8c31f63a543d1c1c6bb4ae26a4019b4400edc
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Fri May 13 15:04:52 2005 +0000
Re-adding ChangeLog and configure.ac files
commit 798c08054ce5a8238f35fee3e69218ece74441fa
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Fri May 13 15:02:19 2005 +0000
Temporarily remove ChangeLog configure.ac
commit b3da86ae588df14dde916674a4f6593edf1964f7
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Fri May 13 14:43:37 2005 +0000
Dummy commit to see if that fixes the group execute permissions
commit ea04267da780c2c3f08a710d15468565897420c4
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Thu May 12 16:12:34 2005 +0000
Make xtrans install in $(includedir)/X11/Xtrans. Remove all references to
@ -2338,7 +2538,7 @@ Date: Thu May 12 02:49:16 2005 +0000
Add Xtransdef.h.in as an AM_CONFIG_HEADER.
commit d628bf24f2bf0d017394b6961784d7ac5b33f46b
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Wed May 11 22:44:52 2005 +0000
lib/Xau:

View File

@ -190,7 +190,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
@ -201,12 +200,10 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
FOP = @FOP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
@ -292,6 +289,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@

View File

@ -25,7 +25,7 @@ Xorg mailing list:
https://lists.x.org/mailman/listinfo/xorg
The master development code repository can be found at:
The primary development code repository can be found at:
https://gitlab.freedesktop.org/xorg/lib/libxtrans

View File

@ -62,7 +62,7 @@ from The Open Group.
* Each transport is assigned a unique transport id.
*
* New transports can be added by adding an entry in this table.
* For compatiblity, the transport ids should never be renumbered.
* For compatibility, the transport ids should never be renumbered.
* Always add to the end of the list.
*/
@ -75,10 +75,10 @@ from The Open Group.
#define TRANS_SOCKET_TCP_INDEX 7
#define TRANS_DNET_INDEX 8
#define TRANS_LOCAL_LOCAL_INDEX 9
#define TRANS_LOCAL_PTS_INDEX 10
/* 10 used to be PTS, but that's gone. */
#define TRANS_LOCAL_NAMED_INDEX 11
/* 12 used to be ISC, but that's gone. */
#define TRANS_LOCAL_SCO_INDEX 13
/* 13 used to be SCO, but that's gone. */
#define TRANS_SOCKET_INET6_INDEX 14
#define TRANS_LOCAL_PIPE_INDEX 15
@ -100,18 +100,12 @@ Xtransport_table Xtransports[] = {
#endif /* UNIXCONN */
#if defined(LOCALCONN)
{ &TRANS(LocalFuncs), TRANS_LOCAL_LOCAL_INDEX },
#ifndef __sun
{ &TRANS(PTSFuncs), TRANS_LOCAL_PTS_INDEX },
#endif /* __sun */
#if defined(SVR4) || defined(__SVR4)
{ &TRANS(NAMEDFuncs), TRANS_LOCAL_NAMED_INDEX },
#endif
#ifdef __sun
{ &TRANS(PIPEFuncs), TRANS_LOCAL_PIPE_INDEX },
#endif /* __sun */
#if defined(__SCO__) || defined(__UNIXWARE__)
{ &TRANS(SCOFuncs), TRANS_LOCAL_SCO_INDEX },
#endif /* __SCO__ || __UNIXWARE__ */
#endif /* LOCALCONN */
};
@ -189,10 +183,7 @@ TRANS(SelectTransport) (const char *protocol)
return NULL;
}
#ifndef TEST_t
static
#endif /* TEST_t */
int
static int
TRANS(ParseAddress) (const char *address,
char **protocol, char **host, char **port)
@ -211,14 +202,36 @@ TRANS(ParseAddress) (const char *address,
* If a "::" is found then assume DNET.
*/
char *mybuf, *tmpptr;
const char *_protocol;
char *mybuf, *tmpptr = NULL;
const char *_protocol = NULL;
char *_host, *_port;
char hostnamebuf[256];
int _host_len;
prmsg (3,"ParseAddress(%s)\n", address);
/* First, check for AF_UNIX socket paths */
if (address[0] == '/') {
_protocol = "local";
_host = "";
_port = address;
} else
#ifdef HAVE_LAUNCHD
/* launchd sockets will look like 'local//tmp/launch-XgkNns/:0' */
if(!strncmp(address,"local//",7)) {
_protocol="local";
_host="";
_port=address+6;
} else
#endif
if (!strncmp(address, "unix:", 5)) {
_protocol = "local";
_host = "";
_port = address + 5;
}
if (_protocol)
goto done_parsing;
/* Copy the string so it can be changed */
tmpptr = mybuf = strdup (address);
@ -256,7 +269,7 @@ TRANS(ParseAddress) (const char *address,
{
/* There is a hostname specified */
_protocol = "tcp";
mybuf = tmpptr; /* reset to the begining of the host ptr */
mybuf = tmpptr; /* reset to the beginning of the host ptr */
}
}
else
@ -340,15 +353,7 @@ TRANS(ParseAddress) (const char *address,
*/
#endif
#ifdef HAVE_LAUNCHD
/* launchd sockets will look like 'local//tmp/launch-XgkNns/:0' */
if(address != NULL && strlen(address)>8 && (!strncmp(address,"local//",7))) {
_protocol="local";
_host="";
_port=address+6;
}
#endif
done_parsing:
/*
* Now that we have all of the components, allocate new
* string space for them.
@ -646,7 +651,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
break;
case 1: /* Set to non-blocking mode */
#if defined(O_NONBLOCK) && !defined(SCO325)
#if defined(O_NONBLOCK)
ret = fcntl (fd, F_GETFL, 0);
if (ret != -1)
ret = fcntl (fd, F_SETFL, ret | O_NONBLOCK);
@ -1004,7 +1009,7 @@ TRANS(GetConnectionNumber) (XtransConnInfo ciptr)
/*
* These functions are really utility functions, but they require knowledge
* of the internal data structures, so they have to be part of the Transport
* Independant API.
* Independent API.
*/
#ifdef TRANS_SERVER
@ -1179,6 +1184,9 @@ TRANS(MakeAllCOTSServerListeners) (const char *port, int *partial,
if ((status = TRANS(CreateListener (ciptr, port, flags))) < 0)
{
if (*partial != 0)
continue;
if (status == TRANS_ADDR_IN_USE)
{
/*
@ -1318,7 +1326,7 @@ static int TRANS(WriteV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt)
#endif /* WIN32 */
#if defined(_POSIX_SOURCE) || defined(USG) || defined(SVR4) || defined(__SVR4) || defined(__SCO__)
#if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__SVR4)
#ifndef NEED_UTSNAME
#define NEED_UTSNAME
#endif

View File

@ -148,7 +148,7 @@ typedef long BytesReadable_t;
#endif
#if defined(WIN32) || defined(USG)
#if defined(WIN32)
/*
* TRANS(Readv) and TRANS(Writev) use struct iovec, normally found

View File

@ -98,7 +98,7 @@ from The Open Group.
* to avoid a race condition. JKJ (6/5/97)
*/
# if defined(_POSIX_SOURCE) || defined(USG) || defined(SVR4) || defined(__SVR4) || defined(__SCO__)
# if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__SVR4)
# ifndef NEED_UTSNAME
# define NEED_UTSNAME
# endif
@ -297,7 +297,9 @@ typedef struct _Xtransport_table {
#define TRANS_DISABLED (1<<2) /* Don't open this one */
#define TRANS_NOLISTEN (1<<3) /* Don't listen on this one */
#define TRANS_NOUNLINK (1<<4) /* Don't unlink transport endpoints */
#define TRANS_ABSTRACT (1<<5) /* Use abstract sockets if available */
#define TRANS_ABSTRACT (1<<5) /* This previously meant that abstract sockets should be used available. For security
* reasons, this is now a no-op on the client side, but it is still supported for servers.
*/
#define TRANS_NOXAUTH (1<<6) /* Don't verify authentication (because it's secure some other way at the OS layer) */
#define TRANS_RECEIVED (1<<7) /* The fd for this has already been opened by someone else. */
@ -351,11 +353,6 @@ static int TRANS(WriteV)(
#endif /* WIN32 */
static int is_numeric (
const char * /* str */
);
#ifdef TRANS_SERVER
static int trans_mkdir (
const char *, /* path */
@ -375,10 +372,11 @@ static int trans_mkdir (
#include <stdarg.h>
/*
* The X server provides ErrorF() & VErrorF(), for other software that uses
* xtrans, we provide our own simple versions.
* The X server and the font server both provide ErrorF() & VErrorF(). For
* other software that uses xtrans, we provide our own simple
* versions.
*/
# if defined(XSERV_t) && defined(TRANS_SERVER)
# if (defined(XSERV_t) || defined(TRANS_HAS_ERRORF)) && defined(TRANS_SERVER)
# include "os.h"
# else
static inline void _X_ATTRIBUTE_PRINTF(1, 0)

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, Oracle and/or its affiliates.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -141,7 +141,7 @@ from the copyright holders.
/* others don't need this */
#define SocketInitOnce() /**/
#ifdef linux
#ifdef __linux__
#define HAVE_ABSTRACT_SOCKETS
#endif
@ -196,6 +196,20 @@ static Sockettrans2dev Sockettrans2devtab[] = {
static int TRANS(SocketINETClose) (XtransConnInfo ciptr);
#endif
#if defined(TCPCONN) || defined(TRANS_REOPEN)
static int
is_numeric (const char *str)
{
int i;
for (i = 0; i < (int) strlen (str); i++)
if (!isdigit (str[i]))
return (0);
return (1);
}
#endif
#ifdef UNIXCONN
@ -227,7 +241,7 @@ static int TRANS(SocketINETClose) (XtransConnInfo ciptr);
#if defined HAVE_SOCKLEN_T || (defined(IPv6) && defined(AF_INET6))
# define SOCKLEN_T socklen_t
#elif defined(SVR4) || defined(__SVR4) || defined(__SCO__)
#elif defined(SVR4) || defined(__SVR4)
# define SOCKLEN_T size_t
#else
# define SOCKLEN_T int
@ -611,12 +625,19 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, const char *protocol,
break;
}
if (i < 0) {
if (i == -1)
prmsg (1,"SocketOpenCOTSServer: Unable to open socket for %s\n",
thistrans->TransName);
else
if (i == -1) {
if (errno == EAFNOSUPPORT) {
thistrans->flags |= TRANS_NOLISTEN;
prmsg (1,"SocketOpenCOTSServer: Socket for %s unsupported on this system.\n",
thistrans->TransName);
} else {
prmsg (1,"SocketOpenCOTSServer: Unable to open socket for %s\n",
thistrans->TransName);
}
} else {
prmsg (1,"SocketOpenCOTSServer: Unable to determine socket type for %s\n",
thistrans->TransName);
}
return NULL;
}
@ -990,7 +1011,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, const char *port,
return TRANS_CREATE_LISTENER_FAILED;
}
#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__))
#if defined(BSD44SOCKETS)
sockname.sun_len = strlen(sockname.sun_path);
#endif
@ -1068,7 +1089,7 @@ TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr)
if (!abstract && (
stat (unsock->sun_path, &statb) == -1 ||
((statb.st_mode & S_IFMT) !=
#if defined(NCR) || defined(SCO325) || !defined(S_IFSOCK)
#if !defined(S_IFSOCK)
S_IFIFO
#else
S_IFSOCK
@ -1818,12 +1839,6 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr,
struct sockaddr_un sockname;
SOCKLEN_T namelen;
int abstract = 0;
#ifdef HAVE_ABSTRACT_SOCKETS
abstract = ciptr->transptr->flags & TRANS_ABSTRACT;
#endif
prmsg (2,"SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port);
/*
@ -1859,12 +1874,12 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr,
sockname.sun_family = AF_UNIX;
if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) {
if (set_sun_path(port, UNIX_PATH, sockname.sun_path, 0) != 0) {
prmsg (1, "SocketUNIXConnect: path too long\n");
return TRANS_CONNECT_FAILED;
}
#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__))
#if defined(BSD44SOCKETS)
sockname.sun_len = strlen (sockname.sun_path);
#endif
@ -1875,16 +1890,6 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr,
#endif
/*
* Adjust the socket path if using abstract sockets.
* Done here because otherwise all the strlen() calls above would fail.
*/
if (abstract) {
sockname.sun_path[0] = '\0';
}
/*
* Do the connect()
*/
@ -1918,15 +1923,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr,
return TRANS_IN_PROGRESS;
else if (olderrno == EINTR)
return TRANS_TRY_CONNECT_AGAIN;
else if (olderrno == ENOENT || olderrno == ECONNREFUSED) {
/* If opening as abstract socket failed, try again normally */
if (abstract) {
ciptr->transptr->flags &= ~(TRANS_ABSTRACT);
return TRANS_TRY_CONNECT_AGAIN;
} else {
return TRANS_CONNECT_FAILED;
}
} else {
else {
prmsg (2,"SocketUNIXConnect: Can't connect: errno = %d\n",
EGET());
@ -1948,9 +1945,6 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr,
return TRANS_CONNECT_FAILED;
}
if (abstract)
sockname.sun_path[0] = '@';
ciptr->family = AF_UNIX;
ciptr->addrlen = namelen;
ciptr->peeraddrlen = namelen;

View File

@ -50,7 +50,7 @@ from The Open Group.
/*
* These are some utility functions created for convenience or to provide
* an interface that is similar to an existing interface. These are built
* only using the Transport Independant API, and have no knowledge of
* only using the Transport Independent API, and have no knowledge of
* the internal implementation.
*/
@ -169,13 +169,6 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
}
#endif /* defined(UNIXCONN) || defined(LOCALCONN) */
#if (defined(__SCO__) || defined(__UNIXWARE__)) && defined(LOCALCONN)
case 0:
{
*familyp=FamilyLocal;
break;
}
#endif
default:
prmsg(1,"ConvertAddress: Unknown family type %d\n",
@ -435,20 +428,6 @@ TRANS(WSAStartup) (void)
}
#endif
#include <ctype.h>
static int
is_numeric (const char *str)
{
int i;
for (i = 0; i < (int) strlen (str); i++)
if (!isdigit (str[i]))
return (0);
return (1);
}
#ifdef TRANS_SERVER
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -13,15 +13,15 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
[m4_warning([this file was generated for autoconf 2.69.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
dnl serial 11 (pkg-config-0.29.1)
dnl
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
@ -62,7 +62,7 @@ dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.1])
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
@ -163,7 +163,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@ -173,11 +173,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
@ -194,7 +194,7 @@ installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
@ -1318,7 +1318,7 @@ AC_SUBST([am__untar])
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
dnl
dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
dnl Copyright (c) 2005, 2023, Oracle and/or its affiliates.
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
@ -1355,7 +1355,7 @@ dnl DEALINGS IN THE SOFTWARE.
# See the "minimum version" comment for each macro you use to see what
# version you require.
m4_defun([XORG_MACROS_VERSION],[
m4_define([vers_have], [1.19.2])
m4_define([vers_have], [1.20.0])
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
m4_if(m4_cmp(maj_have, maj_needed), 0,,
@ -1376,7 +1376,7 @@ AM_MAINTAINER_MODE
# such as man pages and config files
AC_DEFUN([XORG_PROG_RAWCPP],[
AC_REQUIRE([AC_PROG_CPP])
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
AC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
# Check for flag to avoid builtin definitions - assumes unix is predefined,
@ -1686,7 +1686,7 @@ AC_SUBST(MAKE_HTML)
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-xmlto option, it allows maximum flexibilty in making decisions
# the --with-xmlto option, it allows maximum flexibility in making decisions
# as whether or not to use the xmlto package. When DEFAULT is not specified,
# --with-xmlto assumes 'auto'.
#
@ -1900,7 +1900,7 @@ AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-asciidoc option, it allows maximum flexibilty in making decisions
# the --with-asciidoc option, it allows maximum flexibility in making decisions
# as whether or not to use the asciidoc package. When DEFAULT is not specified,
# --with-asciidoc assumes 'auto'.
#
@ -1970,7 +1970,7 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-doxygen option, it allows maximum flexibilty in making decisions
# the --with-doxygen option, it allows maximum flexibility in making decisions
# as whether or not to use the doxygen package. When DEFAULT is not specified,
# --with-doxygen assumes 'auto'.
#
@ -2054,7 +2054,7 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-groff option, it allows maximum flexibilty in making decisions
# the --with-groff option, it allows maximum flexibility in making decisions
# as whether or not to use the groff package. When DEFAULT is not specified,
# --with-groff assumes 'auto'.
#
@ -2162,7 +2162,7 @@ AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-fop option, it allows maximum flexibilty in making decisions
# the --with-fop option, it allows maximum flexibility in making decisions
# as whether or not to use the fop package. When DEFAULT is not specified,
# --with-fop assumes 'auto'.
#
@ -2256,7 +2256,7 @@ AC_SUBST([M4], [$ac_cv_path_M4])
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables. Coupled with
# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
# the --with-ps2pdf option, it allows maximum flexibility in making decisions
# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
# --with-ps2pdf assumes 'auto'.
#
@ -2311,7 +2311,7 @@ AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
# not at the appropriate level. This macro enables a builder to skip all
# documentation targets except traditional man pages.
# Combined with the specific tool checking macros XORG_WITH_*, it provides
# maximum flexibilty in controlling documentation building.
# maximum flexibility in controlling documentation building.
# Refer to:
# XORG_WITH_XMLTO --with-xmlto
# XORG_WITH_ASCIIDOC --with-asciidoc
@ -2344,7 +2344,7 @@ AC_MSG_RESULT([$build_docs])
#
# This macro enables a builder to skip all developer documentation.
# Combined with the specific tool checking macros XORG_WITH_*, it provides
# maximum flexibilty in controlling documentation building.
# maximum flexibility in controlling documentation building.
# Refer to:
# XORG_WITH_XMLTO --with-xmlto
# XORG_WITH_ASCIIDOC --with-asciidoc
@ -2377,7 +2377,7 @@ AC_MSG_RESULT([$build_devel_docs])
#
# This macro enables a builder to skip all functional specification targets.
# Combined with the specific tool checking macros XORG_WITH_*, it provides
# maximum flexibilty in controlling documentation building.
# maximum flexibility in controlling documentation building.
# Refer to:
# XORG_WITH_XMLTO --with-xmlto
# XORG_WITH_ASCIIDOC --with-asciidoc
@ -2852,7 +2852,11 @@ AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
AC_DEFUN([XORG_COMPILER_BRAND], [
AC_LANG_CASE(
[C], [
AC_REQUIRE([AC_PROG_CC_C99])
dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
dnl and complains that AC_PROG_CC_C99 is obsolete
m4_version_prereq([2.70],
[AC_REQUIRE([AC_PROG_CC])],
[AC_REQUIRE([AC_PROG_CC_C99])])
],
[C++], [
AC_REQUIRE([AC_PROG_CXX])
@ -2868,7 +2872,7 @@ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
# Minimum version: 1.16.0
#
# Test if the compiler works when passed the given flag as a command line argument.
# If it succeeds, the flag is appeneded to the given variable. If not, it tries the
# If it succeeds, the flag is appended to the given variable. If not, it tries the
# next flag in the list until there are no more options.
#
# Note that this does not guarantee that the compiler supports the flag as some
@ -2884,7 +2888,11 @@ AC_LANG_COMPILER_REQUIRE
AC_LANG_CASE(
[C], [
AC_REQUIRE([AC_PROG_CC_C99])
dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
dnl and complains that AC_PROG_CC_C99 is obsolete
m4_version_prereq([2.70],
[AC_REQUIRE([AC_PROG_CC])],
[AC_REQUIRE([AC_PROG_CC_C99])])
define([PREFIX], [C])
define([CACHE_PREFIX], [cc])
define([COMPILER], [$CC])
@ -3025,7 +3033,7 @@ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
# Turn some warnings into errors, so we don't accidently get successful builds
# Turn some warnings into errors, so we don't accidentally get successful builds
# when there are problems that should be fixed.
if test "x$SELECTIVE_WERROR" = "xyes" ; then
@ -3134,23 +3142,35 @@ AC_SUBST([BASE_]PREFIX[FLAGS])
AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
]) # XORG_STRICT_OPTION
# XORG_DEFAULT_OPTIONS
# --------------------
# Minimum version: 1.3.0
# XORG_DEFAULT_NOCODE_OPTIONS
# ---------------------------
# Minimum version: 1.20.0
#
# Defines default options for X.Org modules.
# Defines default options for X.Org modules which don't compile code,
# such as fonts, bitmaps, cursors, and docs.
#
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
AC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [
AC_REQUIRE([AC_PROG_INSTALL])
XORG_COMPILER_FLAGS
XORG_CWARNFLAGS
XORG_STRICT_OPTION
XORG_RELEASE_VERSION
XORG_CHANGELOG
XORG_INSTALL
XORG_MANPAGE_SECTIONS
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
]) # XORG_DEFAULT_NOCODE_OPTIONS
# XORG_DEFAULT_OPTIONS
# --------------------
# Minimum version: 1.3.0
#
# Defines default options for X.Org modules which compile code.
#
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
AC_REQUIRE([AC_PROG_INSTALL])
XORG_COMPILER_FLAGS
XORG_CWARNFLAGS
XORG_STRICT_OPTION
XORG_DEFAULT_NOCODE_OPTIONS
]) # XORG_DEFAULT_OPTIONS
# XORG_INSTALL()

View File

@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -53,7 +53,7 @@ func_file_conv ()
MINGW*)
file_conv=mingw
;;
CYGWIN*)
CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@ -67,7 +67,7 @@ func_file_conv ()
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

6710
lib/libxtrans/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -148,7 +148,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
@ -159,12 +158,10 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
FOP = @FOP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
@ -250,6 +247,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@

View File

@ -1109,7 +1109,7 @@ In X11R7 modular releases, these flags are set when running
<row>
<entry>OSI</entry>
<entry>osi</entry>
<entry>name of an OSI adressable host.</entry>
<entry>name of an OSI addressable host.</entry>
<entry>Not sure of the specifics yet.</entry>
</row>
<row>

View File

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-11-20.07; # UTC
scriptversion=2020-11-14.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" "" $nl"
IFS=" $tab$nl"
# set DOITPROG to echo to test this script
# Set DOITPROG to "echo" to test this script.
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
@ -68,22 +64,16 @@ mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
# Create dirs (including intermediate dirs) using mode 755.
# This is like GNU 'install' as of coreutils 8.32 (2020).
mkdir_umask=22
backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@ -97,7 +87,7 @@ dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@ -114,18 +104,28 @@ Options:
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-p pass -p to $cpprog.
-s $stripprog installed files.
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
By default, rm is invoked with -f; when overridden with RMPROG,
it's up to you to specify -f if you want it.
If -S is not specified, no backups are attempted.
Email bug reports to bug-automake@gnu.org.
Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
@ -137,46 +137,62 @@ while test $# -ne 0; do
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
shift;;
-p) cpprog="$cpprog -p";;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-S) backupsuffix="$2"
shift;;
-T) no_target_directory=true;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
@ -207,6 +223,15 @@ if test $# -eq 0; then
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
@ -223,16 +248,16 @@ if test -z "$dir_arg"; then
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
u_plus_rw=
else
u_plus_rw='% 200'
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
u_plus_rw=
else
u_plus_rw=,u+rw
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
@ -250,6 +275,10 @@ do
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
# Don't chown directories that already exist.
if test $dstdir_status = 0; then
chowncmd=""
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@ -266,178 +295,148 @@ do
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
posix_mkdir=false
# The $RANDOM variable is not portable (e.g., dash). Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
trap '
ret=$?
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
exit $ret
' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p'.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
mkdir_mode=
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
trap '' 0;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set -f
set fnord $dstdir
shift
$posix_glob set +f
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
@ -450,14 +449,25 @@ do
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
(umask $cp_umask &&
{ test -z "$stripcmd" || {
# Create $dsttmp read-write so that cp doesn't create it read-only,
# which would cause strip to fail.
if test -z "$doit"; then
: >"$dsttmp" # No need to fork-exec 'touch'.
else
$doit touch "$dsttmp"
fi
}
} &&
$doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@ -472,20 +482,24 @@ do
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# If $backupsuffix is set, and the file being installed
# already exists, attempt a backup. Don't worry if it fails,
# e.g., if mv doesn't support -f.
if test -n "$backupsuffix" && test -f "$dst"; then
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
fi
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@ -493,24 +507,24 @@ do
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
@ -519,9 +533,9 @@ do
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View File

@ -1,5 +1,5 @@
dnl
dnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
dnl Copyright (c) 2005, Oracle and/or its affiliates.
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
@ -122,7 +122,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
XTRANS_TCP_FLAGS
fi
[case $host_os in
solaris*|sco*|sysv4*) localdef="yes" ;;
solaris*) localdef="yes" ;;
*) localdef="no" ;;
esac]
AC_ARG_ENABLE(local-transport,