https://issues.apache.org/bugzilla/show_bug.cgi?id=46421

           Summary: module mod_authz_dbd - doesn't work when multiple groups
                    are returned
           Product: Apache httpd-2
           Version: 2.2.10
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core
        AssignedTo: [email protected]
        ReportedBy: [email protected]


When the query returns multiple groups, the function authz_dbd_group_query()
returns the array containing pointers to the right number of groups, but all
point the same string, the last group (entry) returned.

W/in the for loop I changed the if statement to this:

if (rv == 0) {
   group = apr_array_push(groups);
   *tstring = apr_dbd_get_entry(dbd->driver, row, 0);
   *group = apr_pcalloc(r->pool, strlen(*srwstring) + 1);
   strcpy(*group, *srwstring);
   *group = apr_dbd_get_entry(dbd->driver, row, 0);
}

Now the returned array (groups) contains an array of strings, each of which are
at a newly allocated address.  This solved the problem in my usage with apache
2.2.10.  The function authz_dbd-group_query() didn't change in this area in the
latest trunk copy in svn (to date).

Thanks much,
   -Steve


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to