Changeset 675 for server/common


Ignore:
Timestamp:
Mar 5, 2008, 7:56:07 PM (16 years ago)
Author:
geofft
Message:
Also check wildcard entries before falling back on the default.
File:
1 edited

Legend:

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

    r674 r675  
    506506
    507507    if ((result == LDAP_NO_SUCH_OBJECT)) {
     508        char* parent_hostname = apr_pstrdup(r->pool, hostname);
     509        do {
     510            parent_hostname = strchr(parent_hostname + 1, '.');
     511        } while (parent_hostname && parent_hostname[-1] != '*');
     512        if (parent_hostname) {
     513            *(--parent_hostname) = '*';
     514            ap_log_rerror(APLOG_MARK, APLOG_NOTICE|APLOG_NOERRNO, 0, r,
     515                          "[mod_vhost_ldap.c] translate: "
     516                          "virtual host not found, trying wildcard %s",
     517                          parent_hostname);
     518            hostname = parent_hostname;
     519            goto fallback;
     520        }
    508521        if (conf->fallback && (is_fallback++ <= 0)) {
    509522            ap_log_rerror(APLOG_MARK, APLOG_NOTICE|APLOG_NOERRNO, 0, r,
Note: See TracChangeset for help on using the changeset viewer.