Unable to launch program (installed as snap) as root
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
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:/
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: snapd 2.29.4.2 [modified: usr/share/
ProcVersionSign
Uname: Linux 4.4.0-116-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.15
Architecture: amd64
CurrentDesktop: MATE
Date: Sun Feb 25 22:10:49 2018
InstallationDate: Installed on 2018-01-04 (52 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
SourcePackage: snapd
UpgradeStatus: No upgrade log present (probably fresh install)
Hmm, we have a rule that should allow this:
# for creating the user XDG_RUNTIME_DIR: /run/user, /run/user/UID and UID/<name> user/{, [0-9]*/ ,[0-9]* /*/} rw,
# /run/user/
/run/
But then again, maybe sudo is messing some of that up?