mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Fix a bug with path building in FTP. Came up when changing the path utils.
This commit is contained in:
parent
60605412ab
commit
8f987e5066
1 changed files with 7 additions and 9 deletions
|
@ -174,8 +174,9 @@ function ftp_message(s: Info)
|
||||||
if ( s$cmdarg$cmd in file_cmds )
|
if ( s$cmdarg$cmd in file_cmds )
|
||||||
{
|
{
|
||||||
local comp_path = build_path_compressed(s$cwd, arg);
|
local comp_path = build_path_compressed(s$cwd, arg);
|
||||||
if ( s$cwd[0] != "/" )
|
if ( comp_path[0] != "/" )
|
||||||
comp_path = cat("/", comp_path);
|
comp_path = cat("/", comp_path);
|
||||||
|
|
||||||
arg = fmt("ftp://%s%s", addr_to_uri(s$id$resp_h), comp_path);
|
arg = fmt("ftp://%s%s", addr_to_uri(s$id$resp_h), comp_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,16 +246,13 @@ event ftp_request(c: connection, command: string, arg: string) &priority=5
|
||||||
|
|
||||||
event ftp_reply(c: connection, code: count, msg: string, cont_resp: bool) &priority=5
|
event ftp_reply(c: connection, code: count, msg: string, cont_resp: bool) &priority=5
|
||||||
{
|
{
|
||||||
# TODO: figure out what to do with continued FTP response (not used much)
|
|
||||||
#if ( cont_resp ) return;
|
|
||||||
|
|
||||||
local id = c$id;
|
|
||||||
set_ftp_session(c);
|
set_ftp_session(c);
|
||||||
|
|
||||||
c$ftp$cmdarg = get_pending_cmd(c$ftp$pending_commands, code, msg);
|
c$ftp$cmdarg = get_pending_cmd(c$ftp$pending_commands, code, msg);
|
||||||
|
|
||||||
c$ftp$reply_code = code;
|
c$ftp$reply_code = code;
|
||||||
c$ftp$reply_msg = msg;
|
c$ftp$reply_msg = msg;
|
||||||
|
|
||||||
|
# TODO: figure out what to do with continued FTP response (not used much)
|
||||||
|
if ( cont_resp ) return;
|
||||||
|
|
||||||
# TODO: do some sort of generic clear text login processing here.
|
# TODO: do some sort of generic clear text login processing here.
|
||||||
local response_xyz = parse_ftp_reply_code(code);
|
local response_xyz = parse_ftp_reply_code(code);
|
||||||
|
@ -283,10 +281,10 @@ event ftp_reply(c: connection, code: count, msg: string, cont_resp: bool) &prior
|
||||||
c$ftp$passive=T;
|
c$ftp$passive=T;
|
||||||
|
|
||||||
if ( code == 229 && data$h == [::] )
|
if ( code == 229 && data$h == [::] )
|
||||||
data$h = id$resp_h;
|
data$h = c$id$resp_h;
|
||||||
|
|
||||||
ftp_data_expected[data$h, data$p] = c$ftp;
|
ftp_data_expected[data$h, data$p] = c$ftp;
|
||||||
expect_connection(id$orig_h, data$h, data$p, ANALYZER_FILE, 5mins);
|
expect_connection(c$id$orig_h, data$h, data$p, ANALYZER_FILE, 5mins);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue