small SMB mount option fix, also for stable

-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmTfk2wACgkQiiy9cAdy
 T1GisAwAobMfIbWSP3lC2TXiAjEf/4ss145H0VjqPDtIm9T1DxdVDT1YgiOi3b6r
 T5xl6CaVvamMbG8ZDtWDqMWA6z/7ZTTq6OIbZGBXNCaZvJTS1k32HG13IDrpLtD1
 TyjXyyXi3OA6MGIiIZttA8ziJu7Osmc3OBuwoPf8eKcQilF1TiTM+rHksS1WThCB
 2K+OYlOe6Fiihprqh6W3zbQl9h3+oPMHhEjEKBgiCPLDFtFpwhoUqOx6cFGNbMTn
 38/hEiSG/K8kBSBgePVN1zxtTi7qPaazjTVkCKB3PjAtl0QhW6RWg3Ige5Mjg1Sk
 0MLIhpcw9XqYsEIFc5yHwyCi2AxbzZ1XSnfgfJr0Jd+phW6yFoJCHojgfagGs1ez
 YldsPYFiSJDC+ugJUMd2KemEebO9y4qfI8Ocde2f7GJijOhQhFw5bunc5g5EtZAy
 tj3w0l1pmXgVsePjWurO3VvSm1/trNShOg7h0oHIVTEtHVcXAFQED1xxTdC6aQSC
 htPunLUN
 =wyXy
 -----END PGP SIGNATURE-----

Merge tag '6.5-rc6-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fix from Steve French:
 "A small SMB mount option fix, also for stable"

* tag '6.5-rc6-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6:
  smb: client: fix null auth
This commit is contained in:
Linus Torvalds 2023-08-18 19:41:12 +02:00
commit 8abd7287db
1 changed files with 4 additions and 0 deletions

View File

@ -231,6 +231,8 @@ cifs_parse_security_flavors(struct fs_context *fc, char *value, struct smb3_fs_c
break;
case Opt_sec_none:
ctx->nullauth = 1;
kfree(ctx->username);
ctx->username = NULL;
break;
default:
cifs_errorf(fc, "bad security option: %s\n", value);
@ -1201,6 +1203,8 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
case Opt_user:
kfree(ctx->username);
ctx->username = NULL;
if (ctx->nullauth)
break;
if (strlen(param->string) == 0) {
/* null user, ie. anonymous authentication */
ctx->nullauth = 1;