From 4c004d1633a3ea358d2c929d5a29ec475945efff Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 20 Jan 2021 12:11:01 -0800 Subject: [PATCH] VFS: syncops: Fixup all uses of the SYNCOPS_NEXT_SMB_FNAME macro to correctly use the dirfsp path. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Remove the temp solution added to syncops_mkdirat() as we now have a generic fix. Missed in my original fixes. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Böhme --- source3/modules/vfs_syncops.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/source3/modules/vfs_syncops.c b/source3/modules/vfs_syncops.c index 6fb05e52e30..043304feb3c 100644 --- a/source3/modules/vfs_syncops.c +++ b/source3/modules/vfs_syncops.c @@ -155,14 +155,22 @@ static int syncops_renameat(vfs_handle_struct *handle, #define SYNCOPS_NEXT_SMB_FNAME(op, fname, args) do { \ int ret; \ + struct smb_filename *full_fname = NULL; \ struct syncops_config_data *config; \ SMB_VFS_HANDLE_GET_DATA(handle, config, \ struct syncops_config_data, \ return -1); \ + full_fname = full_path_from_dirfsp_atname(talloc_tos(), \ + dirfsp, \ + smb_fname); \ + if (full_fname == NULL) { \ + return -1; \ + } \ ret = SMB_VFS_NEXT_ ## op args; \ if (ret == 0 \ && config->onmeta && !config->disable \ - && fname) syncops_smb_fname(fname); \ + && fname) syncops_smb_fname(full_fname); \ + TALLOC_FREE(full_fname); \ return ret; \ } while (0) @@ -265,24 +273,12 @@ static int syncops_mkdirat(vfs_handle_struct *handle, const struct smb_filename *smb_fname, mode_t mode) { - struct smb_filename *full_fname = NULL; - - full_fname = full_path_from_dirfsp_atname(talloc_tos(), - dirfsp, - smb_fname); - if (full_fname == NULL) { - errno = ENOMEM; - return -1; - } - SYNCOPS_NEXT_SMB_FNAME(MKDIRAT, full_fname, (handle, dirfsp, smb_fname, mode)); - - TALLOC_FREE(full_fname); } /* close needs to be handled specially */ -- 2.34.1