aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/server.c
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2015-04-13 10:02:40 +0000
committerNeal H. Walfield <[email protected]>2015-04-13 10:02:40 +0000
commit5cde5bf37339cdeb0bd0a33d39477382eafebede (patch)
treeb701d9f8f8a72abe85f3e6130a05291bdd6ed9b5 /dirmngr/server.c
parentcommon: Do without nested fucntions to support non-gcc. (diff)
downloadgnupg-5cde5bf37339cdeb0bd0a33d39477382eafebede.tar.gz
gnupg-5cde5bf37339cdeb0bd0a33d39477382eafebede.zip
dirmngr: If LDAP is not enable, don't build the LDAP bits.
* dirmngr/Makefile.am (dirmngr_SOURCES): Only include ks-engine-ldap.c, ldap-parse-uri.c and ldap-parse-uri.h if USE_LDAP is TRUE. (module_tests): Only add t-ldap-parse-uri if USE_LDAP is TRUE. * dirmngr/ks-action.c: Only include "ldap-parse-uri.h" if USE_LDAP is TRUE. (ks_action_help): Don't invoke LDAP functionality if USE_LDAP is not TRUE. (ks_action_search): Likewise. (ks_action_get): Likewise. (ks_action_put): Likewise. * dirmngr/server.c: Only include "ldap-parse-uri.h" if USE_LDAP is TRUE. (cmd_keyserver): Don't invoke LDAP functionality if USE_LDAP is not TRUE. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1949
Diffstat (limited to 'dirmngr/server.c')
-rw-r--r--dirmngr/server.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/dirmngr/server.c b/dirmngr/server.c
index 506b137c1..3e6d99d18 100644
--- a/dirmngr/server.c
+++ b/dirmngr/server.c
@@ -48,7 +48,9 @@
#endif
#include "ks-action.h"
#include "ks-engine.h" /* (ks_hkp_print_hosttable) */
-#include "ldap-parse-uri.h"
+#if USE_LDAP
+# include "ldap-parse-uri.h"
+#endif
/* To avoid DoS attacks we limit the size of a certificate to
something reasonable. */
@@ -1530,10 +1532,14 @@ cmd_keyserver (assuan_context_t ctx, char *line)
item->parsed_uri = NULL;
strcpy (item->uri, line);
+#if USE_LDAP
if (ldap_uri_p (item->uri))
err = ldap_parse_uri (&item->parsed_uri, line);
else
- err = http_parse_uri (&item->parsed_uri, line, 1);
+#endif
+ {
+ err = http_parse_uri (&item->parsed_uri, line, 1);
+ }
if (err)
{
xfree (item);