PSA: Latest (kernel) updates might break your samba config if ',' is in your credentials
Just upgraded to 5.11-1 and was welcomed by parts of my samba password being printed before login (cifs: Unknown parameter PARTS_OF_PASSWORD). I store my password in /etc/samba/credentials/Servername but some update broke parsing this file.
I guess this is caused by my password containing one comma. I yet have to find a way to escape characters in this file...
Also change your password if this happened to you as it is forever stored in the journal from now on.
EDIT: Relevant Bug Report on kernel.org
Edited 17 Mar 2021. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 27 · 89% up
- Kind
- Text
- ID
- lrabo3
5 comments
This should be the problem: https://github.com/torvalds/linux/commit/24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f
cifs switched to using the default option parser instead of its homegrown solution. In the process, the escaping of commas as double commas was lost.
the mount helper reads the credential file and duplicates all commas: https://git.samba.org/?p=cifs-utils.git;a=blob;f=mount.cifs.c;h=7f898bbd215ab97a01a65a1c5a13378245eacce4;hb=HEAD#l328
Thank you for the insights!
It is probably worth a bug report. You can do that like this: https://wiki.samba.org/index.php/Bug_Reporting
By the way, It might be a good idea to implement a kernel keyring instead of a cleartext parameter, but I have no idea how that would be done.
There is a patch available now.
https://marc.info/?l=linux-cifs&m=161423870323653&w=3