chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-daemon: add reference implementation of various daemon apis
[elogind.git]
/
namespace.c
diff --git
a/namespace.c
b/namespace.c
index 570b4ce387df6f84ad9c11b7a38b79f7c7fac291..09bcaff9684845ee121544f3ebd7151a503100e5 100644
(file)
--- a/
namespace.c
+++ b/
namespace.c
@@
-29,6
+29,7
@@
#include <sched.h>
#include <sys/syscall.h>
#include <limits.h>
#include <sched.h>
#include <sys/syscall.h>
#include <limits.h>
+#include <linux/fs.h>
#include "strv.h"
#include "util.h"
#include "strv.h"
#include "util.h"
@@
-123,7
+124,6
@@
static int apply_mount(Path *p, const char *root_dir, const char *inaccessible_d
const char *what;
char *where;
int r;
const char *what;
char *where;
int r;
- bool read_only = false;
assert(p);
assert(root_dir);
assert(p);
assert(root_dir);
@@
-137,11
+137,11
@@
static int apply_mount(Path *p, const char *root_dir, const char *inaccessible_d
case INACCESSIBLE:
what = inaccessible_dir;
case INACCESSIBLE:
what = inaccessible_dir;
-
read_only = true
;
+
flags |= MS_RDONLY
;
break;
case READONLY:
break;
case READONLY:
-
read_only = true
;
+
flags |= MS_RDONLY
;
/* Fall through */
case READWRITE:
/* Fall through */
case READWRITE:
@@
-160,14
+160,11
@@
static int apply_mount(Path *p, const char *root_dir, const char *inaccessible_d
* flags. If we want to set any flag we need
* to do so in a second indepdant step. */
if (flags)
* flags. If we want to set any flag we need
* to do so in a second indepdant step. */
if (flags)
- r = mount(NULL, where, NULL, MS_REMOUNT|MS_REC|flags, NULL);
+ r = mount(NULL, where, NULL, MS_REMOUNT|MS_
BIND|MS_
REC|flags, NULL);
/* Avoid expontial growth of trees */
if (r >= 0 && path_equal(p->path, "/"))
/* Avoid expontial growth of trees */
if (r >= 0 && path_equal(p->path, "/"))
- r = mount(NULL, where, NULL, MS_REMOUNT|MS_UNBINDABLE, NULL);
-
- if (r >= 0 && read_only)
- r = mount(NULL, where, NULL, MS_REMOUNT|MS_RDONLY, NULL);
+ r = mount(NULL, where, NULL, MS_REMOUNT|MS_BIND|MS_UNBINDABLE|flags, NULL);
if (r < 0) {
r = -errno;
if (r < 0) {
r = -errno;