From: Jeremy Allison Date: Thu, 11 Feb 2021 18:59:18 +0000 (-0800) Subject: s3: VFS: full_audit: Fix smb_full_audit_readlinkat() to cope with real directory... X-Git-Tag: tevent-0.11.0~1759 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b500162b0118b61c1ef702f489dc83f1ce3e2571;p=thirdparty%2Fsamba.git s3: VFS: full_audit: Fix smb_full_audit_readlinkat() to cope with real directory fsps. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 7d47871680d..cfb9ba4fcef 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -1846,8 +1846,16 @@ static int smb_full_audit_readlinkat(vfs_handle_struct *handle, char *buf, size_t bufsiz) { + struct smb_filename *full_fname = NULL; int result; + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + return -1; + } + result = SMB_VFS_NEXT_READLINKAT(handle, dirfsp, smb_fname, @@ -1858,7 +1866,9 @@ static int smb_full_audit_readlinkat(vfs_handle_struct *handle, (result >= 0), handle, "%s", - smb_fname_str_do_log(handle->conn, smb_fname)); + smb_fname_str_do_log(handle->conn, full_fname)); + + TALLOC_FREE(full_fname); return result; }