fix splitting of auth-ldap filter

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2302 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.20
Stefan Bühler 15 years ago
parent 7a64f2f888
commit e7ff94835f

@ -59,6 +59,7 @@ NEWS
* hide some ssl errors per default, enable them with debug.log-ssl-noise (#397)
* do not send content-encoding for 304 (#1754), thx yzlai
* fix segfault for stat_cache(fam) calls with relative path (without '/', can be triggered by x-sendfile) (#1750)
* fix splitting of auth-ldap filter
- 1.4.19 - 2008-03-10

@ -397,6 +397,23 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
}
}
#ifdef USE_LDAP
if (s->auth_ldap_filter->used) {
char *dollar;
/* parse filter */
if (NULL == (dollar = strchr(s->auth_ldap_filter->ptr, '$'))) {
log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.filter is missing a replace-operator '$'");
return HANDLER_ERROR;
}
buffer_copy_string_len(s->ldap_filter_pre, s->auth_ldap_filter->ptr, dollar - s->auth_ldap_filter->ptr);
buffer_copy_string(s->ldap_filter_post, dollar+1);
}
#endif
/* no auth.require for this section */
if (NULL == (da = (data_array *)array_get_element(ca, "auth.require"))) continue;
@ -511,14 +528,14 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
handler_t ret = auth_ldap_init(srv, s);
if (ret == HANDLER_ERROR)
return (ret);
break;
break;
}
default:
break;
}
default:
break;
}
}
}
return HANDLER_GO_ON;
return HANDLER_GO_ON;
}
handler_t auth_ldap_init(server *srv, mod_auth_plugin_config *s) {
@ -532,21 +549,6 @@ handler_t auth_ldap_init(server *srv, mod_auth_plugin_config *s) {
}
#endif
if (s->auth_ldap_filter->used) {
char *dollar;
/* parse filter */
if (NULL == (dollar = strchr(s->auth_ldap_filter->ptr, '$'))) {
log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.filter is missing a replace-operator '$'");
return HANDLER_ERROR;
}
buffer_copy_string_len(s->ldap_filter_pre, s->auth_ldap_filter->ptr, dollar - s->auth_ldap_filter->ptr);
buffer_copy_string(s->ldap_filter_post, dollar+1);
}
if (s->auth_ldap_hostname->used) {
if (NULL == (s->ldap = ldap_init(s->auth_ldap_hostname->ptr, LDAP_PORT))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "ldap ...", strerror(errno));

Loading…
Cancel
Save