mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 02:58:20 +00:00
Deprecate str_shell_escape, add safe_shell_quote replacement
This commit is contained in:
parent
8b29df96cc
commit
dbf5d5fc95
11 changed files with 83 additions and 17 deletions
2
testing/btest/Baseline/bifs.safe_shell_quote/out
Normal file
2
testing/btest/Baseline/bifs.safe_shell_quote/out
Normal file
|
@ -0,0 +1,2 @@
|
|||
echo `pwd` ${TEST} > "my file"; echo -e "\n"
|
||||
"echo \`pwd\` \${TEST} > \"my file\"; echo -e \"\\n\""
|
12
testing/btest/bifs/safe_shell_quote.bro
Normal file
12
testing/btest/bifs/safe_shell_quote.bro
Normal file
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
# @TEST-EXEC: bro -b %INPUT >out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
local a = "echo `pwd` ${TEST} > \"my file\"; echo -e \"\\n\"";
|
||||
print a;
|
||||
|
||||
local b = safe_shell_quote(a);
|
||||
print b;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue