Fix empty ACLs with nfs4 vfs module

Alexander Werth werth at linux.vnet.ibm.com
Wed Oct 30 11:36:17 MDT 2013


On Wed, 2013-10-30 at 17:16 +0100, David Disseldorp wrote:
> On Wed, 30 Oct 2013 16:04:35 +0100
> Alexander Werth <werth at linux.vnet.ibm.com> wrote:
> 
> > Good point. I overlooked this check in make_sec_acl().
> > That actually simplifies the patch even further since a null return
> > value is not an error if there are zero ace's.
> > 
> > -	nt_ace_list = (struct security_ace *)TALLOC_REALLOC(mem_ctx,
> > -					nt_ace_list,
> > -					good_aces * sizeof(struct security_ace));
> > -	if (nt_ace_list == NULL) {
> > +	nt_ace_list = (struct security_ace *)
> > +		TALLOC_REALLOC(mem_ctx, nt_ace_list,
> > +			       good_aces * sizeof(struct security_ace));
> > +	if (good_aces && nt_ace_list == NULL) {
> 
> I would've preferred something explicit over relying on
> TALLOC_REALLOC's null return on size=0, but looks good enough as is.

On a side note, that new code works fine even if realloc for some reason
returns an actual ptr to size 0 data.
> 
> Please add your Signed-off-by to both patches and I'll push them to
> autobuild.

done and thanks.

Cheers Alexander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-modules-Fix-realloc-with-zero-sized-ACLs.patch
Type: text/x-patch
Size: 1541 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131030/8363a2fd/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-s3-modules-nfs4_acls-ACLs-with-zero-entries-are-fine.patch
Type: text/x-patch
Size: 2012 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131030/8363a2fd/attachment-0001.bin>


More information about the samba-technical mailing list