1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

vfs_zfsacl: fix compilation error

Bug: https://bugzilla.samba.org/show_bug.cgi?id=6133

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Nov  2 03:16:11 CET 2017 on sn-devel-144
This commit is contained in:
Ralph Boehme 2017-10-28 16:13:16 +02:00 committed by Jeremy Allison
parent 8be4236b32
commit 11da1e5c05

View File

@ -51,6 +51,7 @@ static NTSTATUS zfs_get_nt_acl_common(struct connection_struct *conn,
SMB_STRUCT_STAT sbuf; SMB_STRUCT_STAT sbuf;
const SMB_STRUCT_STAT *psbuf = NULL; const SMB_STRUCT_STAT *psbuf = NULL;
int ret; int ret;
bool is_dir;
if (VALID_STAT(smb_fname->st)) { if (VALID_STAT(smb_fname->st)) {
psbuf = &smb_fname->st; psbuf = &smb_fname->st;
@ -65,10 +66,7 @@ static NTSTATUS zfs_get_nt_acl_common(struct connection_struct *conn,
} }
psbuf = &sbuf; psbuf = &sbuf;
} }
is_dir = S_ISDIR(psbuf->st_ex_mode);
if (S_ISDIR(psbuf->st_ex_mode) && (ace->aceMask & SMB_ACE4_ADD_FILE)) {
ace->aceMask |= SMB_ACE4_DELETE_CHILD;
}
/* read the number of file aces */ /* read the number of file aces */
if((naces = acl(smb_fname->base_name, ACE_GETACLCNT, 0, NULL)) == -1) { 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; 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) { if(aceprop.aceFlags & ACE_OWNER) {
aceprop.flags = SMB_ACE4_ID_SPECIAL; aceprop.flags = SMB_ACE4_ID_SPECIAL;
aceprop.who.special_id = SMB_ACE4_WHO_OWNER; aceprop.who.special_id = SMB_ACE4_WHO_OWNER;