Processed: Re: Bug#903988: xinit does not run as normal user but as root only
Processing control commands: > retitle 856351 xinit does not run as normal user but as root only Bug #856351 [xinit] parse_vt_settings: Cannot open /dev/tty0 (Permission denied) Changed Bug title to 'xinit does not run as normal user but as root only' from 'parse_vt_settings: Cannot open /dev/tty0 (Permission denied)'. > severity 856351 important Bug #856351 [xinit] xinit does not run as normal user but as root only Severity set to 'important' from 'normal' > merge 856351 903988 Bug #856351 [xinit] xinit does not run as normal user but as root only Bug #903988 [xinit] xinit does not run as normal user but as root only Merged 856351 903988 -- 856351: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856351 903988: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903988 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems
Bug#903988: xinit does not run as normal user but as root only
Control: retitle 856351 xinit does not run as normal user but as root only Control: severity 856351 important Control: merge 856351 903988 This bug really originates in the X server binary (/usr/lib/xorg/Xorg, in the xserver-xorg-core package), not in xinit, but that's not a public interface. xinit is the public interface through which the bug becomes visible. The problem arises where the X server attempts to select a virtual console on which the X display will manifest. In the usual case, the server opens /dev/tty0 in order to perform ioctls on it that are concerned with managing virtual consoles. /dev/tty0 is not itself a virtual console, but is part of that system: it accepts the same ioctls, and anything written to /dev/tty0 goes to whichever virtual console is active at the time of the write. It is not really sensible for ordinary user processes to have access to the writing aspect of /dev/tty0, and by default (via udev) its permissions prohibit access by ordinary users. This means that the X server's open of /dev/tty0 is pretty much guaranteed to fail when the server is invoked by an unprivileged user. The only way to prevent the X server from attempting to use /dev/tty0 is to explicitly tell it which virtual console to use. Via xinit this looks like "xinit -- :0 vt7", where "vt7" tells it to use /dev/tty7. However, even this isn't enough to avoid this class of permissions problem. When the X server attempts to use a virtual console, whether selected automatically via ioctls or specified on the command line, its first action is to open that virtual console device. If the virtual console was otherwise unused, which is what it tries to do by default, then at this point the virtual console device probably also has restrictive permissions that prevent it being opened by an unprivileged user. To avoid getting a permissions error on a virtual console, then, the user must select for the X display a virtual console that ey already owns, and must explicitly specify it on the xinit command line. Fortunately, in the common case where the X server is being invoked *from* a virtual console, which will not be otherwise needed until the X server terminates, it is possible for the X server to use that same virtual console. The startx wrapper for xinit does precisely this, which is why it doesn't exhibit the same problem. Those who use xinit directly should not be required to specify a virtual console. By default a suitable one should be selected and allocated automatically, in a way that doesn't require any special privileges of the invoking user. This allocation should include having the virtual console's ownership set to the invoking user, for the duration of its use by the X server. -zefram
Bug#903988: xinit does not run as normal user but as root only
Have you tried to reinstall the xinit and xinput packages? Regards Harri
Bug#903988: xinit does not run as normal user but as root only
Package: xinit Version: 1.3.4-3+b1 Severity: important Dear Maintainer, X.Org X Server 1.19.2 Release Date: 2017-03-02 X Protocol Version 11, Revision 0 Build Operating System: Linux 4.9.0-4-amd64 x86_64 Debian Current Operating System: Linux Vic-20 4.9.0-7-amd64 #1 SMP Debian 4.9.110-1 (2018-07-05) x86_64 Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.9.0-7-amd64 root=UUID=5c843ff0-cc6f-4549-aef4-cb6149c63e2f ro quiet Build Date: 16 October 2017 08:19:45AM xorg-server 2:1.19.2-1+deb9u2 (https://www.debian.org/support) Current version of pixman: 0.34.0 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/home/francesco/.local/share/xorg/Xorg.0.log", Time: Tue Jul 17 21:52:12 2018 (==) Using system config directory "/usr/share/X11/xorg.conf.d" (EE) Fatal server error: (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied) (EE) (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. (EE) Please also check the log file at "/home/francesco/.local/share/xorg/Xorg.0.log" for additional information. (EE) (EE) Server terminated with error (1). Closing log file. xinit: giving up xinit: unable to connect to X server: Connection refused xinit: server error -- System Information: Debian Release: 9.5 Architecture: amd64 (x86_64) Kernel: Linux 4.9.0-7-amd64 (SMP w/2 CPU cores) Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), LANGUAGE=it_IT.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages xinit depends on: ii coreutils 8.26-3 ii libc6 2.24-11+deb9u3 ii libc6-udeb [libc6] 2.19-18+deb8u6 ii libx11-62:1.6.4-3 ii x11-common 1:7.7+19 ii xauth 1:1.0.9-1+b2 Versions of packages xinit recommends: ii flwm [x-window-manager] 1.02+git2015.10.03+7dbb30-1 ii marco [x-window-manager] 1.16.1-1 ii mate-session-manager [x-session-manager] 1.16.1-1 ii mate-terminal [x-terminal-emulator] 1.16.3-1 ii xserver-xephyr [xserver] 2:1.19.2-1+deb9u2 ii xserver-xorg [xserver]1:7.7+19 ii xterm [x-terminal-emulator] 327-2 xinit suggests no packages. -- no debconf information