]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ext_kerberos_ldap_group_acl: Support -b with -D (#1207)
authorAlexander Bokovoy <abokovoy@redhat.com>
Sat, 10 Dec 2022 11:50:27 +0000 (11:50 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 10 Dec 2022 11:50:35 +0000 (11:50 +0000)
When both '-b' (i.e. bind DN) and '-D' (i.e. Kerberos domain) options
are specified, '-b' is ignored completely. This breaks the helper when a
search subtree has to be limited (e.g., when using FreeIPA).

Fix it to take '-b' into account if it was specified with '-D'.

src/acl/external/kerberos_ldap_group/support_ldap.cc

index e0c8950f5b6ef68a59511e9a6bae4292013ee26f..afd7b73ec4339290dc6811d7a5e90baa76a01b25 100644 (file)
@@ -1115,7 +1115,11 @@ get_memberof(struct main_args *margs, char *user, char *domain, char *group)
                   "%s| %s: DEBUG: Error during initialisation of ldap connection: %s\n",
                   LogTime(), PROGRAM, strerror(errno));
         }
-        bindp = convert_domain_to_bind_path(domain);
+        if (margs->lbind) {
+            bindp = xstrdup(margs->lbind);
+        } else {
+            bindp = convert_domain_to_bind_path(domain);
+        }
     }
     if ((!domain || !ld) && margs->lurl && strstr(margs->lurl, "://")) {
         char *hostname;