From: Daniel Hokka Zakrisson Date: Sun, 28 Jan 2007 11:35:19 +0000 (+0000) Subject: When we call the external mount, we need to preserve all of the options so it can... X-Git-Tag: release-0.30.214~125 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a3702c1e9d56814fd40646745cdecbd3062fe23;p=util-vserver.git When we call the external mount, we need to preserve all of the options so it can parse them on its own. The option defaults should set nodev in the flags. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2480 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/src/secure-mount.c b/src/secure-mount.c index 87cc596..a722f1f 100644 --- a/src/secure-mount.c +++ b/src/secure-mount.c @@ -70,6 +70,7 @@ struct MountInfo { unsigned long xflag; unsigned long mask; char * data; + char * data_parsed; }; struct Options { @@ -121,7 +122,7 @@ static struct FstabOption { unsigned long const xflag; bool const is_dflt; } const FSTAB_OPTIONS[] = { - { "defaults", 0, (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC| + { "defaults", MS_NODEV, (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC| MS_SYNCHRONOUS), 0, false }, { "rbind", MS_BIND|MS_REC, MS_BIND|MS_REC, 0, false }, { "bind", MS_BIND, MS_BIND, 0, false }, @@ -431,7 +432,7 @@ mountSingle(struct MountInfo const *mnt, struct Options const *opt) if (canHandleInternal(mnt)) { if (mount(mnt->src, ".", mnt->type ? mnt->type : "", - mnt->flag, mnt->data)==-1) { + mnt->flag, mnt->data_parsed)==-1) { perror("secure-mount: mount()"); return false; } @@ -493,7 +494,7 @@ transformOptionList(struct MountInfo *info, size_t UNUSED *col) } while (*ptr!='\0'); - info->data = data; + info->data_parsed = data; return true; }