mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-27 07:44:14 +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=$#
|
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
|
while [ $# -ge 1 ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
# Helpers first
|
# Helpers first
|
||||||
|
Loading…
x
Reference in New Issue
Block a user