impersonation patchset part2 (Re: FLAG_CASELESS_PATHNAMES/SMBFLG_CASELESS in set_current_service())
jra at samba.org
Thu Jun 14 23:08:37 UTC 2018
On Thu, Jun 14, 2018 at 08:01:13PM +0200, Stefan Metzmacher wrote:
> >>>> Windows servers ignore FLAG_CASELESS_PATHNAMES completely,
> >>>> but we do some magic just for smbclient and cifs.ko.
> >>>> Only [lib]smbclient supports changing the flag on a per request basis,
> >>>> but is it really used in practice?
> >>> No.
> >> So we can really remove smbc_setOptionCaseSensitive() ?
> >> And the "case_sensitive" smbclient command?
> > Yes, I think we can.
> And don't worry about the ABI change?
What are our options here ? smbc_setOptionCaseSensitive()
will become a no-op, so we either leave it and document
it's not useful, or remove it and uprev the library major
number I think.
> >>> POSIX opens (SMB1 global switch or SMB3 POSIX create context)
> >>> always mean case sensitive.
> >> Good.
> >>>> Can this all be done by FILE_FLAG_POSIX_SEMANTICS/ATTR_POSIX_SEMANTICS?
> >>>> Where we also have req->posix_pathnames and UCF_POSIX_PATHNAMES?
> >>> Yeah, I think so - see above.
> >>>> Any ideas how to move forward here?
> >>> Does my plan work ? The only issues I can see are when we're
> >>> running on a Linux system that actually *has* a case-insensitive
> >>> filesystem underneath (XFS or ZFS mounted in case-insensitive mode).
> >> Then the filesystem should not announce FILE_CASE_SENSITIVE_SEARCH.
> > Yes, that makes sense. The client can then know that
> > even if it asks for POSIX extensions it will not get
> > case-sensitive pathnames.
> Should we keep the "case sensitive" option to control this?
> Or should we better remove it completely.
I think we keep it. That way, even on a case-sensitive filesystem
we can set "case sensitive = yes/default case = upper" to
preserve the large directory optimization.
> And autodetect FILE_CASE_SENSITIVE_SEARCH from the local filesystem
> or add a new separate option for it?
What option name are you thinking of here ?
> I found it, during make_connection_snum() we don't have
> conn->origpath setup while calling change_to_user(),
> so I use a conn->tcon_done = true at the end of make_connection_snum()
> and only try chdir_current_service() from chane_to_user().
> The patches didn't pass autobuild, but I haven't checked yet if
> it was just a flakey test again.
Wow, another really interesting patchset. You're on a roll here :-).
More information about the samba-technical