X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fsecure-mount.c;h=57fe87424f61171ac6786c9f509736b17cc7b80e;hb=75eb565fbeb4e8781bed33ad98056c49873c430f;hp=a76f7a074ea0d9d1c011aa521ae1ede352995476;hpb=65ee8e8556e0c293b039fcea0cdcde40cf412483;p=util-vserver.git diff --git a/src/secure-mount.c b/src/secure-mount.c index a76f7a0..57fe874 100644 --- a/src/secure-mount.c +++ b/src/secure-mount.c @@ -153,6 +153,11 @@ static struct FstabOption { { "noauto", 0, 0, XFLAG_NOAUTO, false }, { "user", 0, 0, 0, false }, { "nouser", 0, 0, 0, false }, + { "rec", MS_REC, MS_REC, 0, false }, + { "unbindable", MS_UNBINDABLE, MS_UNBINDABLE, 0, false }, + { "private", MS_PRIVATE, MS_PRIVATE, 0, false }, + { "slave", MS_SLAVE, MS_SLAVE, 0, false }, + { "shared", MS_SHARED, MS_SHARED, 0, false }, }; int wrapper_exit_code = 1; @@ -436,6 +441,20 @@ mountSingle(struct MountInfo const *mnt, struct Options const *opt) perror("secure-mount: mount()"); return false; } + if ((mnt->flag & MS_BIND) && + (mnt->flag & ~(MS_BIND|MS_REC))) { + /* This is needed to put us in the new mountpoint */ + if (!secureChdir(mnt->dst, opt)) + return false; + if (mount(mnt->src, ".", + mnt->type ? mnt->type : "", + ((mnt->flag & ~(MS_BIND|MS_REC)) | + MS_REMOUNT), NULL) == -1 && + errno != EBUSY) { /* Returned on older kernels */ + perror("secure-mount: mount()"); + return false; + } + } } else if (!callExternalMount(mnt)) return false;