From e917269d011a2c314485a91ca340ea539ed47738 Mon Sep 17 00:00:00 2001 From: Simon Biewald Date: Sun, 9 Aug 2020 00:35:12 +0000 Subject: [PATCH] Reduce tr hostname checking expression Solaris' tr does not support full regular expressions. --- include/tests_networking | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/tests_networking b/include/tests_networking index 420f26ea..d41132f2 100644 --- a/include/tests_networking +++ b/include/tests_networking @@ -70,7 +70,7 @@ LogText "Result: hostnamed is defined and not longer than 63 characters" fi # 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 '[:alpha:]' | ${TRBINARY} -d '.-') if [ -z "${FIND}" ]; then 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