Update tests_homedirs

This commit is contained in:
Anthony Di Pietro 2025-10-11 05:49:02 +00:00 committed by GitHub
parent a0164727d8
commit 423581c1f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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