1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3: VFS: syncops: Do early returns in SYNCOPS_NEXT_SMB_FNAME() macro.

Makes the macro much clearer.

We should always do the operation first, then try the sync.
Failure to sync is not reported as an error, so failure
to create the full_fname shouldn't fail the operation either.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
This commit is contained in:
Jeremy Allison 2021-06-17 12:23:46 -07:00 committed by Noel Power
parent fbeefe3b7e
commit 5da0d75dd4

View File

@ -170,16 +170,23 @@ static int syncops_renameat(vfs_handle_struct *handle,
SMB_VFS_HANDLE_GET_DATA(handle, config, \
struct syncops_config_data, \
return -1); \
ret = SMB_VFS_NEXT_ ## op args; \
if (ret != 0) { \
return ret; \
} \
if (config->disable) { \
return ret; \
} \
if (!config->onmeta) { \
return ret; \
} \
full_fname = full_path_from_dirfsp_atname(talloc_tos(), \
dirfsp, \
smb_fname); \
if (full_fname == NULL) { \
return -1; \
return ret; \
} \
ret = SMB_VFS_NEXT_ ## op args; \
if (ret == 0 \
&& config->onmeta && !config->disable \
&& fname) syncops_smb_fname(dirfsp->conn, full_fname); \
syncops_smb_fname(dirfsp->conn, full_fname); \
TALLOC_FREE(full_fname); \
return ret; \
} while (0)