aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/ldap-parse-uri.c
diff options
context:
space:
mode:
Diffstat (limited to 'dirmngr/ldap-parse-uri.c')
-rw-r--r--dirmngr/ldap-parse-uri.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/dirmngr/ldap-parse-uri.c b/dirmngr/ldap-parse-uri.c
index 41633acf0..573bcc77f 100644
--- a/dirmngr/ldap-parse-uri.c
+++ b/dirmngr/ldap-parse-uri.c
@@ -71,6 +71,7 @@ ldap_parse_uri (parsed_uri_t *purip, const char *uri)
char *dn = NULL;
char *bindname = NULL;
char *password = NULL;
+ char *gpg_ntds = NULL;
char **s;
@@ -107,6 +108,15 @@ ldap_parse_uri (parsed_uri_t *purip, const char *uri)
else
password = *s + 9;
}
+ else if (!ascii_strncasecmp (*s, "gpgNtds=", 8)
+ || !strncmp (*s, "1.3.6.1.4.1.11591.2.5.1=", 24))
+ {
+ if (gpg_ntds)
+ log_error ("gpgNtds given multiple times in URL '%s', ignoring.\n",
+ uri);
+ else
+ gpg_ntds = *s + (**s == 'g'? 8 : 24);
+ }
else
log_error ("Unhandled extension (%s) in URL '%s', ignoring.",
*s, uri);
@@ -167,10 +177,14 @@ ldap_parse_uri (parsed_uri_t *purip, const char *uri)
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. */
+ * that authentication via AD and the current user is requested.
+ * This is shortform of adding "gpgNtDs=1" as extension parameter to
+ * the URL. */
puri->ad_current = 0;
+ if (gpg_ntds && atoi (gpg_ntds) == 1)
+ puri->ad_current = 1;
#ifdef HAVE_W32_SYSTEM
- if ((!puri->host || !*puri->host)
+ else if ((!puri->host || !*puri->host)
&& (!puri->path || !*puri->path)
&& (!puri->auth || !*puri->auth)
&& !password