summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-08-07 10:34:18 +0000
committerJeremy Allison <jra@samba.org>2014-08-07 22:12:12 +0200
commitb76bc4b71363401850e18ef1dce14f5a737635d3 (patch)
treec846cc459ade31dce06da7f748eb52e5d8fa89b6
parent7efee03c84fed372689fff73839cb4fb8724a558 (diff)
downloadsamba-b76bc4b71363401850e18ef1dce14f5a737635d3.tar.gz
samba-b76bc4b71363401850e18ef1dce14f5a737635d3.tar.xz
samba-b76bc4b71363401850e18ef1dce14f5a737635d3.zip
vfs_full_audit: Save full_audit:priority in private_data
lp_parm_enum can become expensive Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/modules/vfs_full_audit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index ec886c52bd..00af87c53b 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -74,6 +74,7 @@ struct vfs_full_audit_private_data {
struct bitmap *success_ops;
struct bitmap *failure_ops;
int syslog_facility;
+ int syslog_priority;
};
#undef DBGC_CLASS
@@ -521,7 +522,7 @@ static void do_log(vfs_op_type op, bool success, vfs_handle_struct *handle,
* Specify the facility to interoperate with other syslog callers
* (smbd for example).
*/
- priority = audit_syslog_priority(handle) | pd->syslog_facility;
+ priority = pd->syslog_priority | pd->syslog_facility;
audit_pre = audit_prefix(talloc_tos(), handle->conn);
syslog(priority, "%s|%s|%s|%s\n",
@@ -590,6 +591,8 @@ static int smb_full_audit_connect(vfs_handle_struct *handle,
return -1;
}
+ pd->syslog_priority = audit_syslog_priority(handle);
+
#ifdef WITH_SYSLOG
openlog("smbd_audit", 0, pd->syslog_facility);
#endif