Skip to content

Commit

Permalink
cmd/snap: rework relocation logic for the right path to snap-confine
Browse files Browse the repository at this point in the history
  • Loading branch information
morphis committed Apr 27, 2017
1 parent 24ff7c7 commit 8c30864
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmd/snap/cmd_run.go
Expand Up @@ -366,11 +366,7 @@ func migrateXauthority(info *snap.Info) (string, error) {
}

func runSnapConfine(info *snap.Info, securityTag, snapApp, command, hook string, args []string) error {
libExecDir := dirs.DistroLibExecDir
if isReexeced() {
libExecDir = dirs.CoreLibExecDir
}
snapConfine := filepath.Join(libExecDir, "snap-confine")
snapConfine := filepath.Join(dirs.DistroLibExecDir, "snap-confine")
if !osutil.FileExists(snapConfine) {
if hook != "" {
logger.Noticef("WARNING: skipping running hook %q of snap %q: missing snap-confine", hook, info.Name())
Expand Down Expand Up @@ -413,7 +409,7 @@ func runSnapConfine(info *snap.Info, securityTag, snapApp, command, hook string,
// run snap-confine from the core snap. that will work because
// snap-confine on the core snap is mostly statically linked
// (except libudev and libc)
cmd[0] = filepath.Join(dirs.SnapMountDir, "core/current", cmd[0])
cmd[0] = filepath.Join(dirs.SnapMountDir, "core/current", dirs.CoreLibExecDir, "snap-confine")
}

extraEnv := make(map[string]string)
Expand Down

0 comments on commit 8c30864

Please sign in to comment.