Re: Anonymous mount of CIFS shares fails with cifs-utils 7.2 unless 'sec=none' is added to mount options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adam Williamson <awilliam@xxxxxxxxxx> writes:

> I have this line in my /etc/fstab to mount a local network CIFS share
> that requires no authentication:
>
> //192.168.1.9/Media		/mnt/data             cifs    noauto,nosuid,soft,guest,uid=99,gid=99,file_mode=0777,dir_mode=0777,users,vers=3.0	0 0
>
> With cifs-utils 7.2, this suddenly doesn't work. I get an 'invalid
> argument' error, and in dmesg:
>
> cifs: Bad value for 'password2'

Yes, this is a regression.  The problem is that cifs-utils-7.2 is now
passing an empty password2= for guest authentication and the kernel
can't handle it.

Does the following fix your issue

diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c
index e9b286d9a7ba..456948d4f328 100644
--- a/fs/smb/client/fs_context.c
+++ b/fs/smb/client/fs_context.c
@@ -171,6 +171,7 @@ const struct fs_parameter_spec smb3_fs_parameters[] = {
 	fsparam_string("username", Opt_user),
 	fsparam_string("pass", Opt_pass),
 	fsparam_string("password", Opt_pass),
+	fsparam_string("pass2", Opt_pass2),
 	fsparam_string("password2", Opt_pass2),
 	fsparam_string("ip", Opt_ip),
 	fsparam_string("addr", Opt_ip),
@@ -1125,7 +1126,10 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
 	 * we will need special handling of them.
 	 */
 	if (param->type == fs_value_is_string && param->string[0] == 0) {
-		if (!strcmp("pass", param->key) || !strcmp("password", param->key)) {
+		if (!strcmp("pass2", param->key) || !strcmp("password2", param->key)) {
+			skip_parsing = true;
+			opt = Opt_pass2;
+		} else 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)) {




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux