}
static bool
+canHandleInternal(struct MountInfo const *mnt)
+{
+ static char const * FS[] = {
+ "tmpfs", "sysfs", "proc", "sockfs", "pipefs", "futexfs",
+ "inotifyfs", "devpts", "ext3", "ext2", "ramfs",
+ "hugetlbfs", "usbfs", "binfmt_misc",
+ 0
+ };
+ char const ** i;
+
+ if (mnt!=0) return false;
+ else if ((mnt->flag & (MS_BIND|MS_MOVE))!=0) return true;
+ else if (mnt->type==0) return false;
+
+ for (i=FS+0; *i!=0; ++i)
+ if (strcmp(mnt->type, *i)==0) return true;
+
+ return false;
+}
+
+static bool
mountSingle(struct MountInfo const *mnt, struct Options const *opt)
{
assert(mnt->dst!=0);
if (!secureChdir(mnt->dst, opt))
return false;
- if (mnt->flag & (MS_BIND|MS_MOVE)) {
+ if (canHandleInternal(mnt)) {
unsigned long flag = mnt->flag;
- if ((flag & MS_NODEV)==0) flag |= MS_NODEV;
+ if ((flag & MS_NODEV)!=0) flag |= MS_NODEV;
if (mount(mnt->src, ".",
mnt->type ? mnt->type : "",
if (strcmp(info->type, "swap") ==0) return prIGNORE;
else if (strcmp(info->type, "none") ==0) info->type = 0;
- else if (strcmp(info->type, "devpts")==0) info->mask |= MS_NODEV;
+ else if (strcmp(info->type, "devpts")==0) {
+ info->mask |= MS_NODEV;
+ info->flag &= ~MS_NODEV;
+ }
if (col) *col = err_col;
if (!transformOptionList(info,col)) return prFAIL;