[PATCH] Fix for bug 11522: smbd can't create or open a stream name on the root directory of a share.

Ralph Böhme rb at sernet.de
Fri Sep 18 06:04:14 UTC 2015


On Thu, Sep 17, 2015 at 04:32:42PM -0700, Jeremy Allison wrote:
> On Thu, Sep 17, 2015 at 11:23:08AM -0700, Jeremy Allison wrote:
> > 
> > OK. Might be that the smbclient test which is run
> > before samba3.base.dir2 leaves the :foobar stream
> > on the base directory of the [tmp] share and doesn't
> > get deleted (there's no stream delete in smbclient).
> > Still shouldn't be visible to a old SMB1 directory
> > list though. I might try replacing the smbclient
> > test with a smbtorture test that explicitly deletes
> > the stream on the toplevel share directory.
> 
> Nailed it ! When the smbclient test that adds
> the :foobar stream on the base of the [tmp]
> share runs, it adds the 'A' (ARCHIVE) attribute
> to the directory as the directory has been
> changed and thus would need backup.
> 
> Then when samba3.base.dir2 runs later it finds
> the ARCHIVE attribute on the '..' directory and
> so adds in that extra file to the list of files
> it sees in the 'old' SMB1search request.

oh my! :)

> Phew, that took a lot of finding :-).
>
> So the test needs to remove the 'A' bit
> from the root of the share after creating
> :foobar - using the 'setmode \ -a' command,
> which can only be done on the root of the
> share over SMB2.
> 
> Whilst making *that* work I discovered
> the 'setmode' command in smbclient had
> been moved from client/client.c into
> client/clitar.c - which means it only
> gets linked in if libarchive-dev has
> been installed on the system. That's
> not right - it should be (and always
> used to be) part of the core smbclient
> code :-(.
> 
> So here is the complete patchset for
> your re-review.
> 
> 1). Move the 'setmode' command from
> clitar.c to client.c
> 
> 2). Code tidyup (unchanged, already reviewed).
> 
> 3). Actual bugfix ! (unchanged, already reviewed).
> 
> 4). Regression test that adds the setmode -a
> command after creating :foobar.

reviewed&pushed.

> Sorry for the trouble Ralph. Please
> re-review the attached (passes the two
> tests run concurrently here :-).

No prob!

Cheerio!
-Ralph

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de,mailto:kontakt@sernet.de



More information about the samba-technical mailing list