Passwords containg commas are no longer working in credential files
Subsystems (2)
Hello,
I'm using a password containing commas to mount a remote cifs on my computer. I recently upgraded the linux kernel on my system to 5.11, which seems to contain a regression, making the comma a separator even in the credential file.
I'm using mount /path/to/mount to mount the filesystem with the following contained in /etc/fstab:
//domain.tld/share /path/to/mount cifs noauto,credentials=/home/jkhsjdhjs/.credentials,uid=jkhsjdhjs,gid=jkhsjdhjs,dir_mode=0755,file_mode=0644 0 0
My credential file looks like this:
user=myusername
pass=abc,def
domain=mydomain
With Linux 5.11 or 5.11.1 the following is printed to dmesg when trying to mount the filesystem: [ 3051.668834] cifs: Unknown parameter 'def'. This worked fine with 5.10.16 and below, the man page also says this should work:
Note that a password which contains the delimiter character (i.e. a comma ',') will fail to be parsed correctly on the command line. However, the same password defined in the PASSWD environment variable or via a credentials file (see below) or entered at the password prompt will be read correctly.
Thus it seems there has been a regression in 5.11. I tried to identifiy the commit that caused this regression, but wasn't able to. I also checked if this bug is already known by searching lkml.org and didn't find anything. Sorry if I missed something.
Best Regards,
Leon Möller
Yes - it has been reported and fixed (although not pushed upstream). I expect to send it upstream and cc: stable so it gets backported fairly quickly.
See the email thread
"[PATCH] cifs: fix handling of escaped ',' in the password mount argument"
Quoted 41 lines · jkhsjdhjs
Hello,
I'm using a password containing commas to mount a remote cifs on my computer. I recently upgraded the linux kernel on my system to 5.11, which seems to contain a regression, making the comma a separator even in the credential file.
I'm using
mount /path/to/mountto mount the filesystem with the following contained in/etc/fstab://domain.tld/share /path/to/mount cifs
noauto,credentials=/home/jkhsjdhjs/.credentials,uid=jkhsjdhjs,gid=jkhsjdhjs,dir_mode=0755,file_mode=0644 0 0My credential file looks like this:
user=myusername
pass=abc,def
domain=mydomainWith Linux 5.11 or 5.11.1 the following is printed to
dmesgwhen trying to mount the filesystem:[ 3051.668834] cifs: Unknown parameter 'def'. This worked fine with 5.10.16 and below, the man page also says this should work:Note that a password which contains the delimiter character (i.e. a comma ',') will fail to be parsed correctly on the command line. However, the same password defined in the PASSWD environment variable or via a credentials file (see below) or entered at the password prompt will be read correctly.
Thus it seems there has been a regression in 5.11. I tried to identifiy the commit that caused this regression, but wasn't able to. I also checked if this bug is already known by searching lkml.org and didn't find anything. Sorry if I missed something.
Best Regards,
Leon Möller
Signature · 3 lines
Thanks, Steve