mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-06-28 07:36:43 +00:00
Fix for issue #47.
Introduces a new function in helper_lib.sh to query the command line arguments of the running instances of a binary. This is done to get rid of the problem of "-lf" versus "-alf" for pgrep. Signed-off-by: Joachim Lusiardi <joachim@lusiardi.de>
This commit is contained in:
parent
62a903246c
commit
fc8eefb8a6
2 changed files with 21 additions and 10 deletions
|
@ -36,3 +36,13 @@ contains() {
|
|||
return 1 # $substring is not in $string
|
||||
fi
|
||||
}
|
||||
|
||||
# Extracts all commandline args from all running processes named like the first parameter
|
||||
get_command_line_args() {
|
||||
PROC="$1"
|
||||
|
||||
for PID in `pgrep $PROC`
|
||||
do
|
||||
cat /proc/$PID/cmdline | tr "\0" " "
|
||||
done
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue