aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/dirmngr_ldap.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2012-01-03 21:12:37 +0000
committerMarcus Brinkmann <[email protected]>2012-01-25 13:07:08 +0000
commite917c07b2664bb01a5f7b5975723b90da0f396c9 (patch)
treee31e737fe07e96b596f8bbbaf16a1e122ac683ae /dirmngr/dirmngr_ldap.c
parentRequire gitlog-to-changelog to be installed. (diff)
downloadgnupg-npth-3.tar.gz
gnupg-npth-3.zip
Port to npth.npth-3
* configure.ac: Don't check for PTH but for NPTH. (AH_BOTTOM): Remove PTH_SYSCALL_SOFT. (have_pth): Rename to ... (have_npth): ... this. (USE_GNU_NPTH): Rename to ... (USE_GNU_PTH): ... this. * m4/npth.m4: New file. * agent/Makefile.am, agent/cache.c, agent/call-pinentry.c, agent/call-scd.c, agent/findkey.c, agent/gpg-agent.c, agent/trustlist.c, common/Makefile.am, common/estream.c, common/exechelp-posix.c, common/exechelp-w32.c, common/exechelp-w32ce.c, common/http.c, common/init.c, common/sysutils.c, dirmngr/Makefile.am, dirmngr/crlfetch.c, dirmngr/dirmngr.c, dirmngr/dirmngr_ldap.c, dirmngr/ldap-wrapper-ce.c, dirmngr/ldap-wrapper.c, dirmngr/ldap.c, g13/Makefile.am, g13/call-gpg.c, g13/g13.c, g13/runner.c, scd/Makefile.am, scd/apdu.c, scd/app.c, scd/ccid-driver.c, scd/command.c, scd/scdaemon.c, tools/Makefile.am: Port to npth.
Diffstat (limited to 'dirmngr/dirmngr_ldap.c')
-rw-r--r--dirmngr/dirmngr_ldap.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/dirmngr/dirmngr_ldap.c b/dirmngr/dirmngr_ldap.c
index 8433bbf81..f166f19e2 100644
--- a/dirmngr/dirmngr_ldap.c
+++ b/dirmngr/dirmngr_ldap.c
@@ -33,7 +33,7 @@
#include <sys/time.h>
#include <unistd.h>
#ifndef USE_LDAPWRAPPER
-# include <pth.h>
+# include <npth.h>
#endif
#ifdef HAVE_W32_SYSTEM
@@ -58,13 +58,13 @@
#include "i18n.h"
#include "util.h"
-/* With the ldap wrapper, there is no need for the pth_enter and leave
+/* With the ldap wrapper, there is no need for the npth_unprotect and leave
functions; thus we redefine them to nops. If we are not using the
ldap wrapper process we need to include the prototype for our
module's main function. */
#ifdef USE_LDAPWRAPPER
-static void pth_enter (void) { }
-static void pth_leave (void) { }
+static void npth_unprotect (void) { }
+static void npth_protect (void) { }
#else
# include "./ldap-wrapper.h"
#endif
@@ -392,9 +392,9 @@ print_ldap_entries (my_opt_t myopt, LDAP *ld, LDAPMessage *msg, char *want_attr)
LDAPMessage *item;
int any = 0;
- for (pth_enter (), item = ldap_first_entry (ld, msg), pth_leave ();
+ for (npth_unprotect (), item = ldap_first_entry (ld, msg), npth_protect ();
item;
- pth_enter (), item = ldap_next_entry (ld, item), pth_leave ())
+ npth_unprotect (), item = ldap_next_entry (ld, item), npth_protect ())
{
BerElement *berctx;
char *attr;
@@ -414,11 +414,11 @@ print_ldap_entries (my_opt_t myopt, LDAP *ld, LDAPMessage *msg, char *want_attr)
}
- for (pth_enter (), attr = my_ldap_first_attribute (ld, item, &berctx),
- pth_leave ();
+ for (npth_unprotect (), attr = my_ldap_first_attribute (ld, item, &berctx),
+ npth_protect ();
attr;
- pth_enter (), attr = my_ldap_next_attribute (ld, item, berctx),
- pth_leave ())
+ npth_unprotect (), attr = my_ldap_next_attribute (ld, item, berctx),
+ npth_protect ())
{
struct berval **values;
int idx;
@@ -455,9 +455,9 @@ print_ldap_entries (my_opt_t myopt, LDAP *ld, LDAPMessage *msg, char *want_attr)
}
}
- pth_enter ();
+ npth_unprotect ();
values = my_ldap_get_values_len (ld, item, attr);
- pth_leave ();
+ npth_protect ();
if (!values)
{
@@ -618,19 +618,19 @@ fetch_ldap (my_opt_t myopt, const char *url, const LDAPURLDesc *ludp)
set_timeout (myopt);
- pth_enter ();
+ npth_unprotect ();
ld = my_ldap_init (host, port);
- pth_leave ();
+ npth_protect ();
if (!ld)
{
log_error (_("LDAP init to `%s:%d' failed: %s\n"),
host, port, strerror (errno));
return -1;
}
- pth_enter ();
+ npth_unprotect ();
/* Fixme: Can we use MYOPT->user or is it shared with other theeads?. */
ret = my_ldap_simple_bind_s (ld, myopt->user, myopt->pass);
- pth_leave ();
+ npth_protect ();
if (ret)
{
log_error (_("binding to `%s:%d' failed: %s\n"),
@@ -640,13 +640,13 @@ fetch_ldap (my_opt_t myopt, const char *url, const LDAPURLDesc *ludp)
}
set_timeout (myopt);
- pth_enter ();
+ npth_unprotect ();
rc = my_ldap_search_st (ld, dn, ludp->lud_scope, filter,
myopt->multi && !myopt->attr && ludp->lud_attrs?
ludp->lud_attrs:attrs,
0,
&myopt->timeout, &msg);
- pth_leave ();
+ npth_protect ();
if (rc == LDAP_SIZELIMIT_EXCEEDED && myopt->multi)
{
if (es_fwrite ("E\0\0\0\x09truncated", 14, 1, myopt->outstream) != 1)