From 5908d44ebd530cdc8c604a0f7dea757400e33cfe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 8 Jan 2020 01:58:45 +0100 Subject: [PATCH] script selection priority --- index.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.cgi b/index.cgi index b52ba72..57de236 100755 --- a/index.cgi +++ b/index.cgi @@ -54,15 +54,15 @@ yield_page() { topdir="${_PATH#/}" topdir="/${topdir%%/*}" -if [ -d "${_EXEC}/${topdir}" -a -x "${_EXEC}/${topdir}/index.cgi" ]; then - . "${_EXEC}/${topdir}/index.cgi" -elif [ -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/index.cgi" ]; then +if [ -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/index.cgi" ]; then . "${_EXEC}/${_PATH}/index.cgi" elif [ ! -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}" ]; then . "${_EXEC}/${_PATH}" elif [ ! -x "${_EXEC}/${_PATH}" -a -r "${_EXEC}/${_PATH}" ]; then . "$_EXEC/cgilite/file.sh" FILE "${_EXEC}/${_PATH}" +elif [ -d "${_EXEC}/${topdir}" -a -x "${_EXEC}/${topdir}/index.cgi" ]; then + . "${_EXEC}/${topdir}/index.cgi" else printf 'Status: 404 Not Found\r\nContent-Length: 0\r\n\r\n' fi -- 2.39.2