← Back to issue list

snap may execute host, not wrapped, executables

View original Launchpad issue

Metadata

Project
snapcraft
Number
#1681152
Type
issue
State
open
Author
~cgull
Labels
Created
2017-04-08 22:55:00.500964+00:00
Updated
2017-04-08 22:55:00.500964+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

In working on mosh for Snapcraft, I discovered that when you invoke wrapped executables in /snap/bin, the host's executable may be run instead. I suspect this is a classic-only bug. Repro: apt install mosh # this will install a release version of mosh, such as mosh-1.3.0 git clone -b snapcraft https://github.com/elopio/mosh cd mosh snapcraft sudo snap install mosh_master_amd64.snap --classic --dangerous # this installs a devel version such as mosh-1.3.0-11-g42a7a0c-dirty sudo snap alias mosh mosh sudo snap alias mosh mosh-client sudo snap alias mosh mosh-server /snap/bin/mosh --version # perl script reports mosh-1.3.0 /snap/bin/mosh-client --version # executable reports mosh-1.3.0 It appears that snap is not using an absolute path to run the wrapped executable. This is related to Bug #1670388 and Bug #1670749 but I think it's a distinct issue. One workaround is to set environment.PATH in snapcraft.yaml to $SNAP/bin:$PATH, but I do expect a wrapper to execute the correct executable, and setting PATH may cause problems.

Evaluation history

No evaluation history available.