mirror of https://github.com/CISOfy/lynis.git
Allow more characters as part of 'lynis configure settings' command
This commit is contained in:
parent
562b1f1bae
commit
2a540ddf75
|
@ -3052,11 +3052,11 @@
|
|||
|
||||
SafeInput() {
|
||||
exitcode=1
|
||||
# By default remove only control characters
|
||||
# By default remove only special or undefined characters
|
||||
if [ $# -eq 1 ]; then
|
||||
input="$1"
|
||||
# cleaned=$(echo ${input} | tr -d '[:cntrl:]')
|
||||
cleaned=$(echo "$input" | sed 's/[^a-zA-Z0-9_-]//g')
|
||||
# Allow only a common set of characters in first parameter
|
||||
cleaned=$(echo "$input" | sed 's/[^a-zA-Z0-9\._:=-]//g')
|
||||
# If know what to test against, then see if input matches the specified class
|
||||
elif [ $# -eq 2 ]; then
|
||||
input="$1"
|
||||
|
@ -3065,7 +3065,7 @@
|
|||
else
|
||||
ExitFatal "No argument or too many arguments provided to SafeInput()"
|
||||
fi
|
||||
|
||||
# Test if the cleaned string is the same as the original input
|
||||
if [ "${cleaned}" = "${input}" ]; then
|
||||
exitcode=0
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue