cifs: handle "guest" mount parameter
authorSteve French <stfrench@microsoft.com>
Wed, 16 Dec 2020 22:26:35 +0000 (16:26 -0600)
committerSteve French <stfrench@microsoft.com>
Wed, 16 Dec 2020 23:02:34 +0000 (17:02 -0600)
With the new mount API it can not handle empty strings for
mount parms ("guest" is mapped in userspace mount helper to
"user=") so we have to special case it as we do for the
password mount parm.

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
fs/cifs/fs_context.c

index 29b99e6..734b30d 100644 (file)
@@ -733,6 +733,9 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
                if (!strcmp("pass", param->key) || !strcmp("password", param->key)) {
                        skip_parsing = true;
                        opt = Opt_pass;
+               } else if (!strcmp("user", param->key) || !strcmp("username", param->key)) {
+                       skip_parsing = true;
+                       opt = Opt_user;
                }
        }
 
@@ -1250,6 +1253,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
                ctx->rdma = true;
                break;
        }
+       /* case Opt_ignore: - is ignored as expected ... */
 
        return 0;