]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: full_audit: Fix smb_full_audit_readlinkat() to cope with real directory...
authorJeremy Allison <jra@samba.org>
Thu, 11 Feb 2021 18:59:18 +0000 (10:59 -0800)
committerJeremy Allison <jra@samba.org>
Sat, 13 Feb 2021 00:17:31 +0000 (00:17 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
source3/modules/vfs_full_audit.c

index 7d47871680da1eb4eebd5e3b2838544f0b45fe6a..cfb9ba4fcefbbdbbb147835cfd2e9fea162159db 100644 (file)
@@ -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;
 }