summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_full_audit.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2021-02-11 10:59:18 -0800
committerJeremy Allison <jra@samba.org>2021-02-13 00:17:31 +0000
commitb500162b0118b61c1ef702f489dc83f1ce3e2571 (patch)
tree35bc9ec2527e8f8e526ec5cc75cf812ac872e8f2 /source3/modules/vfs_full_audit.c
parent3e256f508c4529a6ba61945029de525cbc0db6b2 (diff)
downloadsamba-b500162b0118b61c1ef702f489dc83f1ce3e2571.tar.gz
s3: VFS: full_audit: Fix smb_full_audit_readlinkat() to cope with real directory fsps.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'source3/modules/vfs_full_audit.c')
-rw-r--r--source3/modules/vfs_full_audit.c12
1 files changed, 11 insertions, 1 deletions
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;
}