cmd/snap-confine: use SNAP_MOUNT_DIR to setup /snap inside the confinement env #3344

Merged
merged 1 commit into from May 18, 2017

Conversation

Projects
None yet
5 participants
Contributor

morphis commented May 17, 2017

No description provided.

cmd/snap-confine/mount-support.c
- && !is_mounted_with_shared_option("/snap")) {
- sc_do_mount("/snap", "/snap", "none", MS_BIND | MS_REC, 0);
+ && !is_mounted_with_shared_option(SNAP_MOUNT_DIR)) {
+ sc_do_mount(SNAP_MOUNT_DIR, "/snap", "none", MS_BIND | MS_REC,
@zyga

zyga May 17, 2017

Contributor

As discussed on IRC this needs to say SNAP_MOUNT_DIR instead of "/snap" in the second argument. If you can please push this with a more comprehensive commit message as well.

zyga requested changes May 17, 2017 edited

Just one trivial

cmd/snap-confine/mount-support.c
- sc_do_mount("/snap", "/snap", "none", MS_BIND | MS_REC, 0);
+ && !is_mounted_with_shared_option(SNAP_MOUNT_DIR)) {
+ sc_do_mount(SNAP_MOUNT_DIR, SNAP_MOUNT_DIR, "none",
+ MS_BIND | MS_REC, 0);
sc_do_mount("none", "/snap", NULL, MS_SHARED | MS_REC, NULL);
@zyga

zyga May 17, 2017

Contributor

Here /snap needs to be the same as above, namely SNAP_MOUNT_DIR

zyga approved these changes May 17, 2017

LGTM

cmd/snap-confine: use SNAP_MOUNT_DIR to setup /snap inside the confin…
…ement env

We have to use the right directory when we setup the /snap directory
inside the snap execution environment which differs on different
distributions.

Codecov Report

Merging #3344 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3344      +/-   ##
=========================================
+ Coverage   77.59%   77.6%   +0.01%     
=========================================
  Files         364     364              
  Lines       24956   24956              
=========================================
+ Hits        19364   19368       +4     
+ Misses       3868    3865       -3     
+ Partials     1724    1723       -1
Impacted Files Coverage Δ
overlord/snapstate/snapstate.go 82.03% <0%> (+0.24%) ⬆️
interfaces/sorting.go 96.66% <0%> (+6.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dda3e69...198cb7d. Read the comment docs.

@mvo5 mvo5 merged commit 4ffd8ab into snapcore:master May 18, 2017

6 of 7 checks passed

xenial-i386 autopkgtest finished (failure)
Details
artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment