The Samba-Bugzilla – Bug 7282
Credentials file format not backwards compatible to mount.smbfs
Last modified: 2010-05-29 04:31:43 UTC
I had completely forgotten about this until I found it in my inbox and I'm submitting a bug report so that it doesn't slip through the digital cracks again.
The credentials option for mount.smbfs used to be the following format:
I've found that the format supported for mount.cifs is:
This seems at odds with the manual page for mount.cifs under the user=arg option:
The cifs vfs accepts the parameter user=, or for users familiar with smbfs it
accepts the longer form of the parameter username=. Similarly the longer smbfs
style parameter names may be accepted as synonyms for the shorter cifs
parameters pass=,dom= and cred=.
I had, for whatever reason, assumed that the user option rules would apply to the credentials file or that it would be backwards compatible with the older mount.smbfs credentials file format. Are either of these assumptions correct? If not, would it make sense to add or reword the manual page a bit (assuming I'm not the only one that misinterpreted it) for clarity? I wouldn't mind drafting up a proposal if others felt it was worth the effort.
Happy Version Numbers:
from The Fine Manual page for mount.cifs(8)
This man page is correct for version 1.52 of the cifs vfs filesystem (roughly Linux kernel 2.6.24).
[1005 12:24 sun ~]#smbd -V
[1007 12:26 sun ~]#uname -a
Linux sanitized.network.tld 2.6.18-92.1.22.el5.centos.plusxen #1 SMP Wed Dec 17 11:22:13 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
Would you agree that it is more desirable to add the "user=" format to mount.cifs to maintain backwards compatibility? I think this is probably the most 'clean' way to deal with it.
I have a quick (untested) patch. I just added
'|| strncasecmp("user"),line_buf+i,4' to open_cred_file(char * file_name) in mount.cifs.c.
Should I submit as an official patch and if so, what format of patch file is preferred?
Created attachment 5523 [details]
Parses "user" and "pass" entries of a credentials file in open_cred_file(char* file_name) function.
Untested, but I can't see how it couldn't work :)
Created attachment 5524 [details]
More clean version of last patch. Handles both cases with single if. Also, cosmetic change for consistent style inside of parens.
Sorry for spamming, I've got insomnia and I keep looking over mount.cifs.c.
I'm thinking more and more I'd like to make a number of changes to fix items on the back burner.
Patch looks reasonable to me. Please base it on current cifs-utils code and send the patch to linux-cifs-client mailing list so that it can be reviewed there.
Created attachment 5591 [details]
Formal patch for mount.cifs rebased for cifs-utils-4.2.0.
This is the formal patch that has been submitted to the mailing list. Adding here for documentation purposes.
Forgot to close this one out.
Patch was applied and shipped with cifs-utils-4.3.