mirror of
https://github.com/CISOfy/lynis.git
synced 2026-03-11 08:55:28 +00:00
Allow spaces when using a parameter such as --auditor
This commit is contained in:
parent
4d55f7a0c9
commit
76a4f4dfd8
1 changed files with 5 additions and 2 deletions
|
|
@ -3070,8 +3070,11 @@
|
|||
# Test against the string with a generic test set
|
||||
if [ $# -eq 1 ]; then
|
||||
input="$1"
|
||||
# Only allow common set of characters: a-z, A-Z, 0-9, /._-:=
|
||||
cleaned=$(echo "$input" | sed 's/[^a-zA-Z0-9\/\._:=-]//g')
|
||||
# Use sed to strip all characters -except- those that are allowed
|
||||
# - Common set of characters: a-z, A-Z, 0-9
|
||||
# - Special characters: , /._-:=
|
||||
# - Space for names (like auditor name)
|
||||
cleaned=$(echo "$input" | sed 's/[^[:space:]a-zA-Z0-9\/\._:=-]//g')
|
||||
# If two parameters are specified, then test input against specified class
|
||||
elif [ $# -eq 2 ]; then
|
||||
input="$1"
|
||||
|
|
|
|||
Loading…
Reference in a new issue