vfs_tru64acl: add support for SMB_ACL_TYPE_DEFAULT to tru64acl_sys_acl_set_fd()
authorRalph Boehme <slow@samba.org>
Mon, 14 Dec 2020 07:08:30 +0000 (08:08 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Dec 2020 18:56:28 +0000 (18:56 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_tru64acl.c

index 104397ee0be45b15234769caad08db9a852aa206..b5d268c9806998ce34c7d8d1e7966e7b980b6880 100644 (file)
@@ -140,10 +140,24 @@ int tru64acl_sys_acl_set_fd(vfs_handle_struct *handle,
 {
         int res;
         acl_t tru64_acl = smb_acl_to_tru64_acl(theacl);
+        acl_type_t the_acl_type;
+
+        switch(type) {
+        case SMB_ACL_TYPE_ACCESS:
+                the_acl_type = ACL_TYPE_ACCESS;
+                break;
+        case SMB_ACL_TYPE_DEFAULT:
+                the_acl_type = ACL_TYPE_DEFAULT;
+                break;
+        default:
+                errno = EINVAL;
+                return -1;
+        }
+
         if (tru64_acl == NULL) {
                 return -1;
         }
-        res =  acl_set_fd(fsp_get_io_fd(fsp), ACL_TYPE_ACCESS, tru64_acl);
+        res =  acl_set_fd(fsp_get_io_fd(fsp), the_acl_type, tru64_acl);
         acl_free(tru64_acl);
         return res;