Skip to content

Commit 83c059b

Browse files
authored
Merge pull request #234 from jcu-eresearch/fix-group-lookup
Revert #199 to fix group membership lookups
2 parents bf64cf2 + 16d56ea commit 83c059b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ngx_http_auth_ldap_module.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,6 @@ 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-
22202219
if (tail_gr == NULL) {
22212220
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "http_auth_ldap: Incorrect group DN: \"%s\"", gr);
22222221
ctx->outcome = OUTCOME_ERROR;
@@ -2230,9 +2229,9 @@ ngx_http_auth_ldap_check_group(ngx_http_request_t *r, ngx_http_auth_ldap_ctx_t *
22302229
if (ctx->server->group_attribute_dn == 1) {
22312230
user_val = ngx_pcalloc(
22322231
r->pool,
2233-
ctx->dn.len + 1);
2234-
ngx_memcpy(user_val, ctx->dn.data, ctx->dn.len);
2235-
user_val[ctx->dn.len] = '\0';
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';
22362235
} else {
22372236
user_val = ngx_pcalloc(
22382237
r->pool,

0 commit comments

Comments
 (0)