mount.cifs: don't pass text ro/rw options to kernel
authorJeff Layton <jlayton@samba.org>
Mon, 29 Jun 2009 10:16:38 +0000 (06:16 -0400)
committerJeff Layton <jlayton@redhat.com>
Mon, 29 Jun 2009 10:16:38 +0000 (06:16 -0400)
/bin/mount strips off the ro/rw options after setting the MS_RDONLY
flag appropriately. Make mount.cifs do the same thing.

Signed-off-by: Jeff Layton <jlayton@samba.org>
client/mount.cifs.c

index db05665f96cc02607aa6cdf2208db5712d7e26e4..4387f5945a916d4d6b9216538c45c6015e49f35a 100644 (file)
@@ -771,8 +771,10 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                        got_password = 1;
                } else if (strncmp(data, "ro", 2) == 0) {
                        *filesys_flags |= MS_RDONLY;
+                       goto nocopy;
                } else if (strncmp(data, "rw", 2) == 0) {
                        *filesys_flags &= ~MS_RDONLY;
+                       goto nocopy;
                 } else if (strncmp(data, "remount", 7) == 0) {
                         *filesys_flags |= MS_REMOUNT;
                } /* else if (strnicmp(data, "port", 4) == 0) {