diff options
author | Jeremy Allison <jra@samba.org> | 2021-02-01 13:08:46 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2021-02-09 00:10:29 +0000 |
commit | 2952cfe0edaaec44ee1fbd1966fb9a50a9122399 (patch) | |
tree | 02cdff69f487f69530990c71fb0e1fc59fae4fa0 /source3/modules/vfs_full_audit.c | |
parent | 2d6011e8c85d1cadf7ea951aa76a0dfc64017002 (diff) | |
download | samba-2952cfe0edaaec44ee1fbd1966fb9a50a9122399.tar.gz |
s3: VFS: full_audit: Fix smb_full_audit_linkat() to cope with real directory fsps.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Diffstat (limited to 'source3/modules/vfs_full_audit.c')
-rw-r--r-- | source3/modules/vfs_full_audit.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 71577c8aaeb..7d47871680d 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -1870,8 +1870,23 @@ static int smb_full_audit_linkat(vfs_handle_struct *handle, const struct smb_filename *new_smb_fname, int flags) { + struct smb_filename *old_full_fname = NULL; + struct smb_filename *new_full_fname = NULL; int result; + old_full_fname = full_path_from_dirfsp_atname(talloc_tos(), + srcfsp, + old_smb_fname); + if (old_full_fname == NULL) { + return -1; + } + new_full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dstfsp, + new_smb_fname); + if (new_full_fname == NULL) { + TALLOC_FREE(old_full_fname); + return -1; + } result = SMB_VFS_NEXT_LINKAT(handle, srcfsp, old_smb_fname, @@ -1883,8 +1898,11 @@ static int smb_full_audit_linkat(vfs_handle_struct *handle, (result >= 0), handle, "%s|%s", - smb_fname_str_do_log(handle->conn, old_smb_fname), - smb_fname_str_do_log(handle->conn, new_smb_fname)); + smb_fname_str_do_log(handle->conn, old_full_fname), + smb_fname_str_do_log(handle->conn, new_full_fname)); + + TALLOC_FREE(old_full_fname); + TALLOC_FREE(new_full_fname); return result; } |