On 02/08/2019 01:19, DJ Lucas via blfs-dev wrote:
> 
> 
> On 8/1/2019 10:49 AM, Pierre Labastie via blfs-dev wrote:
>> OK, I've found the error!!!!
>> On the Xinit page, we have:
>> ---
>> sed -e '/$serverargs $vtarg/ s/serverargs/: #&/' \
>>      -i startx.cpp
>> ---
>> for the Sysv/elogind book, while we do not have this for the systemd book.
>>
>> Removing the ": #" allows startx to run the server and the usual clients.
>>
>> I think even the suid-wrapper is not needed! (it drops privilege anyway if
>> /dev/dri/card0 is KMS compatible). This can be tested by moving
>> /usr/libexec/Xorg.wrap to /usr/libexec/Xorg.wrap.nouse, and trying again:
>> startx still works.
>>
>> So we can:
>> remove the sed on the Xinit page
>> remove any enable-xxx-suid switch for xorg-server (well, maybe some drivers 
>> do
>> need the wrapper, this has to be tested, but I do not have the hardware 
>> (intel
>> driver works fine without the wrapper)).
>>
>> Pierre
>> PS: I've spend almost 24 h running the server, xinit, with gdb, playing with
>> xauth files, etc, before finding this stupid bug!
> 
> Must be old hardware for me then. I still work with the sed, but if removing
> it fixes for everyone else, then excellet! From two working builds:
> 
> if [ "$have_vtarg" = "no" ]; then
>     : #serverargs="$serverargs $vtarg"
> fi
> 
> Looking at it further, it probably always worked with libsystemd aware dm
> (that if never would have evaluated to true unless started from the command
> line).

dm's have elevated privileges, so no probs for starting xorg (I do not think
it has anything to do with libsystemd). The fact is that, if running as an
unprivileged user, systemd/elogind only grants you write access to the vt you
are logged in. So _this_ vt must be used by xorg-server, and must be specified
on the command line to xinit: the default behavior of xorg-server is to start
on the first unused vt if none is specified on the command line.

Note that this only occurs when starting X from the command line as a regular
user.

Regarding the hardware, what is tested in xorg-wrapper.c is whether you can
call ioctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res) with fd a file descriptor
pointing to /dev/dri/card0. If this is possible, root privileges are dropped,
and Xorg is run as a regular user. I'll try to see if I can find information
about this ioctl

> 
> Still slightly confused, but happier. :-)
> 

Well, my investigations cannot tell what you have done :-)

Pierre
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to