From b28f03b5a474f66964d7e49a722dd351775ad9ce Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Mon, 1 Jan 2018 07:32:52 -0500 Subject: [PATCH] [core] warn if mod_indexfile after dynamic handler mod_indexfile should be listed in server.modules prior to dynamic handlers x-ref: https://redmine.lighttpd.net/boards/2/topics/7797 --- src/server.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/server.c b/src/server.c index 084fac00..bc522956 100644 --- a/src/server.c +++ b/src/server.c @@ -1149,6 +1149,16 @@ static int server_main (server * const srv, int argc, char **argv) { return -1; } + /* mod_indexfile should be listed in server.modules prior to dynamic handlers */ + for (i = 0; i < srv->plugins.used; ++i) { + plugin *p = ((plugin **)srv->plugins.ptr)[i]; + if (buffer_is_equal_string(p->name, CONST_STR_LEN("indexfile"))) break; + if (p->handle_subrequest_start && p->handle_subrequest) { + log_error_write(srv, __FILE__, __LINE__, "SB", + "Warning: mod_indexfile should be listed in server.modules prior to mod_", p->name); + } + } + /* open pid file BEFORE chroot */ if (-2 == pid_fd) pid_fd = -1; /*(initial startup state)*/ if (-1 == pid_fd && !buffer_string_is_empty(srv->srvconf.pid_file)) {