summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/auditlog.c
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-03-28 23:30:46 +0000
committerRich Megginson <rmeggins@redhat.com>2005-03-28 23:30:46 +0000
commit54fdf73874abce4f4f5adaaa4d7782113cfd2264 (patch)
tree0160d0c845d9063550c308120433bd3505ca2592 /ldap/servers/slapd/auditlog.c
parent5f1bf72ea46556894d5956ea13f099b7de6dfdf3 (diff)
downloadds-54fdf73874abce4f4f5adaaa4d7782113cfd2264.tar.gz
ds-54fdf73874abce4f4f5adaaa4d7782113cfd2264.tar.xz
ds-54fdf73874abce4f4f5adaaa4d7782113cfd2264.zip
Bug(s) fixed: 151567
Bug Description: Many operations use write_audit_log_entry to write to the audit log. These functions build a string buffer to write to the audit log. The only problem is, they never check to see if audit logging is enabled until after all of this work has been done. write_audit_log_entry should check right away to see if logging is enabled. Should save some time for write operations. Reviewed by: Noriko (Thanks!) Fix Description: The code in auditlog.c is called for every update operation, and in many cases a lot of work is done before it is even known if audit logging is enabled. Perhaps this was because there was no function that could be called outside of the logging code to see if audit logging is enabled. I added config_get_auditlog_logging_enabled() and used it in auditlog.c to skip the code altogether if audit logging is disabled (the default). Platforms tested: RHEL3 Flag Day: no Doc impact: no, the functions are in the private API QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
Diffstat (limited to 'ldap/servers/slapd/auditlog.c')
-rw-r--r--ldap/servers/slapd/auditlog.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ldap/servers/slapd/auditlog.c b/ldap/servers/slapd/auditlog.c
index 0f647db2..e4c3c1c3 100644
--- a/ldap/servers/slapd/auditlog.c
+++ b/ldap/servers/slapd/auditlog.c
@@ -31,7 +31,13 @@ write_audit_log_entry( Slapi_PBlock *pb )
int flag = 0;
int internal_op = 0;
Operation *op;
-
+
+ /* if the audit log is not enabled, just skip all of
+ this stuff */
+ if (!config_get_auditlog_logging_enabled()) {
+ return;
+ }
+
slapi_pblock_get( pb, SLAPI_OPERATION, &op );
internal_op = operation_is_flag_set(op, OP_FLAG_INTERNAL);
slapi_pblock_get( pb, SLAPI_TARGET_DN, &dn );