summaryrefslogtreecommitdiff
path: root/src/configfile.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2016-10-21 18:16:28 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2016-10-21 18:20:02 -0400
commit988ee8006093df52f22a4b9c2de667bebee26afd (patch)
tree6304322e421e7a1f2c13c053e5952c2639f174ba /src/configfile.c
parentf5eef270bb6f06e53ba2adebbcff9ddea377245c (diff)
downloadlighttpd-git-988ee8006093df52f22a4b9c2de667bebee26afd.tar.gz
[config] warn if mod_authn_ldap,mysql not listed
warn if mod_authn_ldap is not listed in server.modules in lighttpd.conf but auth.backend = "ldap" is in lighttpd.conf warn if mod_authn_mysql is not listed in server.modules in lighttpd.conf but auth.backend = "mysql" is in lighttpd.conf A future release of lighttpd 1.4.x will cease automatically loading these modules. After that, lighttpd will fail to start up if auth.backend requires one of these modules and the module is not loaded. (The purpose of this change is to remove from the lighttpd core server the dependencies on LDAP or MariaDB libraries.)
Diffstat (limited to 'src/configfile.c')
-rw-r--r--src/configfile.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/configfile.c b/src/configfile.c
index 2d024841..0a8b0e02 100644
--- a/src/configfile.c
+++ b/src/configfile.c
@@ -25,6 +25,21 @@
#include <glob.h>
+static void config_warn_authn_module (server *srv, const char *module) {
+ size_t len = strlen(module);
+ for (size_t i = 0; i < srv->config_context->used; ++i) {
+ const data_config *config = (data_config const*)srv->config_context->data[i];
+ const data_unset *du = array_get_element(config->value, "auth.backend");
+ if (NULL != du && du->type == TYPE_STRING) {
+ data_string *ds = (data_string *)du;
+ if (buffer_is_equal_string(ds->value, module, len)) {
+ log_error_write(srv, __FILE__, __LINE__, "SSSsSSS", "Warning: please add \"mod_authn_", module, "\" to server.modules list in lighttpd.conf. A future release of lighttpd 1.4.x will not automatically load mod_authn_", module, "and lighttpd will fail to start up since your lighttpd.conf uses auth.backend = \"", module, "\".");
+ return;
+ }
+ }
+ }
+}
+
static int config_insert(server *srv) {
size_t i;
int ret = 0;
@@ -437,6 +452,7 @@ static int config_insert(server *srv) {
ds = data_string_init();
buffer_copy_string_len(ds->value, CONST_STR_LEN("mod_authn_ldap"));
array_insert_unique(srv->srvconf.modules, (data_unset *)ds);
+ config_warn_authn_module(srv, "ldap");
#endif
}
if (append_mod_authn_mysql) {
@@ -444,6 +460,7 @@ static int config_insert(server *srv) {
ds = data_string_init();
buffer_copy_string_len(ds->value, CONST_STR_LEN("mod_authn_mysql"));
array_insert_unique(srv->srvconf.modules, (data_unset *)ds);
+ config_warn_authn_module(srv, "mysql");
#endif
}
}