[PATCH] Fix compilation error in vfs_zfsacl

Ralph Böhme slow at samba.org
Sun Oct 29 10:06:59 UTC 2017


Hi!

I made a stupid mistake in 4102697503691f3b2eadfcb98834bb66c669f3ab as a result
vfs_zfsacl doesn't build anymore:

../source3/modules/vfs_zfsacl.c:69:37: error: use of undeclared identifier 'ace'
        if (S_ISDIR(psbuf->st_ex_mode) && (ace->aceMask & SMB_ACE4_ADD_FILE)) {
                                           ^
../source3/modules/vfs_zfsacl.c:70:3: error: must use 'struct' tag to refer to type 'ace'
                ace->aceMask |= SMB_ACE4_DELETE_CHILD;
                ^
                struct
../source3/modules/vfs_zfsacl.c:70:6: error: expected identifier or '('
                ace->aceMask |= SMB_ACE4_DELETE_CHILD;
                 ^

Attached patch fixes this. It was tested by a nice guy from the nas4free project
who reported the problem on IRC yesterday.

Pleaes review&push if happy. Thanks!

-slow

-- 
Ralph Boehme, Samba Team       https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
-------------- next part --------------
From 349472c94fe6e060dbdbba1c36a01e33e150ddb2 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Sat, 28 Oct 2017 16:13:16 +0200
Subject: [PATCH] vfs_zfsacl: fix compilation error

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

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/modules/vfs_zfsacl.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/source3/modules/vfs_zfsacl.c b/source3/modules/vfs_zfsacl.c
index dd0f343b8c6..2e277c67a24 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;
-- 
2.13.6



More information about the samba-technical mailing list