From: Chris Clayton <chris2553-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
To: Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Linux CIFS mailing list
<linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org,
smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH] Fix number parsing in cifs_parse_mount_options
Date: Fri, 13 Apr 2012 22:47:02 +0100 [thread overview]
Message-ID: <4F889ED6.3040700@googlemail.com> (raw)
In-Reply-To: <1334322272.2308.1.camel@localhost>
On 04/13/12 14:04, Sachin Prabhu wrote:
> 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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Reported-by: Chris Clayton<chris2553-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
>
> ---
> fs/cifs/connect.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 6a86f3d..f31dc9a 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -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;
Yes, that's fixed it. Thanks again, Sachin.
Tested-by: Chris Clayton <chris2553-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
prev parent reply other threads:[~2012-04-13 21:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 6:12 3.4.0-rc2+: CIFS - strange file modes Chris Clayton
[not found] ` <201204130712.51693.chris2553-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2012-04-13 13:04 ` [PATCH] Fix number parsing in cifs_parse_mount_options Sachin Prabhu
2012-04-13 13:17 ` Jeff Layton
[not found] ` <20120413091753.60dccc93-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2012-04-13 15:03 ` Steve French
2012-04-13 21:47 ` Chris Clayton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F889ED6.3040700@googlemail.com \
--to=chris2553-gm/ye1e23mwn+bqq9rbeug@public.gmane.org \
--cc=jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox