FS#58644 - [xorg-server] xorg.wrap broken in 1.20.0-2
Attached to Project:
Arch Linux
Opened by Lone_Wolf (Lone_Wolf) - Friday, 18 May 2018, 00:29 GMT
Last edited by Laurent Carlier (lordheavy) - Saturday, 02 June 2018, 08:57 GMT
Opened by Lone_Wolf (Lone_Wolf) - Friday, 18 May 2018, 00:29 GMT
Last edited by Laurent Carlier (lordheavy) - Saturday, 02 June 2018, 08:57 GMT
|
Details
Xorg 1.20.0-2
I need to run X with root rights on my main system and have configured /etc/X11/Xwrapper.config as described in wiki[1] . In xorg-server 1.19.6+13+gd0d1a694f-2 this is taken care of by a wrapper script at /usr/bin/Xorg (attached) . /usr/bin/Xorg In xorg-server 1.20.0-2 however is no longer a wrapper script. Instead it's a binary that appears to be identical to the one at /usr/lib/xorg/Xorg . This breaks the execution of X with root rights. [1] https://wiki.archlinux.org/index.php/Xorg#Rootless_Xorg |
This task depends upon
Closed by Laurent Carlier (lordheavy)
Saturday, 02 June 2018, 08:57 GMT
Reason for closing: Fixed
Additional comments about closing: xorg-server-1.20.0-5
Saturday, 02 June 2018, 08:57 GMT
Reason for closing: Fixed
Additional comments about closing: xorg-server-1.20.0-5
- _install fakeinstall/usr/lib/Xorg{,.wrap}
+ _install fakeinstall/usr/lib/xorg-server
Edit:
FWIW "fakeinstall" installs these files in /usr/libexec/Xorg{,.wrap}
Edit2:
+ -Dlibexecdir=/usr/lib/xorg-server
Edit3:
If it works then we should install in '/usr/libexec' without setting -Dlibexecdir
When i try -D libexecdir=/usr/lib/xorg-server , meson complaints :
mesonbuild.mesonlib.MesonException: Argument "libexecdir" passed as both --libexecdir and -Dlibexecdir, but only one is allowed
Will try to adjust old wrapper script for new location .
Ops, I do not use arch-meson (https://github.com/fafryd1125/PKGBUILDs)
I have found a manual workaround though :
install xorg-server 1.20
replace /usr/bin/Xorg with the version from pre-1.20 xorg-server
edit /usr/bin/Xorg so basedir points to /usr/lib/
run chmod u+s /usr/lib/Xorg.wrap
> run chmod u+s /usr/lib/Xorg.wrap
Now it makes sense :)
>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 /usr/libexec/Xorg.wrap which will execute the real X server which is installed as /usr/libexec/Xorg.
@Ernest Grothauzen (Lone_Wolf)
Please, verify the default path
undefined reference to `glXGetProcAddressARB'
I noticed xorg-server pkgbuilds switched from autotools / make destdir to meson / fakeinstall , so changes between the PGBUILDs for 1.19 and 1.20 are rather big.
Maybe it would be easier to update the last 1.19 PKGBUILD to build 1.20 WITHOUT changing from autotools to meson .
https://github.com/fafryd1125/PKGBUILDs/blob/a5f4a9a9244937a59b137dcd38498314812773b2/xorg-server/PKGBUILD
It requires changes, but please try. Do not forget to change --libexecdir=/usr/lib/xorg-server \ :)
changing the output to Xorg.sh and /usr/bin/Xorg.sh is produced as the ascii text file instead of the binary from the libexec dir.
Building extra/xorg-server multiple times results in this :
After "meson configure build" xorg-server/src/build/hw/xfree86/Xorg is an ascii text file similar to /usr/bin/Xorg in pre-1.20 .
When ninja -C build has run, that Xorg file is a binary.
This matches what loqs found .
Next try will be using configure / make instead of meson / ninja .
Now it should work. I added the changed PKGBUILD from the repositories
hw/xfree86/meson.build creates the 'Xorg' executable which the configure_file rule for 'Xorg.sh.in' also having output 'Xorg' skips its build and uses.
meson does not apply install_mode for executable targets so the suid is not set infact the meson.build does not even try to set it.
'Xorg'[1] and 'Xorg'[2] are generated in the same build meson directory. One overwrites the other
Bug#2
>meson does not apply install_mode for executable targets so the suid is not set infact the meson.build does not even try to set it.
Yes
[1] https://cgit.freedesktop.org/xorg/xserver/tree/hw/xfree86/meson.build?h=xorg-server-1.20.0#n101
[2] https://cgit.freedesktop.org/xorg/xserver/tree/hw/xfree86/meson.build?h=xorg-server-1.20.0#n148
https://bugs.archlinux.org/task/58644#comment169568
No feedback from users. So it is pointless to report this upstream
workaround-> https://github.com/mesonbuild/meson/issues/3328
With that patch xorg.wrap works as intended afaict.
Used PKGBUILD attached to avoid confusion.
Blablo, you did most of the work on this.
Maybe you could report this in X bug tracker AND submit the patch to xorg-devel mailinglist ?
I've pushed xorg-server-1.20.0-4 with your patch.
Thanks!
Please see https://bbs.archlinux.org/viewtopic.php?pid=1787318#p1787318
Edit:
Please consider switching to autotools, it looks like xserver (meson) has experimental status (WIP)
/usr/bin/install -c -m 755 Xorg.sh /build/xorg-server/src/fakeinstall/usr/bin/Xorg
chown root /build/xorg-server/src/fakeinstall/usr/lib/Xorg.wrap && chmod u+s /build/xorg-server/src/fakeinstall/usr/lib/Xorg.wrap
chown: changing ownership of '/build/xorg-server/src/fakeinstall/usr/lib/Xorg.wrap': Operation not permitted
make[6]: [Makefile:1158: install-exec-hook] Error 1 (ignored)
-rwxr-xr-x root/root 2453392 2018-05-23 22:41 usr/lib/Xorg
-rwxr-xr-x root/root 10152 2018-05-23 22:41 usr/lib/Xorg.wrap
Autotools also has a broken Xorg.warp :)
Edit:
https://src.fedoraproject.org/cgit/rpms/xorg-x11-server.git/tree/0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
[1] https://src.fedoraproject.org/rpms/xorg-x11-server/blob/3a9dd861fd2a9b9f2e38d8b7d995e1f45f6b074e/f/0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
Adjusted it to build the 1.20.0 tarball, tested the patches were no longer needed, removed some configure options that no longer exist etc.
Did my best to keep changes minimal and am now using it with success.
$ pacman -Qs xorg-server
local/xorg-server 1.20.0-5.2 (xorg)
Xorg X server
local/xorg-server-common 1.20.0-5.2 (xorg)
Xorg server common files
local/xorg-server-devel 1.20.0-5.2 (xorg)
Development files for the X.Org X server
$
/usr/bin/X , /usr/bin/Xorg , /usr/lib/xorg-server/Xorg & /usr/lib/xorg-server/Xorg.wrap are all as they should be.
PKGBUILD and other needed files are in the attached xorg-server-1.20.0-autotools.tar.bz2 .