[PRNT-2306] Check if files are readable before parsing them

This commit is contained in:
Michael Boelen 2016-07-05 12:19:43 +02:00
parent fbd24b585a
commit 6c24c198ee
1 changed files with 4 additions and 2 deletions

View File

@ -91,9 +91,11 @@
LogText "Test: Searching cupsd configuration file" LogText "Test: Searching cupsd configuration file"
for I in ${CUPSD_CONFIG_LOCS}; do for I in ${CUPSD_CONFIG_LOCS}; do
if [ -f ${I}/cupsd.conf ]; then if [ -f ${I}/cupsd.conf ]; then
if FileIsReadable ${I}/cupsd.conf; then
CUPSD_CONFIG_FILE="${I}/cupsd.conf" CUPSD_CONFIG_FILE="${I}/cupsd.conf"
LogText "Result: found ${CUPSD_CONFIG_FILE}" LogText "Result: found ${CUPSD_CONFIG_FILE}"
fi fi
fi
done done
if [ ! "${CUPSD_CONFIG_FILE}" = "" ]; then if [ ! "${CUPSD_CONFIG_FILE}" = "" ]; then
Display --indent 2 --text "- Checking CUPS configuration file" --result "${STATUS_OK}" --color GREEN Display --indent 2 --text "- Checking CUPS configuration file" --result "${STATUS_OK}" --color GREEN