mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-28 00:04:16 +02:00
Merge pull request #1061 from Varbin/solaris-hostname
Simplify tr hostname checking expression
This commit is contained in:
commit
37631b0457
@ -70,7 +70,7 @@
|
|||||||
LogText "Result: hostnamed is defined and not longer than 63 characters"
|
LogText "Result: hostnamed is defined and not longer than 63 characters"
|
||||||
fi
|
fi
|
||||||
# Test valid characters (normally a dot should not be in the name, but we can't be 100% sure we have short name)
|
# Test valid characters (normally a dot should not be in the name, but we can't be 100% sure we have short name)
|
||||||
FIND=$(echo "${HOSTNAME}" | ${TRBINARY} -d '[a-zA-Z0-9\.\-]')
|
FIND=$(echo "${HOSTNAME}" | ${TRBINARY} -d '[:alnum:]\.\-')
|
||||||
if [ -z "${FIND}" ]; then
|
if [ -z "${FIND}" ]; then
|
||||||
LogText "Result: good, no unexpected characters discovered in hostname"
|
LogText "Result: good, no unexpected characters discovered in hostname"
|
||||||
if IsVerbose; then Display --indent 2 --text "- Hostname (allowed characters)" --result "${STATUS_OK}" --color GREEN; fi
|
if IsVerbose; then Display --indent 2 --text "- Hostname (allowed characters)" --result "${STATUS_OK}" --color GREEN; fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user