sudo doesn't have /snap/bin in PATH
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd (Ubuntu) |
Won't Fix
|
High
|
Unassigned | ||
Trusty |
Won't Fix
|
Undecided
|
Unassigned | ||
Xenial |
Won't Fix
|
High
|
Unassigned | ||
sudo (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Trusty |
Fix Released
|
High
|
Unassigned | ||
Xenial |
Fix Released
|
High
|
Unassigned |
Bug Description
[ SRU Justification ]
Snap may contain sysadmin tools as well. They are currently hard to invoke
because /snap/bin is not in the PATH when sudo is used because the default
secure_path of sudoers does not have it.
[ SRU Test Case ]
1. sudo snap install hello-world
2. sudo hello-world
3. verify that this fails with "command not found"
4. install sudo from xenial-proposed
5. verify that sudo hello-world now works
[ Regression Potential ]
- may trigger conffile prompts on upgrade
[Original report]
$ nextcloud.occ
# prints output
$ sudo nextcloud.occ
sudo: nextcloud.occ: command not found
I need to do `sudo /snap/bin/
$ sudo env | grep PATH
PATH=/usr/
description: | updated |
Changed in snapd (Ubuntu): | |
status: | Confirmed → Triaged |
importance: | Undecided → High |
Changed in sudo (Ubuntu): | |
importance: | Undecided → High |
Changed in snapd (Ubuntu Xenial): | |
importance: | Undecided → High |
Changed in sudo (Ubuntu Xenial): | |
importance: | Undecided → High |
tags: |
added: verification-done removed: verification-needed |
Changed in sudo (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in snapd (Ubuntu Trusty): | |
status: | New → Won't Fix |
Changed in sudo (Ubuntu Trusty): | |
importance: | Undecided → High |
seems that sudo by default does neither carry over the existing env nor process a pam login ...
it works fine with "sudo -i"
ogra@styx:~$ sudo -i env|grep PATH local/sbin: /usr/local/ bin:/usr/ sbin:/usr/ bin:/sbin: /bin:/snap/ bin
PATH=/usr/
vs
ogra@styx:~$ sudo env|grep PATH local/sbin: /usr/local/ bin:/usr/ sbin:/usr/ bin:/sbin: /bin
PATH=/usr/