diff --git a/include/functions b/include/functions index 9626eb28..d13f8900 100644 --- a/include/functions +++ b/include/functions @@ -423,6 +423,8 @@ { HOSTID="-" FIND="" + # Avoid some hashes (empty, only zeros) + BLACKLISTED_HASHES="6ef1338f520d075957424741d7ed35ab5966ae97 adc83b19e793491b1c6ea0fd8b46cd9f32e592fc" if [ ! "${SHA1SUMBINARY}" = "" -o ! "${OPENSSLBINARY}" = "" -o ! "${CSUMBINARY}" = "" ]; then case "${OS}" in @@ -574,6 +576,15 @@ ReportException "GetHostID" "Can't create HOSTID as OS is not supported yet by this function" ;; esac + # Remove HOSTID if it contains a default MAC address with a related hash value + if [ ! "${HOSTID}" = "" ]; then + for CHECKHASH in ${BLACKLISTED_HASHES}; do + if [ "${CHECKHASH}" = "${HOSTID}" ]; then + logtext "Result: hostid is a blacklisted value" + HOSTID="" + fi + done + fi else ReportException "GetHostID" "Can't create HOSTID as there is no SHA1 hash tool available (sha1, sha1sum, openssl)" fi