Skip to content

Commit bf64cf2

Browse files
authored
Merge pull request kvspb#199 from AVENTER-UG/issue_180
Issue 180: wrong ldap dn path to search the group
2 parents f022103 + e67df3d commit bf64cf2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ngx_http_auth_ldap_module.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,6 +2216,7 @@ ngx_http_auth_ldap_check_group(ngx_http_request_t *r, ngx_http_auth_ldap_ctx_t *
22162216
ngx_memcpy(gr, val.data, val.len);
22172217
gr[val.len] = '\0';
22182218
tail_gr = ngx_strchr(gr, ',');
2219+
22192220
if (tail_gr == NULL) {
22202221
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "http_auth_ldap: Incorrect group DN: \"%s\"", gr);
22212222
ctx->outcome = OUTCOME_ERROR;
@@ -2229,9 +2230,9 @@ ngx_http_auth_ldap_check_group(ngx_http_request_t *r, ngx_http_auth_ldap_ctx_t *
22292230
if (ctx->server->group_attribute_dn == 1) {
22302231
user_val = ngx_pcalloc(
22312232
r->pool,
2232-
ctx->user_dn.len + 1);
2233-
ngx_memcpy(user_val, ctx->user_dn.data, ctx->user_dn.len);
2234-
user_val[ctx->user_dn.len] = '\0';
2233+
ctx->dn.len + 1);
2234+
ngx_memcpy(user_val, ctx->dn.data, ctx->dn.len);
2235+
user_val[ctx->dn.len] = '\0';
22352236
} else {
22362237
user_val = ngx_pcalloc(
22372238
r->pool,

0 commit comments

Comments
 (0)