summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/debug.c6
-rw-r--r--source3/modules/vfs_full_audit.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index e7dcfb4fdf..2e19f89863 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -856,6 +856,12 @@ void check_log_size( void )
else
priority = priority_map[syslog_level];
+ /*
+ * Specify the facility to interoperate with other syslog
+ * callers (vfs_full_audit for example).
+ */
+ priority |= SYSLOG_FACILITY;
+
va_start(ap, format_str);
ret = vasprintf(&msgbuf, format_str, ap);
va_end(ap);
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 667db7a4bd..0f6de79bcf 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -510,6 +510,7 @@ static void do_log(vfs_op_type op, bool success, vfs_handle_struct *handle,
char *audit_pre = NULL;
va_list ap;
char *op_msg = NULL;
+ int priority;
if (success && (!log_success(handle, op)))
goto out;
@@ -530,8 +531,15 @@ static void do_log(vfs_op_type op, bool success, vfs_handle_struct *handle,
goto out;
}
+ /*
+ * Specify the facility to interoperate with other syslog callers
+ * (smbd for example).
+ */
+ priority = audit_syslog_priority(handle) |
+ audit_syslog_facility(handle);
+
audit_pre = audit_prefix(talloc_tos(), handle->conn);
- syslog(audit_syslog_priority(handle), "%s|%s|%s|%s\n",
+ syslog(priority, "%s|%s|%s|%s\n",
audit_pre ? audit_pre : "",
audit_opname(op), err_msg, op_msg);
@@ -606,7 +614,9 @@ static int smb_full_audit_connect(vfs_handle_struct *handle,
}
ZERO_STRUCTP(pd);
+#ifndef WITH_SYSLOG
openlog("smbd_audit", 0, audit_syslog_facility(handle));
+#endif
init_bitmap(&pd->success_ops,
lp_parm_string_list(SNUM(handle->conn), "full_audit", "success",