Enrico Weigelt, metux IT consult
27a5c59180
os: drop redefining getpid() on mingw32
...
mingw32 does does have getpid() function, so conditionally redefining
it to _getpid() isn't necessary.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1686 >
2024-10-10 17:55:56 +00:00
Enrico Weigelt, metux IT consult
e5b5b302d3
os: replace LogVWrite() by LogVMessageVerb()
...
It's just a wrapper around LogVMessageVerb() and no external module
using it, so can easily be optimized-away.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1683 >
2024-10-10 17:34:12 +00:00
Enrico Weigelt, metux IT consult
c26023a009
os: replace LogWrite() by LogMessageVerb()
...
It's nothing but a wrapper, doing the same as LogMessageVerb(X_NONE, ...),
and no external module / driver needs it, so can be easily optimized away.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1683 >
2024-10-10 17:34:12 +00:00
Enrico Weigelt, metux IT consult
d43d346541
os: log: use localtime_r() on mingw builds
...
MingW also provides localtime_r(), but needs _POSIX_THREAD_SAFE_FUNCTIONS
symbol before including anything, in order for the prototype being defined.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1685 >
2024-10-10 16:58:01 +00:00
Enrico Weigelt, metux IT consult
bb9953db3f
os: utils: fix char signess mismatch
...
On NetBSD gives warning:
In file included from /usr/include/ctype.h:100,
from ../include/misc.h:174,
from ../os/utils.c:75:
../os/utils.c: In function ‘VerifyDisplayName’:
../os/utils.c:624:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
624 | if (!isdigit(d[i])) {
| ^
../os/utils.c: In function ‘ProcessCommandLine’:
../os/utils.c:942:44: warning: array subscript has type ‘char’ [-Wchar-subscripts]
942 | if ((i + 1 < argc) && (isdigit(*argv[i + 1])))
| ^
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455 >
2024-10-10 13:56:05 +00:00
Enrico Weigelt, metux IT consult
9446ae487c
os: access: fix char signess mismatch
...
On NetBSD gives warning:
In file included from /usr/include/ctype.h:100,
from ../include/misc.h:174,
from ../os/access.c:96:
../os/access.c: In function ‘ResetHosts’:
../os/access.c:981:49: warning: array subscript has type ‘char’ [-Wchar-subscripts]
981 | lhostname[i] = tolower(ohostname[i]);
| ^
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455 >
2024-10-10 13:56:05 +00:00
Enrico Weigelt, metux IT consult
bd8d3455fb
os: don't include client.h anymore
...
There's no need to include client.h anymore. But still leaving it, in case
some external consumer relying on it's presence.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2024-10-10 13:45:29 +00:00
Enrico Weigelt, metux IT consult
1891a8dc14
os: unexport client id retrieval functions
...
These aren't used by any (known) external modules, thus no need to export them.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2024-10-10 13:45:29 +00:00
Enrico Weigelt, metux IT consult
ed3c2aeeb1
os: unexport DetermineClientPid() and DetermineClientCmd()
...
These aren't used by any drivers/modules, so no need to export them.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2024-10-10 13:45:29 +00:00
Enrico Weigelt, metux IT consult
7ac7a2d6de
os: split off internal definitions from client.h
...
The client.h file is part of the public module API, but it also contains
definitions that aren't useful for being used in modules. Splitting them
out into their own client_priv.h file, which isn't part of the API.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2024-10-10 13:45:29 +00:00
Enrico Weigelt, metux IT consult
a917f6a8a8
drop obsolete HAVE_DIX_CONFIG_H
...
The symbol controls whether to include dix-config.h, and it's always set,
thus we don't need it (and dozens of ifdef's) anymore.
This commit only removes them from our own source files, where we can
guarantee that dix-config.h is present - leaving the (potentially exported)
headers untouched.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2024-10-10 13:38:31 +00:00
Enrico Weigelt, metux IT consult
79ad940021
os: log: drop unncessary HAVE_DIX_CONFIG
...
It's always defined and dix-config.h is always present, so need for the
extra check.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1680 >
2024-10-09 00:01:18 +00:00
Enrico Weigelt, metux IT consult
2a959a27df
os: log: drop unnecessary ifdef's
...
The #ifdef's for log prefix defines aren't needed, so drop them.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1680 >
2024-10-09 00:01:18 +00:00
Olivier Fourdan
57a446c0f9
os: Fix NULL pointer dereference
...
RemoveHost() can be called from DisableLocalHost() with a NULL client,
but doesn't actually check whether the given client pointer is valid on
error and assigns the error value unconditionally, leading to a possible
NULL pointer dereference and a crash of the Xserver.
To avoid the issue, simply check whether the client pointer is not NULL
prior to assign the errorValue.
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1752
See-also: https://bugzilla.redhat.com/2313799
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1701 >
2024-09-23 09:36:52 +02:00
Enrico Weigelt, metux IT consult
1d7cb4b2c3
os: unexport CloseDownConnection()
...
Not used by any drivers, so no need to export it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1582 >
2024-09-02 16:02:39 +00:00
Matthieu Herrb
59f5445a7f
Return NULL in *cmdname if the client argv or argv[0] is NULL
...
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/995 >
2024-09-01 22:59:26 +00:00
Matthieu Herrb
a8512146ba
Don't crash if the client argv or argv[0] is NULL.
...
Report from bauerm at pestilenz dot org.
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/995 >
2024-09-01 22:59:26 +00:00
Enrico Weigelt, metux IT consult
811977228b
os: unexport screen saver timer functions
...
These functions aren't supposed to be used by drivers, so move them
out of the public API.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1583 >
2024-09-01 20:23:10 +00:00
Enrico Weigelt, metux IT consult
aef17edd92
os: utils: drop obsolete REMOVE_ENV_LD conditional
...
This always had been set since it's incarnation back two decades
ago, on XFree86 4.3.0.1. Probably no need to keep that around anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518 >
2024-09-01 20:08:30 +00:00
Enrico Weigelt, metux IT consult
4b94e4fa08
os: utils: drop unused USE_ISPRINT
...
This always had been disabled since it's incarnation XFree86 4.3.0.1,
back two decades ago, so there's likely no need for it.
Fixes: d568221710
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518 >
2024-09-01 20:08:30 +00:00
Enrico Weigelt, metux IT consult
b5d897d126
os: utils: drop REMOVE_LONG_ENV conditional
...
This always had been enabled since it's incarnation back two decades ago,
so it doesn't seem to be necessary keeping that conditional any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518 >
2024-09-01 20:08:30 +00:00
Enrico Weigelt, metux IT consult
6c6944be14
os: utils: drop unused VENDORSUPPORT
...
This doesn't seem to be used anymore for two decades now,
so there's probably no need to keep it any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518 >
2024-09-01 20:08:30 +00:00
Enrico Weigelt, metux IT consult
69905a0a28
os: utils: drop unused NO_OUTPUT_PIPES
...
This hasn't been used/enabled for over 20 years, so there's probably
no reason for keeping it even longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518 >
2024-09-01 20:08:30 +00:00
Enrico Weigelt, metux IT consult
6153b89d19
os: utils: minor code formatting cleanup
...
Just correcting some small indention issues, no actual change.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518 >
2024-09-01 20:08:30 +00:00
Enrico Weigelt, metux IT consult
3d3d148039
os: unexport WaitForSomething()
...
Not used by any drivers, so no need to export it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1584 >
2024-09-01 19:53:43 +00:00
Enrico Weigelt, metux IT consult
2cec3cfbf1
include: move private definitions out of input.h
...
It's not good having the public server api headers clobbered with private
definitions, so cleaning them up.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1354 >
2024-09-01 17:59:23 +00:00
Alan Coopersmith
62c9f52e41
Remove remnants of support for SVR4 systems other than Solaris & illumos
...
Most of the support for such OS'es was removed in 2010 for
xorg-server-1.10.0, but a few bits lingered on.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1667 >
2024-09-01 02:14:10 +00:00
Alan Coopersmith
f35951d83e
Remove remnants of support for SysV versions before SVR4
...
Most of the support for such OS'es was removed in 2010 for
xorg-server-1.10.0, but a few bits lingered on, and a few
comments were left out-of-date.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1667 >
2024-09-01 02:14:10 +00:00
Enrico Weigelt, metux IT consult
6531720c7c
os: backtrace: use fixed size array instead of vla
...
The backtrace buffer size (BT_SIZE) is determined by compile time,
so we can change BT_SIZE into a #define to turn vla into fixed array.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1664 >
2024-08-31 22:14:07 +00:00
Enrico Weigelt, metux IT consult
8e32cec204
xv: move noXvExtension to xvmain.c
...
It's more appropriate having those kind of flags in the corresponding
extension.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1512 >
2024-07-26 23:51:13 +00:00
Enrico Weigelt, metux IT consult
61233adbca
treewide: replace xnfreallocarray macro call by XNFreallocarray()
...
The xnfreallocarray was added along (and just as an alias to) XNFreallocarray
back a decade ago. It's just used in a few places and it's only saves us from
passing the first parameter (NULL), so the actual benefit isn't really huge.
No (known) driver is using it, so the macro can be dropped entirely.
Fixes: ae75d50395
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529 >
2024-07-26 23:41:33 +00:00
Enrico Weigelt, metux IT consult
96c99b8318
os: move -nolock help message printing to serverlock.h
...
Reduce #ifdef cluttering in os/utils.c a little bit my moving the (built-time-)
conditional printing of the help message into serverlock.c
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1320 >
2024-07-26 22:26:07 +00:00
Enrico Weigelt, metux IT consult
749046e5e9
os: move out LockServer logic from util.c to serverlock.c
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1320 >
2024-07-26 22:26:07 +00:00
Enrico Weigelt, metux IT consult
4773182c72
os: unexport LockServer() and UnlockServer() from public module API
...
These functions work on server process level, and shouldn't be touched
by drivers at all, thus shouldn't be exported to them.
(couldn't find any driver/module using these symbols)
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1320 >
2024-07-26 22:26:07 +00:00
Enrico Weigelt, metux IT consult
69b57fd01f
os: move defining LOCK_SERVER into meson
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1320 >
2024-07-26 22:26:07 +00:00
Enrico Weigelt, metux IT consult
b30edf326b
fix missing includes of <X11/Xfuncproto.h>
...
Several places using _X_ATTRIBUTE_PRINTF macro from X11/Xfuncproto.h
but missing to include it, so it depends on other headers whether it's
included by mere accident, which quickly causes trouble if include order
changes. Cleaning that up by adding explicit include statements.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1580 >
2024-07-20 17:18:38 +00:00
Joaquim Monteiro
a6a993f950
os: Fix siHostnameAddrMatch in the case where h_addr isn't defined
...
When IPv6 support isn't enabled, and h_addr isn't defined,
there is no for loop, so the break statement is invalid.
Signed-off-by: Joaquim Monteiro <joaquim.monteiro@protonmail.com >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1572 >
2024-06-23 21:32:23 +00:00
Joaquim Monteiro
0ddcd87851
os: Fix assignment with incompatible pointer type
...
struct hostent->h_addr_list is of type char**, not const char**.
GCC considers this an error when in C99 mode or later.
Signed-off-by: Joaquim Monteiro <joaquim.monteiro@protonmail.com >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1572 >
2024-06-23 21:32:23 +00:00
Enrico Weigelt, metux IT consult
34662f15af
os: unexport fields from opaque.h not used by modules / drivers
...
There're lots of field that aren't used by any modules or drivers,
thus no need to keep them exported.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1351 >
2024-06-23 21:19:27 +00:00
Enrico Weigelt, metux IT consult
06b599edb6
dix: unexport fields from opaque.h not used by modules/drivers
...
Lots of fields from opaque.h aren't used by any drivers/modules and thus
don't need to be exported at all.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1351 >
2024-06-23 21:19:27 +00:00
Enrico Weigelt, metux IT consult
591d95c79e
xace: typesafe hook function for XACE_AUTH_AVAIL
...
he generic XaceHook() call isn't typesafe (und unnecessarily slow).
Better add an explicit function, just like we already have for others.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1556 >
2024-06-23 21:07:48 +00:00
Enrico Weigelt, metux IT consult
47d6c3ad75
xace: typesafe hook function for XACE_SERVER_ACCESS
...
he generic XaceHook() call isn't typesafe (und unnecessarily slow).
Better add an explicit function, just like we already have for others.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1556 >
2024-06-23 21:07:48 +00:00
Enrico Weigelt, metux IT consult
487eb46826
os: move xserver_poll.h into os/ directory
...
This header isn't public and holds defines for code in os/ directory,
so no need to keep it in the global header dir - it's probably better
off in os/ directory - just like we already have with many others.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1389 >
2024-06-21 00:53:39 +00:00
Enrico Weigelt, metux IT consult
f8057261fe
os: drop extra ifdefs for AF_INET6
...
Since IPv6 is now only defined if IPv6 is really supported, we don't
need to ifdef on AF_INET6 anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1539 >
2024-06-18 01:59:33 +00:00
Enrico Weigelt, metux IT consult
88b2257cc4
os: drop duplicate nested ifdef TCPCONN
...
This #ifdef is always true, since two lines above it's already
checked that TCPCONN is defined.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1539 >
2024-06-18 01:59:33 +00:00
Enrico Weigelt, metux IT consult
9d6a1d1118
os: access.c: drop unnecessary ifdef
...
Conditional on ipv6 around including <arpa/inet.h> isn't necessary.
The only reason target not having it is win32, but it doesn't enable
SIOCGLIFCONF anyways.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1539 >
2024-06-18 01:59:33 +00:00
Enrico Weigelt, metux IT consult
71b207a2eb
os: drop SUN-DES-1 authentication
...
DES isn't considered secure anymore for long time now, more and more platforms
dropping DES from their RPC implementations, and even the one where it came
from (Solaris) disabled it for a decade now. We have much better alternatives
(eg. passing creds via Unix socket for local connections, ssh tunneling,
MIT-MAGIC-COOKIE-1, ...), so it's unlikely anybody still really relying on it.
Therefore, sweep it out.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1453 >
2024-06-18 00:52:11 +00:00
Fotios Valasiadis
af6180b2c9
os: Explicitly include X11/Xmd.h for CARD32 definition to fix building on i686
...
Noticed this after trying to update to xorg-server-xwayland-24.1.0 in void linux https://github.com/void-linux/void-packages/pull/50457
Signed-off-by: Fotios Valasiadis <fvalasiad@gmail.com >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1561 >
2024-06-07 08:42:58 +00:00
Enrico Weigelt, metux IT consult
61d0c8e21c
os: drop duplicate include of misc.h
...
Need to include it only once.
Fixes: be4c8444eb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1542 >
2024-05-13 19:23:08 +00:00
Enrico Weigelt, metux IT consult
a4cb4bc4f8
os: drop remains of STREAMSCONN
...
STREAMSCONN has been removed about a decade ago, but some comments
have been forgotten to be cleaned.
Fixes: b3e9c534e2
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1538 >
2024-05-13 18:20:55 +02:00