From: Jeremy Allison Date: Tue, 8 Jun 2021 23:49:33 +0000 (-0700) Subject: s3: lib: sysacls: Add the 'SMB_ACL_TYPE_T type' parameter to sys_acl_set_fd(). X-Git-Tag: tevent-0.11.0~463 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac77b2c6f80e88bb09b4997de73b166e5846206f;p=thirdparty%2Fsamba.git s3: lib: sysacls: Add the 'SMB_ACL_TYPE_T type' parameter to sys_acl_set_fd(). 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 Reviewed-by: Ralph Boehme --- diff --git a/source3/include/smb_acls.h b/source3/include/smb_acls.h index f8c590e9976..50fdb18d2d5 100644 --- a/source3/include/smb_acls.h +++ b/source3/include/smb_acls.h @@ -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); diff --git a/source3/lib/sysacls.c b/source3/lib/sysacls.c index 4223d87bee7..0fb7c638597 100644 --- a/source3/lib/sysacls.c +++ b/source3/lib/sysacls.c @@ -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 diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 109ad4bd696..4070dd4838c 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -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) {