Merge pull request #195 from gouzhuang/master

handle NULL search result for group dn
main
Valery Komarov 5 years ago committed by GitHub
commit e2081531c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      ngx_http_auth_ldap_module.c

@ -2159,7 +2159,13 @@ ngx_http_auth_ldap_check_group(ngx_http_request_t *r, ngx_http_auth_ldap_ctx_t *
/* Handle result of the search started during previous call */ /* Handle result of the search started during previous call */
if (ctx->iteration > 0) { if (ctx->iteration > 0) {
ctx->group_dn.data = ctx->dn.data; ctx->group_dn.data = ctx->dn.data;
if (ctx->group_dn.data != NULL) { if (ctx->group_dn.data == NULL) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "http_auth_ldap: ldap_search_ext() returned NULL result");
if (ctx->server->satisfy_all == 1) {
ctx->outcome = OUTCOME_DENY;
return NGX_DECLINED;
}
} else {
if (ctx->error_code == LDAP_SUCCESS) { if (ctx->error_code == LDAP_SUCCESS) {
if (ctx->server->satisfy_all == 0) { if (ctx->server->satisfy_all == 0) {
ctx->outcome = OUTCOME_ALLOW; ctx->outcome = OUTCOME_ALLOW;

Loading…
Cancel
Save