[PATCH]: s3: smbd: Fix delete-on-close after smb2_find
Jeremy Allison
jra at samba.org
Sun Nov 5 16:39:28 UTC 2017
On Sun, Nov 05, 2017 at 08:24:32AM +0100, Volker Lendecke wrote:
> On Fri, Nov 03, 2017 at 11:59:02AM -0700, Jeremy Allison via samba-technical wrote:
> > On Fri, Nov 03, 2017 at 08:39:35AM -0700, Jeremy Allison via samba-technical wrote:
> > > > I was able to recreate the panic on my test system with the attached
> > > > 'smb2.delete-on-close-perms.FIND and set DOC.FIND and set DOC'
> > > > smbtorture test. Please see also my proposed fix. Both patches apply
> > > > on master.
> > >
> > > Thanks *VERY* much for the test.
> > >
> > > I'm trying to avoid adding calls that use by-pathname semantics,
> > > so I'll take a look at the patch to see if we can fix it another
> > > way first.
> >
> > Nope, we can't. Your patch is good :-). Not only that
> > it fixes an underlying issue I missed where calling
> > can_delete_directory_fsp() would certainly move the
> > directory pointer internally, thus causing a standard
> > directory listing to miss files.
>
> I've tried too with a dup() on fsp->fh->fd, but that also moves the
> offset. We need a new open() unfortunately.
That's what this patch does. The change to an OpenDir() instead of
an OpenDir_fsp() means we're calling opendir() internally, not
fdopendir() so this patch does get a new fd.
Jeremy.
More information about the samba-technical
mailing list