XDG_RUNTIME_DIR is not created on app startup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Triaged
|
Undecided
|
Zygmunt Krynicki | ||
snapd (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Steps to reproduce:
1. Install Ubuntu 16.04 LTS
2. Install test application as Notepadqq - `snap install notepadqq`
3. Try to launch it as root
$ which notepadqq
/snap/bin/notepadqq
$ sudo snap run notepadqq
mkdir: cannot create directory '/run/user/0': Permission denied
No protocol specified
QXcbConnection: Could not connect to display :0.0
Aborted (core dumped)
$ pkexec snap run notepadqq
mkdir: cannot create directory '/run/user/0': Permission denied
QXcbConnection: Could not connect to display
Aborted (core dumped)
$ sudo notepadqq
mkdir: cannot create directory '/run/user/0': Permission denied
No protocol specified
QXcbConnection: Could not connect to display :0.0
Aborted (core dumped)
$ gksudo notepadqq
No protocol specified
QXcbConnection: Could not connect to display :0.0
$ sudo -u www-data notepadqq /var/www/
2018/02/25 22:40:11.162682 cmd_run.go:562: WARNING: cannot create user data directory: cannot create "/var/www/
cannot create user data directory: /var/www/
Expected results:
user is able to run snap-installed program as root
Expected results:
user is unable to run snap-installed program as root
Note:
first seen on AskUbuntu ( https:/
----
XDG_RUNTIME_DIR is now properly set, but... The dir isn't created by default.
This should be done on launch.
Apps that have this environment variable set, expects the path to be there (as normally it is in a location that the user can't edit /run/user)...
marco@ubuntu-
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
marco@ubuntu-
/run/user/
marco@ubuntu-
ls: cannot access '/run/user/
affects: | snap-confine → snapd |
Changed in snapd: | |
status: | New → Confirmed |
Changed in snapd: | |
assignee: | nobody → Zygmunt Krynicki (zyga) |
affects: | snapd → snappy |
tags: | added: snapd-interface |
Changed in snappy: | |
status: | Confirmed → Triaged |
tags: | added: eco-team |
tags: | removed: snapd-interface |
tags: | added: artful bionic xenial |
description: | updated |
tags: |
added: cosmic removed: artful |
tags: | removed: cosmic |
affects: | snappy → snapd |
This bug should definitely be fixed, but note that snaps are allowed to create /run/user/ 1000/snap. $SNAP_NAME by this rule:
owner /{dev,run} /user/[ 0-9]*/snap. @{SNAP_ NAME}/ rw,
As a workaround for your snap, feel free to (do the equivalent of):
mkdir /run/user/`id -u`/snap. "$SNAP_ NAME" || true