mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
krb/smb2_krb_nokeytab: Register get_file_handle() to avoid warnings
Now that the common event handler logs a warning, ensure there's one in place, even if it's just returning stub data.
This commit is contained in:
parent
d8b4667f80
commit
b928a7d84d
1 changed files with 30 additions and 6 deletions
|
@ -8,13 +8,37 @@
|
||||||
# @TEST-EXEC: btest-diff .stdout
|
# @TEST-EXEC: btest-diff .stdout
|
||||||
# @TEST-EXEC: btest-diff .stderr
|
# @TEST-EXEC: btest-diff .stderr
|
||||||
|
|
||||||
|
module SMB;
|
||||||
|
|
||||||
|
export {
|
||||||
|
global get_file_handle: function(c: connection, is_orig: bool): string;
|
||||||
|
global describe_file: function(f: fa_file): string;
|
||||||
|
}
|
||||||
|
|
||||||
global monitor_ports: set[port] = { 445/tcp, 139/tcp } &redef;
|
global monitor_ports: set[port] = { 445/tcp, 139/tcp } &redef;
|
||||||
|
|
||||||
event zeek_init() &priority=5{
|
|
||||||
|
# Stubs for testing so that we don't produce a warning due
|
||||||
|
# to missing get_file_handle() handlers for SMB.
|
||||||
|
function get_file_handle(c: connection, is_orig: bool): string
|
||||||
|
{
|
||||||
|
return cat(c$uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
function describe_file(f: fa_file): string
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
event zeek_init() &priority=5
|
||||||
|
{
|
||||||
Analyzer::register_for_ports(Analyzer::ANALYZER_SMB, monitor_ports);
|
Analyzer::register_for_ports(Analyzer::ANALYZER_SMB, monitor_ports);
|
||||||
}
|
Files::register_protocol(Analyzer::ANALYZER_SMB,
|
||||||
|
[$get_file_handle = SMB::get_file_handle,
|
||||||
|
$describe = SMB::describe_file]);
|
||||||
|
}
|
||||||
|
|
||||||
event krb_ap_request(c: connection, ticket: KRB::Ticket, opts: KRB::AP_Options){
|
event krb_ap_request(c: connection, ticket: KRB::Ticket, opts: KRB::AP_Options)
|
||||||
|
{
|
||||||
print ticket?$authenticationinfo;
|
print ticket?$authenticationinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue