s3: lib: sysacls: Fix argument numbers for sys_acl_set_fd() for untested OS builds.
authorDavid Gajewski <dgajews@math.utoledo.edu>
Tue, 3 Aug 2021 00:06:39 +0000 (17:06 -0700)
committerJule Anger <janger@samba.org>
Tue, 10 Aug 2021 12:41:30 +0000 (12:41 +0000)
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 <dgajews@math.utoledo.edu>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(similar to commit 2867950721993c62a636d754e50d483fda39e19c)

Autobuild-User(v4-14-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-14-test): Tue Aug 10 12:41:30 UTC 2021 on sn-devel-184

source3/lib/sysacls.c
source3/modules/vfs_solarisacl.h
source3/modules/vfs_tru64acl.h

index ad970b6299be1eb1152554c94b03511ceb2479cc..ddf7cad07072a6582d0026921b2f024c4d06466e 100644 (file)
@@ -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,
index ce2206cbe5b7cf91576f89d7a4ccc5571bb0a4cb..8270358a48d437b2efc74fc46b18089c07ba9e1c 100644 (file)
@@ -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,
index 8dab1f0ec710ee58b91d44770fbd02bb02f4523b..5f9078308bf701a4ee222c51ec830508d414f8d9 100644 (file)
@@ -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,