Root and Wayland

Martin Měřinský mermar at centrum.cz
Tue Oct 31 03:31:20 PDT 2017


Hello.
These days more and more distributions are using Wayland. Last Ubuntu
e.g. AFAIK Wayland design feature is that UI applications are not
allowed to run as root.

>From Subsurface manual: "If you are not root, you may not be a member
of that group and won’t be able to use the USB port." Well, if you are
root, you cannot run Subsurface under Wayland at all(?) Fortunately
it's not necessary, but output doesn't look good.

/usr/bin/subsurface --version
Subsurface v4.7.1, built with libdivecomputer v0.6.0-devel-Subsurface-
branch (0099aeeb7088c7ff3c4513f100b1cb5516f48233)

sudo /usr/bin/subsurface
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-
root'
No protocol specified
QXcbConnection: Could not connect to display :0
Aborted

sudo /usr/bin/subsurface --allow_run_as_root
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-
root'
No protocol specified
QXcbConnection: Could not connect to display :0
Aborted

xhost +si:localuser:root
sudo /usr/bin/subsurface
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-
root'
You are running Subsurface as root. This is not recommended.
If you insist to do so, run with option --allow_run_as_root.

xhost +si:localuser:root
sudo /usr/bin/subsurface --allow_run_as_root
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-
root'
Runs OK.

I would humbly suggest to detect Wayland and root privileges, show
better command line message and quit.
Or fix it somehow like GParted 0.30.0 did?
Maybe we should mention it in the manual.

Also --allow_run_as_root option is not mentioned in subsurface --help
output nor in the manual.

Thanks in advace
Martin M.


More information about the subsurface mailing list