mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-26 23:34:25 +02:00
Security: test all parameters and arguments for the presence of control characters
This commit is contained in:
parent
fdacc00b45
commit
cfaea21430
@ -22,8 +22,21 @@
|
||||
#
|
||||
#################################################################################
|
||||
#
|
||||
# Check number of parameters submitted (at least one is needed)
|
||||
PARAMCOUNT=$#
|
||||
|
||||
|
||||
# Input validation on provided parameters and their arguments
|
||||
COUNT=0
|
||||
for I in "$@"; do
|
||||
COUNT=$((COUNT + 1))
|
||||
if ! SafeInput "${I}"; then
|
||||
echo "Execution of ${PROGRAM_NAME} stopped as we found unexpected input or invalid characters in argument ${COUNT}"
|
||||
echo "Do you believe this is in error? Let us know: ${PROGRAM_AUTHOR_CONTACT}"
|
||||
ExitFatal
|
||||
fi
|
||||
done
|
||||
|
||||
# Parse arguments
|
||||
while [ $# -ge 1 ]; do
|
||||
case $1 in
|
||||
# Helpers first
|
||||
|
Loading…
x
Reference in New Issue
Block a user