mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-23 22:04:39 +02:00
Allow forward slash in SafeInput check
This commit is contained in:
parent
f08cde63d6
commit
f2ac59a130
@ -3052,12 +3052,12 @@
|
|||||||
|
|
||||||
SafeInput() {
|
SafeInput() {
|
||||||
exitcode=1
|
exitcode=1
|
||||||
# By default remove only special or undefined characters
|
# Test against the string with a generic test set
|
||||||
if [ $# -eq 1 ]; then
|
if [ $# -eq 1 ]; then
|
||||||
input="$1"
|
input="$1"
|
||||||
# Allow only a common set of characters in first parameter
|
# Only allow common set of characters: a-z, A-Z, 0-9, /._-:=
|
||||||
cleaned=$(echo "$input" | sed 's/[^a-zA-Z0-9\._:=-]//g')
|
cleaned=$(echo "$input" | sed 's/[^a-zA-Z0-9\/\._:=-]//g')
|
||||||
# If know what to test against, then see if input matches the specified class
|
# If two parameters are specified, then test input against specified class
|
||||||
elif [ $# -eq 2 ]; then
|
elif [ $# -eq 2 ]; then
|
||||||
input="$1"
|
input="$1"
|
||||||
testchars="$2"
|
testchars="$2"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user