From: Jeremy Allison Date: Wed, 4 Sep 2019 22:46:08 +0000 (-0700) Subject: s3: VFS: vfs_extd_audit. Implement mkdirat(). X-Git-Tag: talloc-2.3.1~901 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5ac30233e36072a899463b18694a24872e865dc;p=thirdparty%2Fsamba.git s3: VFS: vfs_extd_audit. Implement mkdirat(). Currently identical to mkdir(). Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_extd_audit.c b/source3/modules/vfs_extd_audit.c index 70c889c4675..fc820c2c13f 100644 --- a/source3/modules/vfs_extd_audit.c +++ b/source3/modules/vfs_extd_audit.c @@ -232,6 +232,32 @@ static int audit_mkdir(vfs_handle_struct *handle, return result; } +static int audit_mkdirat(vfs_handle_struct *handle, + struct files_struct *dirfsp, + const struct smb_filename *smb_fname, + mode_t mode) +{ + int result; + + result = SMB_VFS_NEXT_MKDIRAT(handle, + dirfsp, + smb_fname, + mode); + + if (lp_syslog() > 0) { + syslog(audit_syslog_priority(handle), "mkdirat %s %s%s\n", + smb_fname->base_name, + (result < 0) ? "failed: " : "", + (result < 0) ? strerror(errno) : ""); + } + DEBUG(0, ("vfs_extd_audit: mkdirat %s %s %s\n", + smb_fname->base_name, + (result < 0) ? "failed: " : "", + (result < 0) ? strerror(errno) : "")); + + return result; +} + static int audit_rmdir(vfs_handle_struct *handle, const struct smb_filename *smb_fname) { @@ -394,6 +420,7 @@ static struct vfs_fn_pointers vfs_extd_audit_fns = { .disconnect_fn = audit_disconnect, .opendir_fn = audit_opendir, .mkdir_fn = audit_mkdir, + .mkdirat_fn = audit_mkdirat, .rmdir_fn = audit_rmdir, .open_fn = audit_open, .close_fn = audit_close,