[PATCH] Fix for bug 11684

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Jan 21 19:46:32 UTC 2016


On Thu, Jan 21, 2016 at 07:49:56PM +0100, Ralph Boehme wrote:
> On Thu, Jan 21, 2016 at 09:48:55AM -0800, Jeremy Allison wrote:
> > On Thu, Jan 21, 2016 at 05:42:55PM +0100, Ralph Boehme wrote:
> > > On Thu, Jan 21, 2016 at 05:19:47PM +0100, Volker Lendecke wrote:
> > > > On Thu, Jan 21, 2016 at 01:53:00PM +0100, Volker Lendecke wrote:
> > > > > On Thu, Jan 21, 2016 at 09:43:14AM +0100, Ralph Boehme wrote:
> > > > > > It turns out the Windows client sends a directory creation request
> > > > > > with an initial allocation size > 0 which is currently rejected in
> > > > > > create_file_unixpath() with NT_STATUS_ACCESS_DENIED.
> > > > > > 
> > > > > > Windows behaviour is to allow the directory creation, ignoring the
> > > > > > allocation size.
> > > > > > 
> > > > > > Attached patch fixes this.
> > > > > 
> > > > > Pushed, thanks!
> > > > 
> > > > Fails the build with
> > > > 
> > > > [2421/4027] Compiling source4/torture/smb2/create.c
> > > > ../source4/torture/smb2/create.c: In function ‘test_dir_alloc_size’:
> > > > ../source4/torture/smb2/create.c:1679:9: error: missing braces around initializer [-Werror=missing-braces]
> > > >   struct smb2_handle h1 = { 0 }, h2;
> > > >          ^
> > > > ../source4/torture/smb2/create.c:1679:9: error: (near initialization for ‘h1.data’) [-Werror=missing-braces]
> > > > cc1: all warnings being treated as errors
> > > > Waf: Leaving directory `/memdisk/vlendec/a/b99594/samba/bin'
> > > > Build failed:  -> task failed (err #1): 
> > > >         {task: cc create.c -> create_1.o}
> > > > 
> > > > That's a gcc bug. We need to disable -Werror for this file.
> > > 
> > > alternatively we can remove the 0. Is it ok if I push the patchset
> > > with that modification?
> > 
> > Good catch Ralph, thanks. 'Reviewed-by: Jeremy Allison <jra at samba.or>
> > (I'm OK without the { 0 }).
> 
> thanks! Pushed.

Please stop the build. I'm sorry, but this is NOT standard C. It is gcc
that is broken here, see

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

where even the gcc developers see this as a defect. Why should we work
around here? Maybe we should upgrade our gcc on sn-devel or go back to
a working version of gcc if the one on our autobuild system is known to
be broken?

Or is the better alternative to drop the struct alignments and to to the
standardized memset again? It seems that the world is not ready yet for
C99, right?

Volker

-- 
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 at sernet.de



More information about the samba-technical mailing list