1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

* mod_ldap: Correctly return all requested attribute values

when some attributes have a null value.

PR: 44560 
Submitted by: Anders Kaseorg <anders kaseorg.com>
Reviewed by: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@634821 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eric Covener
2008-03-07 21:02:41 +00:00
parent b2cf8f26e7
commit 2ac9128120
2 changed files with 12 additions and 14 deletions

View File

@@ -1462,13 +1462,10 @@ static int uldap_cache_checkuserid(request_rec *r, util_ldap_connection_t *ldc,
/* ...and entry is valid */
*binddn = apr_pstrdup(r->pool, search_nodep->dn);
if (attrs) {
int i = 0, k = 0;
while (attrs[k++]);
*retvals = apr_pcalloc(r->pool, sizeof(char *) * k);
while (search_nodep->vals[i]) {
(*retvals)[i] = apr_pstrdup(r->pool,
search_nodep->vals[i]);
i++;
int i;
*retvals = apr_pcalloc(r->pool, sizeof(char *) * search_nodep->numvals);
for (i = 0; i < search_nodep->numvals; i++) {
(*retvals)[i] = apr_pstrdup(r->pool, search_nodep->vals[i]);
}
}
LDAP_CACHE_UNLOCK();
@@ -1712,13 +1709,10 @@ static int uldap_cache_getuserdn(request_rec *r, util_ldap_connection_t *ldc,
/* ...and entry is valid */
*binddn = apr_pstrdup(r->pool, search_nodep->dn);
if (attrs) {
int i = 0, k = 0;
while (attrs[k++]);
*retvals = apr_pcalloc(r->pool, sizeof(char *) * k);
while (search_nodep->vals[i]) {
(*retvals)[i] = apr_pstrdup(r->pool,
search_nodep->vals[i]);
i++;
int i;
*retvals = apr_pcalloc(r->pool, sizeof(char *) * search_nodep->numvals);
for (i = 0; i < search_nodep->numvals; i++) {
(*retvals)[i] = apr_pstrdup(r->pool, search_nodep->vals[i]);
}
}
LDAP_CACHE_UNLOCK();