Gentoo Archives: gentoo-user

From: Ian Zimmerman <itz@×××××××.net>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: X w/o suid root
Date: Mon, 19 Dec 2016 06:44:08
Message-Id: 20161219062842.9403.125F8924@matica.foolinux.mooo.com
In Reply to: [gentoo-user] Re: X w/o suid root by Ian Zimmerman
1 On 2016-12-17 21:35, Ian Zimmerman wrote:
2
3 > > > [ 2890.175] (++) using VT number 2
4 > > > [ 2890.175] (WW) xf86OpenConsole: VT_ACTIVATE failed: Operation not permitted
5 > > > [ 2890.175] (EE) xf86OpenConsole: Switching VT failed
6
7 I made some progress, but now I am blocked in an even tougher place :-(
8
9 The error above had a simple and amusing cause. My shell code that run
10 startx redirected both stdout and stderr to a logfile. And Xorg
11 inspects those file descriptors to guess what the current vt is, so that
12 when the _requested_ vt is the same, it can avoid the switch, which does
13 require root. So, when I left stdout and stderr going to the terminal
14 this part started working. [1]
15
16 But now I hit the error chronicled at [2]. A look at kernel source, in
17 drivers/gpu/drm/drm_ioctl.c, shows that the relevant kernel ioctl is
18 declared thus:
19
20 DRM_IOCTL_DEF(DRM_IOCTL_SET_MASTER, drm_setmaster_ioctl, DRM_ROOT_ONLY),
21
22 at least in the kernel version I run (4.4.26) which doesn't inspire much
23 hope :-(
24
25 All this really does seem to depend on the precise GPU model one has.
26
27 [1]
28 This trick by Xorg is completely undocumented! I really had to wallow
29 in the source code to discover it.
30
31 [2]
32 https://unix.stackexchange.com/questions/178883/running-x-without-root
33
34 --
35 Please *no* private Cc: on mailing lists and newsgroups
36 Personal signed mail: please _encrypt_ and sign
37 Don't clear-text sign: http://cr.yp.to/smtp/8bitmime.html

Replies

Subject Author
[gentoo-user] Re: X w/o suid root Ian Zimmerman <itz@×××××××.net>