diff --git a/include/tests_homedirs b/include/tests_homedirs index c634cb44..d3c2e2af 100644 --- a/include/tests_homedirs +++ b/include/tests_homedirs @@ -99,7 +99,7 @@ EOF LogText "Test: checking directory '${DIR}' for user '${USER}'" if [ -d "${DIR}" ]; then OWNER=$(ls -ld ${DIR} | awk -F" " '{ print $3 }') - if [ ! "${OWNER}" = "${USER}" ]; then + if [ ! "$(id -u "${OWNER}")" = "$(id -u "${USER}")" ]; then LogText "Result: the home directory ${DIR} of user ${USER} is owned by ${OWNER}. Correct: chown ${USER} ${DIR}" FOUND=1 else