Re: [PATCH] smb: client: fix regression with guest option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Paulo, created a PR for cifs-utils based on your suggestion
https://github.com/smfrench/smb3-utils/pull/14

Thanks
Meetakshi

On Wed, Mar 12, 2025 at 9:53 PM Paulo Alcantara <pc@xxxxxxxxxxxxx> wrote:
>
> Steve French <smfrench@xxxxxxxxx> writes:
>
> > Meetakshi sent a patch idea to try (to also fix this in cifs-utils) -
> > will take a look
>
> Where is the patch?
>
> Something like below would work
>
> diff --git a/mount.cifs.c b/mount.cifs.c
> index 7605130..16730c6 100644
> --- a/mount.cifs.c
> +++ b/mount.cifs.c
> @@ -200,6 +200,7 @@ struct parsed_mount_info {
>         unsigned int got_domain:1;
>         unsigned int is_krb5:1;
>         unsigned int is_noauth:1;
> +       unsigned int is_guest:1;
>         uid_t sudo_uid;
>  };
>
> @@ -1161,6 +1162,7 @@ parse_options(const char *data, struct parsed_mount_info *parsed_info)
>                         parsed_info->got_user = 1;
>                         parsed_info->got_password = 1;
>                         parsed_info->got_password2 = 1;
> +                       parsed_info->is_guest = 1;
>                         goto nocopy;
>                 case OPT_RO:
>                         *filesys_flags |= MS_RDONLY;
> @@ -2334,7 +2336,9 @@ mount_retry:
>                 fprintf(stderr, "%s kernel mount options: %s",
>                         thisprogram, options);
>
> -       if (parsed_info->got_password && !(parsed_info->is_krb5 || parsed_info->is_noauth)) {
> +       if (parsed_info->got_password &&
> +           !(parsed_info->is_krb5 || parsed_info->is_noauth ||
> +             parsed_info->is_guest)) {
>                 /*
>                  * Commas have to be doubled, or else they will
>                  * look like the parameter separator
> @@ -2345,7 +2349,9 @@ mount_retry:
>                         fprintf(stderr, ",pass=********");
>         }
>
> -       if (parsed_info->got_password2 && !(parsed_info->is_krb5 || parsed_info->is_noauth)) {
> +       if (parsed_info->got_password2 &&
> +           !(parsed_info->is_krb5 || parsed_info->is_noauth ||
> +             parsed_info->is_guest)) {
>                 strlcat(options, ",password2=", options_size);
>                 strlcat(options, parsed_info->password2, options_size);
>                 if (parsed_info->verboseflag)





[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux