summaryrefslogtreecommitdiffstats
path: root/dirmngr/ks-engine-ldap.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2019-11-26 13:09:35 +0100
committerWerner Koch <wk@gnupg.org>2019-11-26 13:09:35 +0100
commit264c15c72fe050f5e8d2f1cb2444a459df6fe99f (patch)
treeaa2f381705526fdb8860026137174ba970a24207 /dirmngr/ks-engine-ldap.c
parentdirmngr: Make building with a TLS library mandatory (diff)
downloadgnupg2-264c15c72fe050f5e8d2f1cb2444a459df6fe99f.tar.xz
gnupg2-264c15c72fe050f5e8d2f1cb2444a459df6fe99f.zip
dirmngr: Rework of the LDAP code, part 1.
* dirmngr/http.h (struct parsed_uri_s): Add flag is_ldap. * dirmngr/http.c (do_parse_uri): Set flag. Do not error out for a missing slashes in an http scheme if NO_SCHEME_CHECK is active. * dirmngr/t-http.c (main): Print new flag. * dirmngr/ks-engine-ldap.c (ks_ldap_help): Use flag instead of checking the scheme. * dirmngr/ldap-parse-uri.c (ldap_uri_p): Re-implement using http_parse_uri. * dirmngr/t-ldap-parse-uri.c (main): Add option --verbose. -- This patch merely remove the separate parser for checking for an LDAP scheme. It is better to let our generic URI parser handle this. Also fixes this bug || url[4] == 'i' || url[4] == 'i') to make the rarely used ldapi scheme case-insensitive. More changes to the LDAP code are planned. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'dirmngr/ks-engine-ldap.c')
-rw-r--r--dirmngr/ks-engine-ldap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dirmngr/ks-engine-ldap.c b/dirmngr/ks-engine-ldap.c
index d6af26ec4..2a462faa8 100644
--- a/dirmngr/ks-engine-ldap.c
+++ b/dirmngr/ks-engine-ldap.c
@@ -308,15 +308,15 @@ ks_ldap_help (ctrl_t ctrl, parsed_uri_t uri)
if(!uri)
err = ks_print_help (ctrl, " ldap");
- else if (strcmp (uri->scheme, "ldap") == 0
- || strcmp (uri->scheme, "ldaps") == 0
- || strcmp (uri->scheme, "ldapi") == 0)
+ else if (uri->is_ldap)
err = ks_print_help (ctrl, data);
else
err = 0;
return err;
}
+
+
/* Convert a keyspec to a filter. Return an error if the keyspec is
bad or is not supported. The filter is escaped and returned in