chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f47fc35
)
nspawn: inherit mounts from real root, don't propagate mounts to real root
author
Lennart Poettering
<lennart@poettering.net>
Mon, 13 Aug 2012 13:23:10 +0000
(15:23 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 13 Aug 2012 13:23:10 +0000
(15:23 +0200)
src/nspawn/nspawn.c
patch
|
blob
|
history
diff --git
a/src/nspawn/nspawn.c
b/src/nspawn/nspawn.c
index b9fa02dc7680a6486adefb6c6a05433b4c94d560..df858a57e6bc90b3930ea7fe2188d9834a77bf44 100644
(file)
--- a/
src/nspawn/nspawn.c
+++ b/
src/nspawn/nspawn.c
@@
-1178,9
+1178,11
@@
int main(int argc, char *argv[]) {
goto child_fail;
}
goto child_fail;
}
- /* Mark / as private, in case somebody marked it shared */
- if (mount(NULL, "/", NULL, MS_PRIVATE|MS_REC, NULL) < 0) {
- log_error("MS_PRIVATE|MS_REC failed: %m");
+ /* Mark everything as slave, so that we still
+ * receive mounts from the real root, but don't
+ * propagate mounts to the real root. */
+ if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL) < 0) {
+ log_error("MS_SLAVE|MS_REC failed: %m");
goto child_fail;
}
goto child_fail;
}
@@
-1224,8
+1226,8
@@
int main(int argc, char *argv[]) {
goto child_fail;
}
goto child_fail;
}
- if (mount(arg_directory, "/",
"bind"
, MS_MOVE, NULL) < 0) {
- log_error("mount(MS_
BIND
) failed: %m");
+ if (mount(arg_directory, "/",
NULL
, MS_MOVE, NULL) < 0) {
+ log_error("mount(MS_
MOVE
) failed: %m");
goto child_fail;
}
goto child_fail;
}