mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-25 23:05:01 +02:00
Long format for od does not exist on BSD
This commit is contained in:
parent
34f306eb0b
commit
4829ae9722
@ -35,10 +35,8 @@
|
|||||||
|
|
||||||
# Show deprecation message for old config entries
|
# Show deprecation message for old config entries
|
||||||
FOUND=0
|
FOUND=0
|
||||||
#DATA=$(egrep "^config:" ${PROFILE} | od --address-radix=none -t a | sed 's/ /!space!/g')
|
# Items such as 'config:' and 'apache:'
|
||||||
#if ! IsEmpty "${DATA}"; then FOUND=1; fi
|
DATA=$(egrep "^[a-z-]{1,}:" ${PROFILE} | od -An -ta | sed 's/ /!space!/g') # od -An (no file offset), -ta (named character, to be on safe side)
|
||||||
# Items such as 'apache:'
|
|
||||||
DATA=$(egrep "^[a-z-]{1,}:" ${PROFILE} | od --address-radix=none -t a | sed 's/ /!space!/g')
|
|
||||||
if ! IsEmpty "${DATA}"; then FOUND=1; fi
|
if ! IsEmpty "${DATA}"; then FOUND=1; fi
|
||||||
|
|
||||||
if [ ${FOUND} -eq 1 ]; then
|
if [ ${FOUND} -eq 1 ]; then
|
||||||
@ -49,7 +47,7 @@
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Security check for unexpected and possibly harmful escape characters
|
# Security check for unexpected and possibly harmful escape characters
|
||||||
DATA=$(grep -v '^$\|^ \|^#\|^config:' ${PROFILE} | tr -d '[:alnum:]/\[\]\(\)\-_\|,\.:;= \n\r' | od --address-radix=none -t a | sed 's/ /!space!/g')
|
DATA=$(grep -v '^$\|^ \|^#\|^config:' ${PROFILE} | tr -d '[:alnum:]/\[\]\(\)\-_\|,\.:;= \n\r' | od -An -ta | sed 's/ /!space!/g')
|
||||||
if ! IsEmpty "${DATA}"; then
|
if ! IsEmpty "${DATA}"; then
|
||||||
DisplayWarning "Your profile '${PROFILE}' contains unexpected characters. See the log file for more information."
|
DisplayWarning "Your profile '${PROFILE}' contains unexpected characters. See the log file for more information."
|
||||||
LogText "Found unexpected or possibly harmful characters in the profile. See output below."
|
LogText "Found unexpected or possibly harmful characters in the profile. See output below."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user