Especially now we can dynamically configure DNs...
break;
case LDAP_RESULT_NO_RESULT:
+ /*
+ * DNs can now be dynamic, so a BAD DN often means the same thing as an empty result
+ */
+ case LDAP_RESULT_BAD_DN:
RETURN_MODULE_NOTFOUND;
default:
--- /dev/null
+
+string base_dn
+
+&base_dn=%ldap.uri.safe('dc=example,dc=com')
+ldap_dynamic_dn
+if (!ok) {
+ test_fail
+}
+
+# Bad DN
+&base_dn := %ldap.uri.safe('dc=example,dc=foo,dc=com')
+ldap_dynamic_dn
+if (!notfound) {
+ test_fail
+}
+
+test_pass
start = 0
}
}
+
+#
+# LDAP module configured with a bad base DN
+#
+ldap ldap_dynamic_dn {
+ server = "ldapi://%2Ftmp%2Fldap%2Fsocket"
+
+ sasl {
+ mech = "EXTERNAL"
+ }
+
+ user {
+ base_dn = "ou=people,%{base_dn}"
+ filter = "(uid=%{%{Stripped-User-Name} || %{User-Name}})"
+ sasl {
+ mech = 'DIGEST-MD5'
+ authname = &User-Name
+ }
+ }
+
+ options {
+ chase_referrals = yes
+ rebind = yes
+ referral_depth = 2
+ timeout = 10
+ timelimit = 3
+ idle = 60
+ probes = 3
+ interval = 3
+ }
+
+ pool {
+ start = 0
+ min = 1
+ max = 4
+ spare = 3
+ uses = 0
+ lifetime = 0
+ idle_timeout = 60
+ retry_delay = 1
+ }
+
+ bind_pool {
+ start = 0
+ }
+}
+