Ignore:
Timestamp:
Aug 26, 2010, 4:28:43 PM (14 years ago)
Author:
gdb
Message:
Refactor code for processing attributes from LDAP.

This patch should not change any behavior.  We do this refactoring in
preparation for switching to ap_walk_config.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/common/oursrc/httpdmods/mod_vhost_ldap.c

    r1603 r1604  
    576576    /* Optimize */
    577577    if (vals) {
    578         int i = 0;
    579         while (attributes[i]) {
    580 
     578        int i;
     579        for (i = 0; attributes[i]; i++) {
     580
     581            char *val = apr_pstrdup (r->pool, vals[i]);
    581582            if (strcasecmp (attributes[i], "apacheServerName") == 0) {
    582                 reqc->name = apr_pstrdup (r->pool, vals[i]);
     583                reqc->name = val;
    583584            }
    584585            else if (strcasecmp (attributes[i], "apacheServerAdmin") == 0) {
    585                 reqc->admin = apr_pstrdup (r->pool, vals[i]);
     586                reqc->admin = val;
    586587            }
    587588            else if (strcasecmp (attributes[i], "apacheDocumentRoot") == 0) {
    588                 reqc->docroot = apr_pstrdup (r->pool, vals[i]);
     589                reqc->docroot = val;
    589590            }
    590591            else if (strcasecmp (attributes[i], "apacheScriptAlias") == 0) {
    591                 reqc->cgiroot = apr_pstrdup (r->pool, vals[i]);
     592                reqc->cgiroot = val;
    592593            }
    593594            else if (strcasecmp (attributes[i], "apacheSuexecUid") == 0) {
    594                 reqc->uid = apr_pstrdup(r->pool, vals[i]);
     595                reqc->uid = val;
    595596            }
    596597            else if (strcasecmp (attributes[i], "apacheSuexecGid") == 0) {
    597                 reqc->gid = apr_pstrdup(r->pool, vals[i]);
     598                reqc->gid = val;
    598599            }
    599             i++;
    600600        }
    601601    }
Note: See TracChangeset for help on using the changeset viewer.