Skip to content

Commit

Permalink
[config] warn if mod_authn_ldap,mysql not listed
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
gstrauss committed Nov 24, 2016
1 parent d352790 commit 26c44e0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/configfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ static void config_warn_authn_module (server *srv, const char *module) {
if (NULL != du && du->type == TYPE_STRING) {
data_string *ds = (data_string *)du;
if (buffer_is_equal_string(ds->value, module, len)) {
ds = data_string_init();
buffer_copy_string_len(ds->value, CONST_STR_LEN("mod_authn_"));
buffer_append_string(ds->value, module);
array_insert_unique(srv->srvconf.modules, (data_unset *)ds);
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;
}
Expand Down Expand Up @@ -451,17 +455,11 @@ static int config_insert(server *srv) {
}
if (append_mod_authn_ldap) {
#if defined(HAVE_LDAP_H) && defined(HAVE_LBER_H) && defined(HAVE_LIBLDAP) && defined(HAVE_LIBLBER)
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) {
#if defined(HAVE_MYSQL)
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
}
Expand Down

0 comments on commit 26c44e0

Please sign in to comment.