From 8d0ea8bafa003984dda4a105e4c8b755644cc7f7 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Mon, 14 Dec 2020 16:28:26 +0100 Subject: [PATCH] vfs: add acl type arg to SMB_VFS_SYS_ACL_SET_FD() No change in behaviour, the new arg is not yet used in any module. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- examples/VFS/skel_opaque.c | 4 +++- examples/VFS/skel_transparent.c | 6 ++++-- source3/include/vfs.h | 14 +++++++++++--- source3/include/vfs_macros.h | 8 ++++---- source3/lib/sysacls.c | 2 +- source3/modules/posixacl_xattr.c | 4 +++- source3/modules/posixacl_xattr.h | 1 + source3/modules/vfs_acl_tdb.c | 6 ++++-- source3/modules/vfs_acl_xattr.c | 2 ++ source3/modules/vfs_aixacl.c | 1 + source3/modules/vfs_aixacl2.c | 1 + source3/modules/vfs_catia.c | 3 ++- source3/modules/vfs_default.c | 5 ++++- source3/modules/vfs_fake_acls.c | 6 +++++- source3/modules/vfs_full_audit.c | 8 +++++--- source3/modules/vfs_gpfs.c | 3 ++- source3/modules/vfs_nfs4acl_xattr.c | 1 + source3/modules/vfs_not_implemented.c | 4 +++- source3/modules/vfs_posixacl.c | 1 + source3/modules/vfs_posixacl.h | 1 + source3/modules/vfs_solarisacl.c | 1 + source3/modules/vfs_streams_xattr.c | 3 ++- source3/modules/vfs_time_audit.c | 3 ++- source3/modules/vfs_tru64acl.c | 1 + source3/modules/vfs_vxfs.c | 6 ++++-- source3/modules/vfs_zfsacl.c | 1 + source3/smbd/posix_acls.c | 10 ++++++---- source3/smbd/vfs.c | 6 ++++-- 28 files changed, 80 insertions(+), 32 deletions(-) diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 881a7fdaf1c..e00f886b700 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -848,7 +848,9 @@ static int skel_sys_acl_set_file(vfs_handle_struct *handle, return -1; } -static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, +static int skel_sys_acl_set_fd(vfs_handle_struct *handle, + struct files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { errno = ENOSYS; diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 2680b4f3285..f3d74556ef3 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -1112,10 +1112,12 @@ static int skel_sys_acl_set_file(vfs_handle_struct *handle, acltype, theacl); } -static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, +static int skel_sys_acl_set_fd(vfs_handle_struct *handle, + struct files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { - return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl); + return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl); } static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 1a5d71e8401..ada1f13bc3f 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -340,6 +340,7 @@ * Version 44 - Add dirfsp arg to SMB_VFS_READDIR() * Version 44 - Remove SMB_VFS_GET_DOS_ATTRIBUTES() * Version 44 - Replace SMB_VFS_GET_COMPRESSION() with SMB_VFS_FGET_COMPRESSION() + * Version 44 - Add type argument to SMB_VFS_SYS_ACL_SET_FD() */ #define SMB_VFS_INTERFACE_VERSION 44 @@ -1219,7 +1220,10 @@ struct vfs_fn_pointers { const struct smb_filename *smb_fname, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); - int (*sys_acl_set_fd_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_ACL_T theacl); + int (*sys_acl_set_fd_fn)(struct vfs_handle_struct *handle, + struct files_struct *fsp, + SMB_ACL_TYPE_T type, + SMB_ACL_T theacl); int (*sys_acl_delete_def_file_fn)(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname); @@ -1746,7 +1750,9 @@ int smb_vfs_call_sys_acl_set_file(struct vfs_handle_struct *handle, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); int smb_vfs_call_sys_acl_set_fd(struct vfs_handle_struct *handle, - struct files_struct *fsp, SMB_ACL_T theacl); + struct files_struct *fsp, + SMB_ACL_TYPE_T type, + SMB_ACL_T theacl); int smb_vfs_call_sys_acl_delete_def_file(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname); ssize_t smb_vfs_call_getxattr(struct vfs_handle_struct *handle, @@ -2164,7 +2170,9 @@ int vfs_not_implemented_sys_acl_set_file(vfs_handle_struct *handle, const struct smb_filename *smb_fname, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); -int vfs_not_implemented_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, +int vfs_not_implemented_sys_acl_set_fd(vfs_handle_struct *handle, + struct files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl); int vfs_not_implemented_sys_acl_delete_def_file(vfs_handle_struct *handle, const struct smb_filename *smb_fname); diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 80720ad16cd..2fc3ba7b668 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -513,10 +513,10 @@ #define SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname, acltype, theacl) \ smb_vfs_call_sys_acl_set_file((handle)->next, (smb_fname), (acltype), (theacl)) -#define SMB_VFS_SYS_ACL_SET_FD(fsp, theacl) \ - smb_vfs_call_sys_acl_set_fd((fsp)->conn->vfs_handles, (fsp), (theacl)) -#define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl) \ - smb_vfs_call_sys_acl_set_fd((handle)->next, (fsp), (theacl)) +#define SMB_VFS_SYS_ACL_SET_FD(fsp, type, theacl) \ + smb_vfs_call_sys_acl_set_fd((fsp)->conn->vfs_handles, (fsp), (type), (theacl)) +#define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl) \ + smb_vfs_call_sys_acl_set_fd((handle)->next, (fsp), (type), (theacl)) #define SMB_VFS_SYS_ACL_DELETE_DEF_FILE(conn, smb_fname) \ smb_vfs_call_sys_acl_delete_def_file((conn)->vfs_handles, (smb_fname)) diff --git a/source3/lib/sysacls.c b/source3/lib/sysacls.c index c80f8f30c90..ad970b6299b 100644 --- a/source3/lib/sysacls.c +++ b/source3/lib/sysacls.c @@ -387,7 +387,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 posixacl_sys_acl_set_fd(handle, fsp, acl_d); + return posixacl_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/posixacl_xattr.c b/source3/modules/posixacl_xattr.c index 6f016e17e0b..e88c6cecace 100644 --- a/source3/modules/posixacl_xattr.c +++ b/source3/modules/posixacl_xattr.c @@ -479,7 +479,9 @@ int posixacl_xattr_acl_set_file(vfs_handle_struct *handle, } int posixacl_xattr_acl_set_fd(vfs_handle_struct *handle, - files_struct *fsp, SMB_ACL_T theacl) + files_struct *fsp, + SMB_ACL_TYPE_T type, + SMB_ACL_T theacl) { char *buf; ssize_t size; diff --git a/source3/modules/posixacl_xattr.h b/source3/modules/posixacl_xattr.h index 70962dd3115..7d0fb2bb8bf 100644 --- a/source3/modules/posixacl_xattr.h +++ b/source3/modules/posixacl_xattr.h @@ -37,6 +37,7 @@ int posixacl_xattr_acl_set_file(vfs_handle_struct *handle, int posixacl_xattr_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl); int posixacl_xattr_acl_delete_def_file(vfs_handle_struct *handle, diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c index 2fb03c03efc..ecbc75f9937 100644 --- a/source3/modules/vfs_acl_tdb.c +++ b/source3/modules/vfs_acl_tdb.c @@ -416,6 +416,7 @@ fail: static int sys_acl_set_fd_tdb(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { struct db_context *db = acl_db; @@ -428,8 +429,9 @@ static int sys_acl_set_fd_tdb(vfs_handle_struct *handle, } ret = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, - fsp, - theacl); + fsp, + type, + theacl); if (ret == -1) { return -1; } diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c index 2f286ed97f7..7a1f1ba4437 100644 --- a/source3/modules/vfs_acl_xattr.c +++ b/source3/modules/vfs_acl_xattr.c @@ -250,10 +250,12 @@ static int sys_acl_set_file_xattr(vfs_handle_struct *handle, static int sys_acl_set_fd_xattr(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { int ret = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, + type, theacl); if (ret == -1) { return -1; diff --git a/source3/modules/vfs_aixacl.c b/source3/modules/vfs_aixacl.c index 39c92e36060..e9cc667faf9 100644 --- a/source3/modules/vfs_aixacl.c +++ b/source3/modules/vfs_aixacl.c @@ -156,6 +156,7 @@ int aixacl_sys_acl_set_file(vfs_handle_struct *handle, int aixacl_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { struct acl *file_acl = NULL; diff --git a/source3/modules/vfs_aixacl2.c b/source3/modules/vfs_aixacl2.c index 57f4d0fc000..d06f7c882f5 100644 --- a/source3/modules/vfs_aixacl2.c +++ b/source3/modules/vfs_aixacl2.c @@ -513,6 +513,7 @@ int aixjfs2_sys_acl_set_file(vfs_handle_struct *handle, int aixjfs2_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { struct acl *acl_aixc; diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index 21ea24000ac..0e4843ff58f 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -1673,6 +1673,7 @@ static int catia_sys_acl_blob_get_fd(vfs_handle_struct *handle, static int catia_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { struct catia_cache *cc = NULL; @@ -1683,7 +1684,7 @@ static int catia_sys_acl_set_fd(vfs_handle_struct *handle, return ret; } - ret = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl); + ret = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl); CATIA_FETCH_FSP_POST_NEXT(&cc, fsp); diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 9157355dfdb..155bae33823 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -3231,7 +3231,10 @@ static int vfswrap_sys_acl_set_file(vfs_handle_struct *handle, return sys_acl_set_file(handle, smb_fname, acltype, theacl); } -static int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl) +static int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle, + files_struct *fsp, + SMB_ACL_TYPE_T type, + SMB_ACL_T theacl) { return sys_acl_set_fd(handle, fsp, theacl); } diff --git a/source3/modules/vfs_fake_acls.c b/source3/modules/vfs_fake_acls.c index d8385954364..a093fcb12ea 100644 --- a/source3/modules/vfs_fake_acls.c +++ b/source3/modules/vfs_fake_acls.c @@ -351,7 +351,10 @@ static int fake_acls_sys_acl_set_file(vfs_handle_struct *handle, return ret; } -static int fake_acls_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl) +static int fake_acls_sys_acl_set_fd(vfs_handle_struct *handle, + struct files_struct *fsp, + SMB_ACL_TYPE_T type, + SMB_ACL_T theacl) { int ret; const char *name = FAKE_ACL_ACCESS_XATTR; @@ -703,6 +706,7 @@ static int fake_acls_fchmod(vfs_handle_struct *handle, } ret = fake_acls_sys_acl_set_fd(handle, fsp, + SMB_ACL_TYPE_ACCESS, the_acl); TALLOC_FREE(frame); return ret; diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 39fcdfc59da..0350df868a5 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -2576,12 +2576,14 @@ static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle, return result; } -static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, - SMB_ACL_T theacl) +static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, + struct files_struct *fsp, + SMB_ACL_TYPE_T type, + SMB_ACL_T theacl) { int result; - result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl); + result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl); do_log(SMB_VFS_OP_SYS_ACL_SET_FD, (result >= 0), handle, "%s", fsp_str_do_log(fsp)); diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 78ee7fc6958..56a7254a7e6 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -1343,6 +1343,7 @@ static int gpfsacl_sys_acl_set_file(vfs_handle_struct *handle, static int gpfsacl_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { struct gpfs_config_data *config; @@ -1352,7 +1353,7 @@ static int gpfsacl_sys_acl_set_fd(vfs_handle_struct *handle, return -1); if (!config->acl) { - return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl); + return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl); } return gpfsacl_sys_acl_set_file(handle, fsp->fsp_name, diff --git a/source3/modules/vfs_nfs4acl_xattr.c b/source3/modules/vfs_nfs4acl_xattr.c index 2a8db673708..33bf0661648 100644 --- a/source3/modules/vfs_nfs4acl_xattr.c +++ b/source3/modules/vfs_nfs4acl_xattr.c @@ -630,6 +630,7 @@ static int nfs4acl_xattr_fail__sys_acl_set_file(vfs_handle_struct *handle, static int nfs4acl_xattr_fail__sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { return -1; diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 4aeccb889c4..a1bbe3f41bc 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -852,7 +852,9 @@ int vfs_not_implemented_sys_acl_set_file(vfs_handle_struct *handle, return -1; } -int vfs_not_implemented_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, +int vfs_not_implemented_sys_acl_set_fd(vfs_handle_struct *handle, + struct files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { errno = ENOSYS; diff --git a/source3/modules/vfs_posixacl.c b/source3/modules/vfs_posixacl.c index cca4dd22b60..d573461e987 100644 --- a/source3/modules/vfs_posixacl.c +++ b/source3/modules/vfs_posixacl.c @@ -137,6 +137,7 @@ int posixacl_sys_acl_set_file(vfs_handle_struct *handle, int posixacl_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { int res; diff --git a/source3/modules/vfs_posixacl.h b/source3/modules/vfs_posixacl.h index da7449f039c..5a423ca2c4a 100644 --- a/source3/modules/vfs_posixacl.h +++ b/source3/modules/vfs_posixacl.h @@ -37,6 +37,7 @@ int posixacl_sys_acl_set_file(vfs_handle_struct *handle, int posixacl_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl); int posixacl_sys_acl_delete_def_file(vfs_handle_struct *handle, diff --git a/source3/modules/vfs_solarisacl.c b/source3/modules/vfs_solarisacl.c index 7c4ffd02c35..41a2dd363d8 100644 --- a/source3/modules/vfs_solarisacl.c +++ b/source3/modules/vfs_solarisacl.c @@ -237,6 +237,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) { SOLARIS_ACL_T solaris_acl = NULL; diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index 47580a7a53d..b838878d4b3 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -1409,13 +1409,14 @@ static SMB_ACL_T streams_xattr_sys_acl_get_fd(vfs_handle_struct *handle, static int streams_xattr_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { struct stream_io *sio = (struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp); if (sio == NULL) { - return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl); + return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl); } return 0; diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 3c8459e3eaa..1f7829fd292 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -2409,6 +2409,7 @@ static int smb_time_audit_sys_acl_set_file(vfs_handle_struct *handle, static int smb_time_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { int result; @@ -2416,7 +2417,7 @@ static int smb_time_audit_sys_acl_set_fd(vfs_handle_struct *handle, double timediff; clock_gettime_mono(&ts1); - result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl); + result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl); clock_gettime_mono(&ts2); timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9; diff --git a/source3/modules/vfs_tru64acl.c b/source3/modules/vfs_tru64acl.c index b93ff28fb3d..104397ee0be 100644 --- a/source3/modules/vfs_tru64acl.c +++ b/source3/modules/vfs_tru64acl.c @@ -135,6 +135,7 @@ fail: int tru64acl_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { int res; diff --git a/source3/modules/vfs_vxfs.c b/source3/modules/vfs_vxfs.c index f51d6cfb38b..7bdcd3484a0 100644 --- a/source3/modules/vfs_vxfs.c +++ b/source3/modules/vfs_vxfs.c @@ -485,7 +485,9 @@ out: return ret; } -static int vxfs_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, +static int vxfs_sys_acl_set_fd(vfs_handle_struct *handle, + struct files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { @@ -494,7 +496,7 @@ static int vxfs_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, return 0; } - return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl); + return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl); } static int vxfs_sys_acl_set_file(vfs_handle_struct *handle, diff --git a/source3/modules/vfs_zfsacl.c b/source3/modules/vfs_zfsacl.c index fba7253bbef..ef9ac0eb718 100644 --- a/source3/modules/vfs_zfsacl.c +++ b/source3/modules/vfs_zfsacl.c @@ -545,6 +545,7 @@ static int zfsacl_fail__sys_acl_set_file(vfs_handle_struct *handle, static int zfsacl_fail__sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_TYPE_T type, SMB_ACL_T theacl) { return -1; diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index fb137f29350..87a89fcbd38 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -3061,7 +3061,7 @@ static bool set_canon_ace_list(files_struct *fsp, } } } else { - if (SMB_VFS_SYS_ACL_SET_FD(fsp, the_acl) == -1) { + if (SMB_VFS_SYS_ACL_SET_FD(fsp, SMB_ACL_TYPE_ACCESS, the_acl) == -1) { /* * Some systems allow all the above calls and only fail with no ACL support * when attempting to apply the acl. HPUX with HFS is an example of this. JRA. @@ -3079,7 +3079,9 @@ static bool set_canon_ace_list(files_struct *fsp, fsp_str_dbg(fsp))); become_root(); - sret = SMB_VFS_SYS_ACL_SET_FD(fsp, the_acl); + sret = SMB_VFS_SYS_ACL_SET_FD(fsp, + SMB_ACL_TYPE_ACCESS, + the_acl); unbecome_root(); if (sret == 0) { ret = True; @@ -4559,7 +4561,7 @@ static NTSTATUS remove_posix_acl(connection_struct *conn, } /* Set the new empty file ACL. */ - ret = SMB_VFS_SYS_ACL_SET_FD(fsp, new_file_acl); + ret = SMB_VFS_SYS_ACL_SET_FD(fsp, SMB_ACL_TYPE_ACCESS, new_file_acl); if (ret == -1) { status = map_nt_error_from_unix(errno); DBG_INFO("acl_set_file failed on %s (%s)\n", @@ -4605,7 +4607,7 @@ NTSTATUS set_unix_posix_acl(connection_struct *conn, return map_nt_error_from_unix(errno); } - ret = SMB_VFS_SYS_ACL_SET_FD(fsp, file_acl); + ret = SMB_VFS_SYS_ACL_SET_FD(fsp, SMB_ACL_TYPE_ACCESS, file_acl); if (ret == -1) { status = map_nt_error_from_unix(errno); DBG_INFO("acl_set_file failed on %s (%s)\n", diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index afff32063b5..47277d1dffd 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2776,10 +2776,12 @@ int smb_vfs_call_sys_acl_set_file(struct vfs_handle_struct *handle, } int smb_vfs_call_sys_acl_set_fd(struct vfs_handle_struct *handle, - struct files_struct *fsp, SMB_ACL_T theacl) + struct files_struct *fsp, + SMB_ACL_TYPE_T type, + SMB_ACL_T theacl) { VFS_FIND(sys_acl_set_fd); - return handle->fns->sys_acl_set_fd_fn(handle, fsp, theacl); + return handle->fns->sys_acl_set_fd_fn(handle, fsp, type, theacl); } int smb_vfs_call_sys_acl_delete_def_file(struct vfs_handle_struct *handle, -- 2.47.2