Skip to content

Commit 508872f

Browse files
committed
smb: client: fix regression with guest option
JIRA: https://issues.redhat.com/browse/RHEL-83856 commit fc99045 Author: Paulo Alcantara <pc@manguebit.com> Date: Wed Mar 12 10:51:31 2025 -0300 smb: client: fix regression with guest option When mounting a CIFS share with 'guest' mount option, mount.cifs(8) will set empty password= and password2= options. Currently we only handle empty strings from user= and password= options, so the mount will fail with cifs: Bad value for 'password2' Fix this by handling empty string from password2= option as well. Link: https://bbs.archlinux.org/viewtopic.php?id=303927 Reported-by: Adam Williamson <awilliam@redhat.com> Closes: https://lore.kernel.org/r/83c00b5fea81c07f6897a5dd3ef50fd3b290f56c.camel@redhat.com Fixes: 35f8342 ("smb3: fix broken reconnect when password changing on the server by allowing password rotation") Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Paulo Alcantara <paalcant@redhat.com>
1 parent 6e3a83b commit 508872f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/smb/client/fs_context.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ const struct fs_parameter_spec smb3_fs_parameters[] = {
170170
fsparam_string("username", Opt_user),
171171
fsparam_string("pass", Opt_pass),
172172
fsparam_string("password", Opt_pass),
173+
fsparam_string("pass2", Opt_pass2),
173174
fsparam_string("password2", Opt_pass2),
174175
fsparam_string("ip", Opt_ip),
175176
fsparam_string("addr", Opt_ip),
@@ -1073,6 +1074,9 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
10731074
} else if (!strcmp("user", param->key) || !strcmp("username", param->key)) {
10741075
skip_parsing = true;
10751076
opt = Opt_user;
1077+
} else if (!strcmp("pass2", param->key) || !strcmp("password2", param->key)) {
1078+
skip_parsing = true;
1079+
opt = Opt_pass2;
10761080
}
10771081
}
10781082

0 commit comments

Comments
 (0)