struct mounts_t *p = utilMalloc(sizeof(struct mounts_t));
p->src = optarg;
p->dst = cmdlineSplitStrByColon(optarg);
- p->flags = MS_BIND | MS_REC | MS_PRIVATE | MS_RDONLY;
+ p->flags = MS_BIND | MS_REC | MS_RDONLY;
p->options = "";
p->fs_type = "";
TAILQ_INSERT_TAIL(&nsjconf->mountpts, p, pointers);
struct mounts_t *p = utilMalloc(sizeof(struct mounts_t));
p->src = optarg;
p->dst = cmdlineSplitStrByColon(optarg);
- p->flags = MS_BIND | MS_REC | MS_PRIVATE;
+ p->flags = MS_BIND | MS_REC;
p->options = "";
p->fs_type = "";
TAILQ_INSERT_TAIL(&nsjconf->mountpts, p, pointers);
struct mounts_t *p = utilMalloc(sizeof(struct mounts_t));
p->src = nsjconf->chroot;
p->dst = "/";
- p->flags = MS_BIND | MS_REC | MS_PRIVATE;
+ p->flags = MS_BIND | MS_REC;
p->options = "";
p->fs_type = "";
if (nsjconf->is_root_rw == false) {
#include <sys/prctl.h>
#include <sys/resource.h>
#include <sys/stat.h>
+#include <sys/statvfs.h>
#include <sys/syscall.h>
#include <sys/time.h>
#include <unistd.h>
static bool containRemountRO(struct mounts_t *mpt)
{
+ struct statvfs vfs;
+ if (statvfs(mpt->dst, &vfs) == -1) {
+ PLOG_E("statvfs('%s')", mpt->dst);
+ return false;
+ }
+
if (mpt->flags &= MS_RDONLY) {
LOG_D("Re-mounting RO '%s'", mpt->dst);
if (mount
(mpt->dst, mpt->dst, NULL,
- MS_REC | MS_BIND | MS_PRIVATE | MS_REMOUNT | MS_RDONLY, 0) == -1) {
+ MS_BIND | MS_REMOUNT | MS_RDONLY | vfs.f_flag, 0) == -1) {
PLOG_E("mount('%s', MS_REC|MS_BIND|MS_REMOUNT|MS_RDONLY)", mpt->dst);
return false;
}