]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Fix number parsing in cifs_parse_mount_options
authorSachin Prabhu <sprabhu@redhat.com>
Fri, 13 Apr 2012 13:04:32 +0000 (14:04 +0100)
committerSteve French <sfrench@us.ibm.com>
Fri, 13 Apr 2012 15:03:29 +0000 (10:03 -0500)
The function kstrtoul() used to parse number strings in the mount
option parser is set to expect a base 10 number . This treats the octal
numbers passed for mount options such as file_mode as base10 numbers
leading to incorrect behavior.

Change the 'base' argument passed to kstrtoul from 10 to 0 to
allow it to auto-detect the base of the number passed.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Acked-by: Jeff Layton <jlayton@samba.org>
Reported-by: Chris Clayton <chris2553@googlemail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/connect.c

index 6a86f3d681822a37fa83d456e066c788f1e4c9c9..f31dc9ac37b76f0014fe5584c88d35d836bb1659 100644 (file)
@@ -1123,7 +1123,7 @@ static int get_option_ul(substring_t args[], unsigned long *option)
        string = match_strdup(args);
        if (string == NULL)
                return -ENOMEM;
-       rc = kstrtoul(string, 10, option);
+       rc = kstrtoul(string, 0, option);
        kfree(string);
 
        return rc;