]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Tue, 17 Jan 2023 15:27:30 +0000 (04:27 +1300)
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 3608148a388390e4dada41b07079c93d13fd7ff9..c713215a85c8f02910b4d128b08b58bc35e6d34d 100644 (file)
@@ -1114,7 +1114,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;