]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: lib: sysacls: Add the 'SMB_ACL_TYPE_T type' parameter to sys_acl_set_fd().
authorJeremy Allison <jra@samba.org>
Tue, 8 Jun 2021 23:49:33 +0000 (16:49 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:31 +0000 (13:14 +0000)
Pass it through to the backends. The default posixacl_sys_acl_set_fd()
already copes with this anyway, as does the AIX, and Solaris backends.

The HPUX code isn't compiled and was broken anyway (there was a
missmatch of the number of parameters being passed to the
sys_acl_set_fd_fn backend hpuxacl_sys_acl_set_fd()), and HPUX
doesn't have fd-based ACLs, so just switch to calling hpuxacl_sys_acl_set_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/include/smb_acls.h
source3/lib/sysacls.c
source3/modules/vfs_default.c

index f8c590e99762667926004c0c428a0687b0b78443..50fdb18d2d5fab7545d1307fdce999435a4a061c 100644 (file)
@@ -66,8 +66,10 @@ int sys_acl_set_file(struct vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname,
                        SMB_ACL_TYPE_T type,
                        SMB_ACL_T acl_d);
-int sys_acl_set_fd(struct vfs_handle_struct *handle, struct files_struct *fsp,
-                  SMB_ACL_T acl_d);
+int sys_acl_set_fd(struct vfs_handle_struct *handle,
+                       struct files_struct *fsp,
+                       SMB_ACL_TYPE_T type,
+                       SMB_ACL_T acl_d);
 int sys_acl_delete_def_fd(struct vfs_handle_struct *handle,
                          struct files_struct *fsp);
 int no_acl_syscall_error(int err);
index 4223d87bee78d653c2bd1526aaea7380f3717b54..0fb7c6385979c20e055a70f443d2132032f6fd7a 100644 (file)
@@ -375,10 +375,12 @@ int sys_acl_set_file(vfs_handle_struct *handle,
        return posixacl_sys_acl_set_file(handle, smb_fname, type, acl_d);
 }
 
-int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
+int sys_acl_set_fd(vfs_handle_struct *handle,
+                  files_struct *fsp,
+                  SMB_ACL_TYPE_T type,
                   SMB_ACL_T acl_d)
 {
-       return posixacl_sys_acl_set_fd(handle, fsp, SMB_ACL_TYPE_ACCESS, acl_d);
+       return posixacl_sys_acl_set_fd(handle, fsp, type, acl_d);
 }
 
 int sys_acl_delete_def_fd(vfs_handle_struct *handle,
@@ -405,10 +407,12 @@ int sys_acl_set_file(vfs_handle_struct *handle,
        return aixacl_sys_acl_set_file(handle, smb_fname, type, acl_d);
 }
 
-int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
+int sys_acl_set_fd(vfs_handle_struct *handle,
+                  files_struct *fsp,
+                  SMB_ACL_TYPE_T type,
                   SMB_ACL_T acl_d)
 {
-       return aixacl_sys_acl_set_fd(handle, fsp, acl_d);
+       return aixacl_sys_acl_set_fd(handle, fsp, type, acl_d);
 }
 
 int sys_acl_delete_def_fd(vfs_handle_struct *handle,
@@ -435,12 +439,14 @@ int sys_acl_set_file(vfs_handle_struct *handle,
        return solarisacl_sys_acl_set_file(handle, smb_fname, type, acl_d);
 }
 
-int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
+int sys_acl_set_fd(vfs_handle_struct *handle,
+                  files_struct *fsp,
+                  SMB_ACL_TYPE_T type,
                   SMB_ACL_T acl_d)
 {
        return solarisacl_sys_acl_set_fd(handle,
                                        fsp,
-                                       SMB_ACL_TYPE_ACCESS,
+                                       type,
                                        acl_d);
 }
 
@@ -467,10 +473,12 @@ int sys_acl_set_file(vfs_handle_struct *handle,
        return hpuxacl_sys_acl_set_file(handle, smb_fname, type, acl_d);
 }
 
-int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
+int sys_acl_set_fd(vfs_handle_struct *handle,
+                  files_struct *fsp,
+                  SMB_ACL_TYPE_T type,
                   SMB_ACL_T acl_d)
 {
-       return hpuxacl_sys_acl_set_fd(handle, fsp, acl_d);
+       return hpuxacl_sys_acl_set_file(handle, fsp->fsp_name, type, acl_d);
 }
 
 int sys_acl_delete_def_fd(vfs_handle_struct *handle,
@@ -506,7 +514,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
        return -1;
 }
 
-int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
+int sys_acl_set_fd(vfs_handle_struct *handle,
+                  files_struct *fsp,
+                  SMB_ACL_TYPE_T type,
                   SMB_ACL_T acl_d)
 {
 #ifdef ENOTSUP
index 109ad4bd6961ff92574652f12c26d275a95aef7c..4070dd4838c195a9da8f98a639bd40dbd5f0bb74 100644 (file)
@@ -3236,7 +3236,7 @@ static int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle,
        if (!fsp->fsp_flags.is_pathref &&
            type == SMB_ACL_TYPE_ACCESS)
        {
-               return sys_acl_set_fd(handle, fsp, theacl);
+               return sys_acl_set_fd(handle, fsp, type, theacl);
        }
 
        if (fsp->fsp_flags.have_proc_fds) {