Signed-off-by: Andreas Peters <ap@aventer.biz>
main
Andreas Peters 7 years ago
parent 42d195d7a7
commit 4e223dbd23
No known key found for this signature in database
GPG Key ID: 6A83F12541CFCCF9
  1. 3
      ngx_http_auth_ldap_module.c

@ -2200,6 +2200,7 @@ ngx_http_auth_ldap_check_group(ngx_http_request_t *r, ngx_http_auth_ldap_ctx_t *
ngx_memcpy(gr, val.data, val.len); ngx_memcpy(gr, val.data, val.len);
gr[val.len] = '\0'; gr[val.len] = '\0';
tail_gr = ngx_strchr(gr, ','); tail_gr = ngx_strchr(gr, ',');
if (tail_gr == NULL) { if (tail_gr == NULL) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "http_auth_ldap: Incorrect group DN: \"%s\"", gr); ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "http_auth_ldap: Incorrect group DN: \"%s\"", gr);
ctx->outcome = OUTCOME_ERROR; ctx->outcome = OUTCOME_ERROR;
@ -2235,6 +2236,8 @@ ngx_http_auth_ldap_check_group(ngx_http_request_t *r, ngx_http_auth_ldap_ctx_t *
r->pool, r->pool,
for_filter); for_filter);
ngx_sprintf(filter, "(&(%s)(%s=%s))", cn_gr, ctx->server->group_attribute.data, user_val); ngx_sprintf(filter, "(&(%s)(%s=%s))", cn_gr, ctx->server->group_attribute.data, user_val);
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http_auth_ldap: user \"%s\"", (const char *) user_val);
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http_auth_ldap: group \"%s\"", (const char *) cn_gr);
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http_auth_ldap: Search group filter is \"%s\"", (const char *) filter); ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http_auth_ldap: Search group filter is \"%s\"", (const char *) filter);
attrs[0] = LDAP_NO_ATTRS; attrs[0] = LDAP_NO_ATTRS;
attrs[1] = NULL; attrs[1] = NULL;

Loading…
Cancel
Save