Handle ldap entries with multiple cn's for a single key
PATCH 1/1 Handle ldap entries with multiple cn's for a single key
Hi, Ian, list, (sorry if this is a dup, mailer issues...)
This small patch fixes a rather odd problem noticed in the wild. Basically, a customer had multiple cn's for the wildcard key. The key would show up in searches for "/" or "*". So, when enumerating the result set from ldap, we would try to mount the entry for each one of those! This, of course, would lead to an "already mounted" error, and we would tear everything down due to the failure.
The fix is to stop once we find an entry that successfully mounts. Comments welcome.
-Jeff
modules/lookup_ldap.c +4 -0
@@ -687,6 +687,10 @@ int lookup_mount(const char *root, constdebug (MODPREFIX "%s -> %s" , key, mapent); ret = ctxt->parse->parse_mount (root, name, name_len, mapent, ctxt->parse->context); +/* stop after the first successful mount */ +if (ret ==0 ) +break ; + me =cache_lookup_next (me); } }else {