From: Ralph Boehme Date: Sat, 28 Oct 2017 14:13:16 +0000 (+0200) Subject: vfs_zfsacl: fix compilation error X-Git-Tag: samba-4.6.12~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=730c8f9e331a4b4abec5b0a1bafb60323b04a2e8;p=thirdparty%2Fsamba.git vfs_zfsacl: fix compilation error Bug: https://bugzilla.samba.org/show_bug.cgi?id=6133 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu Nov 2 03:16:11 CET 2017 on sn-devel-144 (cherry picked from commit 11da1e5c056c92fd7f51ecce0285628cac65f174) Autobuild-User(v4-6-test): Karolin Seeger Autobuild-Date(v4-6-test): Thu Dec 7 14:00:20 CET 2017 on sn-devel-144 --- diff --git a/source3/modules/vfs_zfsacl.c b/source3/modules/vfs_zfsacl.c index 8e195b66c9b..2272e480848 100644 --- a/source3/modules/vfs_zfsacl.c +++ b/source3/modules/vfs_zfsacl.c @@ -51,6 +51,7 @@ static NTSTATUS zfs_get_nt_acl_common(struct connection_struct *conn, SMB_STRUCT_STAT sbuf; const SMB_STRUCT_STAT *psbuf = NULL; int ret; + bool is_dir; if (VALID_STAT(smb_fname->st)) { psbuf = &smb_fname->st; @@ -65,10 +66,7 @@ static NTSTATUS zfs_get_nt_acl_common(struct connection_struct *conn, } psbuf = &sbuf; } - - if (S_ISDIR(psbuf->st_ex_mode) && (ace->aceMask & SMB_ACE4_ADD_FILE)) { - ace->aceMask |= SMB_ACE4_DELETE_CHILD; - } + is_dir = S_ISDIR(psbuf->st_ex_mode); /* read the number of file aces */ if((naces = acl(smb_fname->base_name, ACE_GETACLCNT, 0, NULL)) == -1) { @@ -115,6 +113,10 @@ static NTSTATUS zfs_get_nt_acl_common(struct connection_struct *conn, aceprop.aceMask |= SMB_ACE4_SYNCHRONIZE; } + if (is_dir && (aceprop.aceMask & SMB_ACE4_ADD_FILE)) { + aceprop.aceMask |= SMB_ACE4_DELETE_CHILD; + } + if(aceprop.aceFlags & ACE_OWNER) { aceprop.flags = SMB_ACE4_ID_SPECIAL; aceprop.who.special_id = SMB_ACE4_WHO_OWNER;