From: Ralph Boehme Date: Mon, 14 Dec 2020 14:42:23 +0000 (+0100) Subject: vfs_audit: support real dirfsps in audit_mkdirat() X-Git-Tag: samba-4.14.0rc1~200 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb3d8b20def699377e48fb32cfed32bf7c716373;p=thirdparty%2Fsamba.git vfs_audit: support real dirfsps in audit_mkdirat() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_audit.c b/source3/modules/vfs_audit.c index bf0e043f505..f62591f7be0 100644 --- a/source3/modules/vfs_audit.c +++ b/source3/modules/vfs_audit.c @@ -182,18 +182,28 @@ static int audit_mkdirat(vfs_handle_struct *handle, const struct smb_filename *smb_fname, mode_t mode) { + struct smb_filename *full_fname = NULL; int result; + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + errno = ENOMEM; + return -1; + } + result = SMB_VFS_NEXT_MKDIRAT(handle, dirfsp, smb_fname, mode); syslog(audit_syslog_priority(handle), "mkdirat %s %s%s\n", - smb_fname->base_name, + full_fname->base_name, (result < 0) ? "failed: " : "", (result < 0) ? strerror(errno) : ""); + TALLOC_FREE(full_fname); return result; }