mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote-tracking branch 'origin/topic/robin/gh-54-sanitize'
* origin/topic/robin/gh-54-sanitize: Sanitize log files names before they go into system().
This commit is contained in:
parent
a49dcc8954
commit
0a0ed65306
8 changed files with 52 additions and 7 deletions
|
@ -384,12 +384,13 @@ function log_mailing_postprocessor(info: Log::RotationInfo): bool
|
|||
{
|
||||
local headers = email_headers(fmt("Log Contents: %s", info$fname),
|
||||
mail_dest);
|
||||
local tmpfilename = fmt("%s.mailheaders.tmp", info$fname);
|
||||
local tmpfilename = safe_shell_quote(fmt("%s.mailheaders.tmp", info$fname));
|
||||
local tmpfile = open(tmpfilename);
|
||||
write_file(tmpfile, headers);
|
||||
close(tmpfile);
|
||||
system(fmt("/bin/cat %s %s | %s -t -oi && /bin/rm %s %s",
|
||||
tmpfilename, info$fname, sendmail, tmpfilename, info$fname));
|
||||
tmpfilename, safe_shell_quote(info$fname), sendmail,
|
||||
tmpfilename, safe_shell_quote(info$fname)));
|
||||
}
|
||||
return T;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue