1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

dirmngr: Support "ldap:///" for the current AD user.

* dirmngr/http.h (struct parsed_uri_s): Add field ad_current.
* dirmngr/ldap-parse-uri.c (ldap_parse_uri): Set it.
* dirmngr/ks-engine-ldap.c (my_ldap_connect): Take care of ad_current.
This commit is contained in:
Werner Koch 2020-12-17 16:09:31 +01:00
parent c75fd75532
commit 776bef74c7
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 55 additions and 16 deletions

View file

@ -176,9 +176,21 @@ ldap_parse_uri (parsed_uri_t *purip, const char *uri)
puri->query->valuelen = strlen (password) + 1;
}
puri->use_tls = strcmp (puri->scheme, "ldaps") == 0;
puri->use_tls = !strcmp (puri->scheme, "ldaps");
puri->port = lud->lud_port;
/* On Windows detect whether this is ldap:// or ldaps:// to indicate
* that authentication via AD and the current user is requested. */
puri->ad_current = 0;
#ifdef HAVE_W32_SYSTEM
if ((!puri->host || !*puri->host)
&& (!puri->path || !*puri->path)
&& (!puri->auth || !*puri->auth)
&& !password
)
puri->ad_current = 1;
#endif
out:
if (lud)
ldap_free_urldesc (lud);