smb: client: fix null auth
authorSteve French <stfrench@microsoft.com>
Thu, 17 Aug 2023 04:25:29 +0000 (23:25 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 17 Aug 2023 04:25:29 +0000 (23:25 -0500)
commitda531277a9a02ed050bdcce92939d08931db3248
tree7875ad5350a7c2ef9628a43074f142b6c3e587ec
parent0cd9765b1226d11ca003f1f2ad3105a0f344cd40
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/cifs/fs_context.c