mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Use LDAP RemovalHook
instead of implementing connection_state_remove
This commit is contained in:
parent
1d4412a9e7
commit
82b3a4048f
1 changed files with 5 additions and 2 deletions
|
@ -30,6 +30,9 @@ export {
|
||||||
## Default logging policy hook for LDAP_SEARCH_LOG.
|
## Default logging policy hook for LDAP_SEARCH_LOG.
|
||||||
global log_policy_search: Log::PolicyHook;
|
global log_policy_search: Log::PolicyHook;
|
||||||
|
|
||||||
|
## LDAP finalization hook.
|
||||||
|
global finalize_ldap: Conn::RemovalHook;
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# This is the format of ldap.log (ldap operations minus search-related)
|
# This is the format of ldap.log (ldap operations minus search-related)
|
||||||
# Each line represents a unique connection+message_id (requests/responses)
|
# Each line represents a unique connection+message_id (requests/responses)
|
||||||
|
@ -161,6 +164,7 @@ event zeek_init() &priority=5 {
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
function set_session(c: connection, message_id: int, opcode: LDAP::ProtocolOpcode) {
|
function set_session(c: connection, message_id: int, opcode: LDAP::ProtocolOpcode) {
|
||||||
|
Conn::register_removal_hook(c, finalize_ldap);
|
||||||
|
|
||||||
if (! c?$ldap_messages )
|
if (! c?$ldap_messages )
|
||||||
c$ldap_messages = table();
|
c$ldap_messages = table();
|
||||||
|
@ -363,8 +367,7 @@ event LDAP::bindreq(c: connection,
|
||||||
}
|
}
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
event connection_state_remove(c: connection) {
|
hook finalize_ldap(c: connection) {
|
||||||
|
|
||||||
# log any "pending" unlogged LDAP messages/searches
|
# log any "pending" unlogged LDAP messages/searches
|
||||||
|
|
||||||
if ( c?$ldap_messages && (|c$ldap_messages| > 0) ) {
|
if ( c?$ldap_messages && (|c$ldap_messages| > 0) ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue