Re: Parsing for obsolete mount options
From: Steve French <hidden>
Date: 2011-02-28 18:56:35
On Mon, Feb 28, 2011 at 12:45 PM, Jeff Layton [off-list ref] wrote:
On Sat, 26 Feb 2011 12:08:23 -0600 Steve French [off-list ref] wrote:quoted
I was trying to figure out a way to parse for mount options which are obsolete for smb2 (but valid for cifs), but without an "-t smb2" fs type it is harder. Jeff had preferred (rather than a "-t smb2" file type) that we call smb2 a "version" of cifs, and by analogy with nfs ("nfsvers=2", "nfsvers=4" etc.) specify a "vers=smb2" or "vers=2" to indicate mounting with experimental smb2 is desired ... but to be able to parse mount options which are now obsolete (for smb2) we have to scan the whole mount option string, looking for "vers=2" (or equivalent) first, then either call a (new) smb2_parse_mount_options function, or flag them in the current cifs_parse_mount_options when we detect a "vers=2" - by the time we get out of cifs_parse_mount_options it is too late because we don't know which mount options the user specified explicitly (and which we got from defaults). As a summary of some of the mount differences: 1) sec=ntlm (and sec=lanman) is no longer going to be valid (ntlmv2 and krb5 only) 2) noblocksend and noautotune probably no longer needed 3) posixpaths/noposixpaths no longer needed 4) noserverino not valid 5) sockopt may not be needed (nodelay can be defaulted)Probably, the best thing is to do this in 2 phases: 1) parse the mount options to the best of your ability 2) check the result and see whether they make sense Autonegotiation will make the second part interesting though since you might not know the version until later. In that case, you probably will just have to ignore options that don't have any effect on the version negotiated.
I may have to add a new bool (or int sec_flags_requested) in the vol structure for at least one requested security option, in particular for "ntlm" requested (since ntlm is the default, we want to distinguish "use the default security mechanism" from specifying "sec=ntlm" ie "give me ntlm" (which will only allow for cifs) which we want to fail) -- Thanks, Steve