From 91cd0e87f92b3aa2e960a4d697c470a48df52ee2 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 3 Jun 2021 10:49:06 -0700 Subject: [PATCH] s3/smbd: make posix_sys_acl_blob_get_fd actually use handle api with the changes to underlying sys_acl_get_fd_fn we now can pass the acl type down Signed-off-by: Noel Power Reviewed-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/posix_acls.c | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index 2d533b43733..388e471363b 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -4657,44 +4657,18 @@ int posix_sys_acl_blob_get_fd(vfs_handle_struct *handle, SMB_STRUCT_STAT sbuf; TALLOC_CTX *frame; struct smb_acl_wrapper acl_wrapper = { 0 }; - int fd = fsp_get_pathref_fd(fsp); - char buf[PATH_MAX] = {0}; - struct smb_filename fname; int ret; - if (fsp->fsp_flags.have_proc_fds) { - const char *proc_fd_path = NULL; - - proc_fd_path = sys_proc_fd_path(fd, buf, sizeof(buf)); - if (proc_fd_path == NULL) { - return -1; - } - - fname = (struct smb_filename) { - .base_name = discard_const_p(char, proc_fd_path), - }; - } else { - /* - * This is no longer a handle based call. - */ - - fname = (struct smb_filename) { - .base_name = fsp->fsp_name->base_name, - }; - } - frame = talloc_stackframe(); - acl_wrapper.access_acl = smb_vfs_call_sys_acl_get_file( - handle, - &fname, + acl_wrapper.access_acl = smb_vfs_call_sys_acl_get_fd(handle, + fsp, SMB_ACL_TYPE_ACCESS, frame); if (fsp->fsp_flags.is_directory) { - acl_wrapper.default_acl = smb_vfs_call_sys_acl_get_file( - handle, - &fname, + acl_wrapper.default_acl = smb_vfs_call_sys_acl_get_fd(handle, + fsp, SMB_ACL_TYPE_DEFAULT, frame); } -- 2.47.3