[git] GnuPG - branch, master, updated. gnupg-2.1.3-4-g5cde5bf
by Neal H. Walfield
cvs at cvs.gnupg.org
Mon Apr 13 12:02:47 CEST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, master has been updated
via 5cde5bf37339cdeb0bd0a33d39477382eafebede (commit)
from 454f60399c7318fffd3de2afadd58c7a490178bd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5cde5bf37339cdeb0bd0a33d39477382eafebede
Author: Neal H. Walfield <neal at g10code.com>
Date: Mon Apr 13 12:02:40 2015 +0200
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 <neal at g10code.com>
GnuPG-bug-id: 1949
diff --git a/dirmngr/Makefile.am b/dirmngr/Makefile.am
index a8b1c52..c5713a7 100644
--- a/dirmngr/Makefile.am
+++ b/dirmngr/Makefile.am
@@ -62,13 +62,12 @@ dirmngr_SOURCES = dirmngr.c dirmngr.h server.c crlcache.c crlfetch.c \
cdb.h cdblib.c misc.c dirmngr-err.h \
ocsp.c ocsp.h validate.c validate.h \
ks-action.c ks-action.h ks-engine.h \
- ks-engine-hkp.c ks-engine-http.c ks-engine-finger.c ks-engine-kdns.c \
- ks-engine-ldap.c \
- ldap-parse-uri.c ldap-parse-uri.h
+ ks-engine-hkp.c ks-engine-http.c ks-engine-finger.c ks-engine-kdns.c
if USE_LDAP
dirmngr_SOURCES += ldapserver.h ldapserver.c ldap.c w32-ldap-help.h \
- ldap-wrapper.h $(ldap_url) $(extraldap_src)
+ ldap-wrapper.h ldap-parse-uri.c ldap-parse-uri.h \
+ ks-engine-ldap.c $(ldap_url) $(extraldap_src)
ldaplibs = $(LDAPLIBS)
else
ldaplibs =
@@ -114,7 +113,12 @@ t_common_ldadd = $(libcommontls) $(libcommon) no-libgcrypt.o \
$(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) \
$(DNSLIBS) $(LIBINTL) $(LIBICONV)
-module_tests = t-ldap-parse-uri
+module_tests =
+
+if USE_LDAP
+module_tests += t-ldap-parse-uri
+endif
+
t_ldap_parse_uri_SOURCES = \
t-ldap-parse-uri.c ldap-parse-uri.c ldap-parse-uri.h \
$(ldap_url) $(t_common_src)
diff --git a/dirmngr/ks-action.c b/dirmngr/ks-action.c
index c76aaaa..dd4516a 100644
--- a/dirmngr/ks-action.c
+++ b/dirmngr/ks-action.c
@@ -30,7 +30,9 @@
#include "misc.h"
#include "ks-engine.h"
#include "ks-action.h"
-#include "ldap-parse-uri.h"
+#if USE_LDAP
+# include "ldap-parse-uri.h"
+#endif
/* Called by the engine's help functions to print the actual help. */
gpg_error_t
@@ -73,10 +75,14 @@ ks_action_help (ctrl_t ctrl, const char *url)
}
else
{
+#if USE_LDAP
if (ldap_uri_p (url))
err = ldap_parse_uri (&parsed_uri, url);
else
- err = http_parse_uri (&parsed_uri, url, 1);
+#endif
+ {
+ err = http_parse_uri (&parsed_uri, url, 1);
+ }
if (err)
return err;
@@ -90,8 +96,10 @@ ks_action_help (ctrl_t ctrl, const char *url)
err = ks_finger_help (ctrl, parsed_uri);
if (!err)
err = ks_kdns_help (ctrl, parsed_uri);
+#if USE_LDAP
if (!err)
err = ks_ldap_help (ctrl, parsed_uri);
+#endif
if (!parsed_uri)
ks_print_help (ctrl,
@@ -151,16 +159,23 @@ ks_action_search (ctrl_t ctrl, uri_item_t keyservers,
for (uri = keyservers; !err && uri; uri = uri->next)
{
int is_http = uri->parsed_uri->is_http;
- int is_ldap = (strcmp (uri->parsed_uri->scheme, "ldap") == 0
- || strcmp (uri->parsed_uri->scheme, "ldaps") == 0
- || strcmp (uri->parsed_uri->scheme, "ldapi") == 0);
+ int is_ldap = 0;
+#if USE_LDAP
+ is_ldap = (strcmp (uri->parsed_uri->scheme, "ldap") == 0
+ || strcmp (uri->parsed_uri->scheme, "ldaps") == 0
+ || strcmp (uri->parsed_uri->scheme, "ldapi") == 0);
+#endif
if (is_http || is_ldap)
{
any_server = 1;
- if (is_http)
- err = ks_hkp_search (ctrl, uri->parsed_uri, patterns->d, &infp);
- else if (is_ldap)
+#if USE_LDAP
+ if (is_ldap)
err = ks_ldap_search (ctrl, uri->parsed_uri, patterns->d, &infp);
+ else
+#endif
+ {
+ err = ks_hkp_search (ctrl, uri->parsed_uri, patterns->d, &infp);
+ }
if (!err)
{
@@ -203,18 +218,27 @@ ks_action_get (ctrl_t ctrl, uri_item_t keyservers,
for (uri = keyservers; !err && uri; uri = uri->next)
{
int is_http = uri->parsed_uri->is_http;
- int is_ldap = (strcmp (uri->parsed_uri->scheme, "ldap") == 0
- || strcmp (uri->parsed_uri->scheme, "ldaps") == 0
- || strcmp (uri->parsed_uri->scheme, "ldapi") == 0);
+ int is_ldap = 0;
+
+#if USE_LDAP
+ is_ldap = (strcmp (uri->parsed_uri->scheme, "ldap") == 0
+ || strcmp (uri->parsed_uri->scheme, "ldaps") == 0
+ || strcmp (uri->parsed_uri->scheme, "ldapi") == 0);
+#endif
+
if (is_http || is_ldap)
{
any_server = 1;
for (sl = patterns; !err && sl; sl = sl->next)
{
- if (is_http)
- err = ks_hkp_get (ctrl, uri->parsed_uri, sl->d, &infp);
- else
+#if USE_LDAP
+ if (is_ldap)
err = ks_ldap_get (ctrl, uri->parsed_uri, sl->d, &infp);
+ else
+#endif
+ {
+ err = ks_hkp_get (ctrl, uri->parsed_uri, sl->d, &infp);
+ }
if (err)
{
@@ -322,22 +346,32 @@ ks_action_put (ctrl_t ctrl, uri_item_t keyservers,
int any_server = 0;
uri_item_t uri;
+ (void) info;
+ (void) infolen;
+
for (uri = keyservers; !err && uri; uri = uri->next)
{
int is_http = uri->parsed_uri->is_http;
- int is_ldap = (strcmp (uri->parsed_uri->scheme, "ldap") == 0
- || strcmp (uri->parsed_uri->scheme, "ldaps") == 0
- || strcmp (uri->parsed_uri->scheme, "ldapi") == 0);
+ int is_ldap = 0;
+
+#if USE_LDAP
+ is_ldap = (strcmp (uri->parsed_uri->scheme, "ldap") == 0
+ || strcmp (uri->parsed_uri->scheme, "ldaps") == 0
+ || strcmp (uri->parsed_uri->scheme, "ldapi") == 0);
+#endif
if (is_http || is_ldap)
{
any_server = 1;
- if (is_http)
- err = ks_hkp_put (ctrl, uri->parsed_uri, data, datalen);
- else
+#if USE_LDAP
+ if (is_ldap)
err = ks_ldap_put (ctrl, uri->parsed_uri, data, datalen,
info, infolen);
-
+ else
+#endif
+ {
+ err = ks_hkp_put (ctrl, uri->parsed_uri, data, datalen);
+ }
if (err)
{
first_err = err;
diff --git a/dirmngr/server.c b/dirmngr/server.c
index 506b137..3e6d99d 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);
-----------------------------------------------------------------------
Summary of changes:
dirmngr/Makefile.am | 14 ++++++----
dirmngr/ks-action.c | 76 ++++++++++++++++++++++++++++++++++++++---------------
dirmngr/server.c | 10 +++++--
3 files changed, 72 insertions(+), 28 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list