]> andersk Git - mod-vhost-ldap.git/commitdiff
Also check wildcard entries before falling back on the default.
authorGeoffrey Thomas <geofft@mit.edu>
Thu, 6 Mar 2008 00:56:07 +0000 (00:56 +0000)
committerAnders Kaseorg <andersk@mit.edu>
Sat, 13 Feb 2010 04:17:02 +0000 (23:17 -0500)
Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
[andersk@mit.edu: Simplify construction of wildcard hostnames.]
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
mod_vhost_ldap.c

index 890cb2908bb18800fb8681ceb7625917003a1614..dc8a9e181895e2f05b96caeaf04d42a1e34b533f 100644 (file)
@@ -499,6 +499,18 @@ fallback:
     }
 
     if ((result == LDAP_NO_SUCH_OBJECT)) {
+       if (strcmp(hostname, "*") != 0) {
+           if (strncmp(hostname, "*.", 2) == 0)
+               hostname += 2;
+           hostname += strcspn(hostname, ".");
+           hostname = apr_pstrcat(r->pool, "*", hostname, NULL);
+           ap_log_rerror(APLOG_MARK, APLOG_NOTICE|APLOG_NOERRNO, 0, r,
+                         "[mod_vhost_ldap.c] translate: "
+                         "virtual host not found, trying wildcard %s",
+                         hostname);
+           goto fallback;
+       }
+
     null:
        if (conf->fallback && (is_fallback++ <= 0)) {
            ap_log_rerror(APLOG_MARK, APLOG_NOTICE|APLOG_NOERRNO, 0, r,
This page took 0.056008 seconds and 5 git commands to generate.