From abc16fafd9d387974b4dfaed2d2aa3a979fb8404 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 30 Apr 2020 11:51:15 +0200 Subject: [PATCH] vfs_vxfs: pass name as struct smb_filename to vxfs_compare() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/modules/vfs_vxfs.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/source3/modules/vfs_vxfs.c b/source3/modules/vfs_vxfs.c index 5b865434d9d..fbc68d6bec5 100644 --- a/source3/modules/vfs_vxfs.c +++ b/source3/modules/vfs_vxfs.c @@ -397,10 +397,11 @@ static bool vxfs_compare_acls(char *e_buf, char *n_buf, int n_count, */ static bool vxfs_compare(connection_struct *conn, - char *name, + const struct smb_filename *smb_fname, SMB_ACL_T the_acl, SMB_ACL_TYPE_T the_acl_type) { + char *name = smb_fname->base_name; SMB_ACL_T existing_acl = NULL; bool ret = false; int i, count = 0; @@ -411,12 +412,6 @@ static bool vxfs_compare(connection_struct *conn, DEBUG(10, ("vfs_vxfs: Getting existing ACL for %s\n", name)); - smb_fname = synthetic_smb_fname(mem_ctx, name, NULL, NULL, 0); - if (smb_fname == NULL) { - DEBUG(10, ("vfs_vxfs: Failed to create smb_fname\n")); - goto out; - } - existing_acl = SMB_VFS_SYS_ACL_GET_FILE(conn, smb_fname, the_acl_type, mem_ctx); if (existing_acl == NULL) { @@ -481,7 +476,6 @@ static bool vxfs_compare(connection_struct *conn, out: TALLOC_FREE(existing_acl); - TALLOC_FREE(smb_fname); TALLOC_FREE(existing_buf); TALLOC_FREE(compact_buf); TALLOC_FREE(new_buf); @@ -493,7 +487,7 @@ static int vxfs_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl) { - if (vxfs_compare(fsp->conn, fsp->fsp_name->base_name, theacl, + if (vxfs_compare(fsp->conn, fsp->fsp_name, theacl, SMB_ACL_TYPE_ACCESS)) { return 0; } @@ -506,7 +500,7 @@ static int vxfs_sys_acl_set_file(vfs_handle_struct *handle, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) { - if (vxfs_compare(handle->conn, (char *)smb_fname->base_name, + if (vxfs_compare(handle->conn, smb_fname, theacl, acltype)) { return 0; } -- 2.47.3