Commit de89c6b8 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

xfree86: rename Xorg.bin to Xorg

If the suid wrapper is enabled, /usr/bin/Xorg is just a shell script that
execs either /usr/libexec/Xorg.bin directly or the Xorg.wrap binary which then
execve's /usr/libexec/Xorg.bin.

Either way, we end up with Xorg.bin, which is problematic for two reasons:
* ps shows the command as Xorg.bin
* _COMM and _EXE in systemd's journal will both show Xorg.bin as well

There's not much we can do about the path, but having the actual command stay
as Xorg means better compatibility to existing scripts. And, the reason for
this path: the command
   journalctl _COMM=Xorg
works universally, regardless of whether the wrapper is used or not.

Signed-off-by: Peter Hutterer's avatarPeter Hutterer <>
Reviewed-by: Keith Packard's avatarKeith Packard <>
Acked-by: default avatarHans de Goede <>
parent ee21be13
......@@ -923,7 +923,7 @@ if test "x$SUID_WRAPPER" = xyes; then
dnl This is a define so that if some platforms want to put the wrapper
dnl somewhere else this can be easily changed
AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install Xorg.bin and Xorg.wrap])
AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install the Xorg binary and Xorg.wrap])
......@@ -106,7 +106,7 @@ if INSTALL_SETUID
mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.bin
mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg
${INSTALL} -m 755 $(DESTDIR)$(bindir)/Xorg
-chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap
# Execute Xorg.wrap if it exists otherwise execute Xorg.bin directly.
# Execute Xorg.wrap if it exists otherwise execute Xorg directly.
# This allows distros to put the suid wrapper in a separate package.
if [ -x "$basedir"/Xorg.wrap ]; then
exec "$basedir"/Xorg.wrap "$@"
exec "$basedir"/Xorg.bin "$@"
exec "$basedir"/Xorg "$@"
......@@ -33,7 +33,7 @@ Xorg.wrap \- Xorg X server binary wrapper
The Xorg X server may need root rights to function properly. To start the
Xorg X server with these rights your system is using a suid root wrapper
installed as __suid_wrapper_dir__/Xorg.wrap which will execute the real
X server which is installed as __suid_wrapper_dir__/Xorg.bin .
X server which is installed as __suid_wrapper_dir__/Xorg.
By default Xorg.wrap will autodetect if root rights are necessary, and
if not it will drop its elevated rights before starting the real X server.
......@@ -255,18 +255,18 @@ int main(int argc, char *argv[])
snprintf(buf, sizeof(buf), "%s/Xorg.bin", SUID_WRAPPER_DIR);
snprintf(buf, sizeof(buf), "%s/Xorg", SUID_WRAPPER_DIR);
/* Check if the server is executable by our real uid */
if (access(buf, X_OK) != 0) {
fprintf(stderr, "%s: Missing execute permissions for %s/Xorg.bin: %s\n",
progname, SUID_WRAPPER_DIR, strerror(errno));
fprintf(stderr, "%s: Missing execute permissions for %s: %s\n",
progname, buf, strerror(errno));
argv[0] = buf;
(void) execv(argv[0], argv);
fprintf(stderr, "%s: Failed to execute %s/Xorg.bin: %s\n",
progname, SUID_WRAPPER_DIR, strerror(errno));
fprintf(stderr, "%s: Failed to execute %s: %s\n",
progname, buf, strerror(errno));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment