mirror of
https://github.com/mainnika/nginx-auth-ldap.git
synced 2026-05-22 15:53:39 +00:00
Merge pull request #81 from MarkusMattinen/master
avoid crashes comparing groups
This commit is contained in:
@@ -1956,8 +1956,13 @@ ngx_http_auth_ldap_check_group(ngx_http_request_t *r, ngx_http_auth_ldap_ctx_t *
|
||||
|
||||
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http_auth_ldap: Comparing user group with \"%V\"", &val);
|
||||
|
||||
rc = ldap_compare_ext(ctx->c->ld, (const char *) val.data, (const char *) ctx->server->group_attribute.data,
|
||||
&bvalue, NULL, NULL, &ctx->c->msgid);
|
||||
if (ctx->server->group_attribute.data == NULL) {
|
||||
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http_auth_ldap: group_attribute.data is \"%V\" so calling a failure here", &ctx->server->group_attribute.data);
|
||||
rc = !LDAP_SUCCESS;
|
||||
} else {
|
||||
rc = ldap_compare_ext(ctx->c->ld, (const char *) val.data, (const char *) ctx->server->group_attribute.data,
|
||||
&bvalue, NULL, NULL, &ctx->c->msgid);
|
||||
}
|
||||
if (rc != LDAP_SUCCESS) {
|
||||
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "http_auth_ldap: ldap_compare_ext() failed (%d: %s)",
|
||||
rc, ldap_err2string(rc));
|
||||
|
||||
Reference in New Issue
Block a user