[PATCH] Fix Gluster bug - unable to create file/directory under root of the share due to empty dirpath during get_real_filename()
jra at samba.org
Wed Aug 22 16:27:54 UTC 2018
On Wed, Aug 22, 2018 at 06:09:25PM +0200, Michael Adam wrote:
> Conceptually, changing the return from "" to "."
> and changing all existing callers that check for ""
> afterwards is semantically not changing much really, is it?
> So I don't get the big concern about this change.
Michael you have *no* idea :-).
Look into the statcache code (which is *really* old)
which also gets passed the dirpath to make sure that
is still working if you make this change.
Historically, working with the difference between
"" and "." in pathnames has been the source of
many, *many* Samba pathname bugs.
I have (a lot of) historical context that teaches
me to be wary here. It you want to get really
scared ask Volker about this stuff also :-).
This is why I ended up re-writing the patch
to be a very simple fix after *really* careful
review of the possible issues (and I'm still
not sure I've gotten them all yet :-).
When I post my cleanup patch for you to review
you can be sure I've checked out all the possibilities
I can think of :-).
> We might want to change that function so that the
> callers do not actually have to deal with checking
> the dirpath at all but encode it in a return code
> or bool or so... Just rambling, sorry.
> But I will buy the benefits of getting a more
> isolated patch for the specific problem first.
Thanks. Already pushed mine :-). Your gluster-specific
fix, whilst not wrong, isn't general enough.
More information about the samba-technical