dst = dst ? dst : optarg;
if (!mountAddMountPtTail
(nsjconf, /* src= */ optarg, dst, /* fs_type= */ "",
- /* options= */ "", MS_BIND | MS_REC | MS_RDONLY,
- /* isDir= */
+ /* options= */ "", MS_BIND | MS_REC | MS_RDONLY, /* isDir= */
NS_DIR_MAYBE, /* mandatory= */ true, NULL, NULL, NULL, 0,
/* is_symlink= */ false)) {
return false;
if (!mountAddMountPtTail
(nsjconf, /* src= */ optarg, dst, /* fs_type= */ "",
/* options= */ "", MS_BIND | MS_REC, /* isDir= */ NS_DIR_MAYBE,
- /* mandatory= */ true, NULL, NULL, NULL, 0,
- /* is_symlink= */
+ /* mandatory= */ true, NULL, NULL, NULL, 0, /* is_symlink= */
false)) {
return false;
}
return false;
}
} else {
- if (!mountAddMountPtHead(nsjconf, /* src= */ NULL, "/", "tmpfs", /* options= */ "",
- nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true,
- /* mandatory= */ true,
- NULL, NULL, NULL, 0, /* is_symlink= */ false)) {
+ if (!mountAddMountPtHead
+ (nsjconf, /* src= */ NULL, "/", "tmpfs", /* options= */ "",
+ nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true, /* mandatory= */ true,
+ NULL, NULL, NULL, 0, /* is_symlink= */ false)) {
return false;
}
}
PLOG_W("mount('%s') src:'%s' dst:'%s' failed", mountDescribeMountPt(mpt),
srcpath, dst);
}
+ } else {
+ mpt->mounted = true;
}
if (mpt->src_content && unlink(srcpath) == -1) {
static bool mountRemountRO(struct mounts_t *mpt)
{
+ if (!mpt->mounted) {
+ return true;
+ }
if (mpt->isSymlink == true) {
return true;
}
p->isDir = true;
p->isSymlink = is_symlink;
p->mandatory = mandatory;
+ p->mounted = false;
switch (isDir) {
case NS_DIR_YES: