From a8a0a45cbb465052a35c660e8e89b8e58c2d034c Mon Sep 17 00:00:00 2001 From: David Gajewski Date: Mon, 2 Aug 2021 17:06:39 -0700 Subject: [PATCH] s3: lib: sysacls: Fix argument numbers for sys_acl_set_fd() for untested OS builds. In the stable release 4.14.6 the prototype for solarisacl_sys_acl_set_fd() in s3/modules/vfs_solarisacl.h is listed with 3 arguments, while the code in s3/modules/vfs_solarisacl.c has 4. This leads to a compile error. The latter reflects the upcoming release, with code in solarisacl_sys_acl_set_fd() checking for the type. The commit was "vfs: add acl type arg to SMB_VFS_SYS_ACL_SET_FD()" that made the partial change. A patch mimicking what was done with posixacl_sys_acl_set_fd() is applied here. solarisacl_sys_acl_set_fd() is only called from sys_acl_set_fd() in s3/lib/sysacls.c which in turn is only called by vfswrap_sys_acl_set_fd() in s3/modules/vfs_default.c when type == SMB_ACL_TYPE_ACCESS. This patch mimics the call to posixacl_sys_acl_set_fd() by setting the type argument to SMB_ACL_TYPE_ACCESS for all the affected OS's that are not tested in ci (tru64 and aix). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14774 Signed-off-by: David Gajewski Reviewed-by: Jeremy Allison --- source3/lib/sysacls.c | 6 +++--- source3/modules/vfs_solarisacl.h | 1 + source3/modules/vfs_tru64acl.h | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source3/lib/sysacls.c b/source3/lib/sysacls.c index ad970b6299b..ddf7cad0707 100644 --- a/source3/lib/sysacls.c +++ b/source3/lib/sysacls.c @@ -423,7 +423,7 @@ int sys_acl_set_file(vfs_handle_struct *handle, int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T acl_d) { - return aixacl_sys_acl_set_fd(handle, fsp, acl_d); + return aixacl_sys_acl_set_fd(handle, fsp, SMB_ACL_TYPE_ACCESS, acl_d); } int sys_acl_delete_def_file(vfs_handle_struct *handle, @@ -460,7 +460,7 @@ int sys_acl_set_file(vfs_handle_struct *handle, int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T acl_d) { - return tru64acl_sys_acl_set_fd(handle, fsp, acl_d); + return tru64acl_sys_acl_set_fd(handle, fsp, SMB_ACL_TYPE_ACCESS, acl_d); } int sys_acl_delete_def_file(vfs_handle_struct *handle, @@ -498,7 +498,7 @@ int sys_acl_set_file(vfs_handle_struct *handle, int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T acl_d) { - return solarisacl_sys_acl_set_fd(handle, fsp, acl_d); + return solarisacl_sys_acl_set_fd(handle, fsp, SMB_ACL_TYPE_ACCESS, acl_d); } int sys_acl_delete_def_file(vfs_handle_struct *handle, diff --git a/source3/modules/vfs_solarisacl.h b/source3/modules/vfs_solarisacl.h index ce2206cbe5b..8270358a48d 100644 --- a/source3/modules/vfs_solarisacl.h +++ b/source3/modules/vfs_solarisacl.h @@ -36,6 +36,7 @@ int solarisacl_sys_acl_set_file(vfs_handle_struct *handle, int solarisacl_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl); int solarisacl_sys_acl_delete_def_file(vfs_handle_struct *handle, diff --git a/source3/modules/vfs_tru64acl.h b/source3/modules/vfs_tru64acl.h index 8dab1f0ec71..5f9078308bf 100644 --- a/source3/modules/vfs_tru64acl.h +++ b/source3/modules/vfs_tru64acl.h @@ -34,6 +34,7 @@ int tru64acl_sys_acl_set_file(vfs_handle_struct *handle, int tru64acl_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl); int tru64acl_sys_acl_delete_def_file(vfs_handle_struct *handle, -- 2.30.2