** Description changed: + 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/html/index.html + 2018/02/25 22:40:11.162682 cmd_run.go:562: WARNING: cannot create user data directory: cannot create "/var/www/snap/notepadqq/115": mkdir /var/www/snap: permission denied + cannot create user data directory: /var/www/snap/notepadqq/115: Read-only file system + + 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://askubuntu.com/q/1009698/66509 ). + + ---- + 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-vmware:~:0$ snap run --shell test-snap To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details. marco@ubuntu-vmware:/home/marco$ echo $XDG_RUNTIME_DIR /run/user/1000/snap.qt5-systray marco@ubuntu-vmware:/home/marco$ ls $XDG_RUNTIME_DIR ls: cannot access '/run/user/1000/snap.qt5-systray': No such file or directory
** Tags removed: artful ** Tags added: cosmic -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1656340 Title: XDG_RUNTIME_DIR is not created on app startup To manage notifications about this bug go to: https://bugs.launchpad.net/snappy/+bug/1656340/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs