summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/mount.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/mount.cc')
-rw-r--r--winsup/cygwin/mount.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 93c0d24dc..da0e744de 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -1050,8 +1050,6 @@ mount_info::from_fstab_line (char *line, bool user)
mount_flags |= MOUNT_NOPOSIX;
if (!fstab_read_flags (&c, mount_flags, false))
return true;
- if (user)
- mount_flags &= ~MOUNT_SYSTEM;
if (mount_flags & MOUNT_BIND)
{
/* Prepend root path to bound path. */
@@ -1066,6 +1064,8 @@ mount_info::from_fstab_line (char *line, bool user)
mount_flags = (MOUNT_BIND | flags)
& ~(MOUNT_IMMUTABLE | MOUNT_AUTOMATIC);
}
+ if (user)
+ mount_flags &= ~MOUNT_SYSTEM;
if (!strcmp (fs_type, "cygdrive"))
{
cygdrive_flags = mount_flags | MOUNT_CYGDRIVE;
@@ -1710,6 +1710,8 @@ mount (const char *win32_path, const char *posix_path, unsigned flags)
flags = (MOUNT_BIND | conv_flags)
& ~(MOUNT_IMMUTABLE | MOUNT_AUTOMATIC);
}
+ /* Make sure all mounts are user mounts, even those added via mount -a. */
+ flags &= ~MOUNT_SYSTEM;
res = mount_table->add_item (w32_path, posix_path, flags);
}