smb: client: fix null auth
authorScott Mayhew <smayhew@redhat.com>
Wed, 16 Aug 2023 05:23:56 +0000 (00:23 -0500)
committerSteve French <stfrench@microsoft.com>
Wed, 16 Aug 2023 05:26:07 +0000 (00:26 -0500)
commit270d73e6507f9c7fff43844d74f86365df000b36
treeeceac3f5b6b14c7bc2412455cc4e2a747c7e0310
parent2d7b8c6b90e4054a35eb59cd6d7c66e903e8ae4b
smb: client: fix null auth

Commit abdb1742a312 removed code that clears ctx->username when sec=none, so attempting
to mount with '-o sec=none' now fails with -EACCES.  Fix it by adding that logic to the
parsing of the 'sec' option, as well as checking if the mount is using null auth before
setting the username when parsing the 'user' option.

Fixes: abdb1742a312 ("cifs: get rid of mount options string parsing")
Cc: stable@vger.kernel.org
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/fs_context.c