/proc/mounts is apparently writeable.
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Wed, 2 Dec 2009 11:13:49 +0000 (11:13 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Wed, 2 Dec 2009 11:13:49 +0000 (11:13 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2869 94cd875c-1c1d-0410-91d2-eb244daf1a30

scripts/vserver.functions

index 2e8897e..626cd07 100644 (file)
@@ -918,6 +918,10 @@ function _mountVserverInternal
     # magic regarding the mtab file; when etc/mtab can not be touched,
     # add the '-n' flag to mount
     test -w etc -o -w etc/mtab || xflag=-n
+    if test -h etc/mtab; then
+       local l=$($_READLINK etc/mtab)
+       test "${l##/proc/}" = "$l" || xflag=-n
+    fi
     "$@" $_SECURE_MOUNT -a $xflag --chroot --fstab "$fstab" --rootfs no
     popd >/dev/null
 }