mirror of https://github.com/CISOfy/lynis.git
[SSH-7406] instead of just carriage return, strip all control characters
This commit is contained in:
parent
94c089e175
commit
1a512984c1
|
@ -102,7 +102,7 @@
|
|||
if [ ${OPENSSHD_RUNNING} -eq 1 ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
||||
Register --test-no SSH-7406 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Determine OpenSSH version"
|
||||
if [ ${SKIPTEST} -eq 0 ]; then
|
||||
OPENSSHD_VERSION=$(${SSHDBINARY} -t -d 2>&1 | ${GREPBINARY} 'sshd version' | ${AWKBINARY} '{if($4~OpenSSH_){print $4}}' | ${AWKBINARY} -F_ '{print $2}' | ${TRBINARY} -d ',' | ${TRBINARY} -d '\r')
|
||||
OPENSSHD_VERSION=$(${SSHDBINARY} -t -d 2>&1 | ${GREPBINARY} 'sshd version' | ${AWKBINARY} '{if($4~OpenSSH_){print $4}}' | ${AWKBINARY} -F_ '{print $2}' | ${TRBINARY} -d '[:cntrl:],')
|
||||
LogText "Result: discovered OpenSSH version is ${OPENSSHD_VERSION}"
|
||||
if [ ! -z ${OPENSSHD_VERSION} ]; then
|
||||
OPENSSHD_VERSION_MAJOR=$(echo ${OPENSSHD_VERSION%%p*} | ${AWKBINARY} -F. '{print $1}')
|
||||
|
|
Loading…
Reference in New Issue