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

diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
index 3d0cba0..08a1c56 100644
--- a/modules/lookup_ldap.c
+++ b/modules/lookup_ldap.c
@@ -687,6 +687,10 @@ int lookup_mount(const char *root, const
                        debug(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 {

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to