diff options
author | Marcus Brinkmann <[email protected]> | 2012-01-24 16:37:01 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2012-01-25 13:50:47 +0000 |
commit | 4074f966276be10a794fd63a7f443b9d974d3982 (patch) | |
tree | e31e737fe07e96b596f8bbbaf16a1e122ac683ae /dirmngr/dirmngr_ldap.c | |
parent | Port Windows code to NPTH. (diff) | |
download | gnupg-4074f966276be10a794fd63a7f443b9d974d3982.tar.gz gnupg-4074f966276be10a794fd63a7f443b9d974d3982.zip |
Port LDAP wrapper to NPTH.
* agent/gpg-agent.c (handle_connections): Handle error.
* dirmngr/dirmngr_ldap.c, dirmngr/ldap-wrapper-ce.c: Port to NPTH.
Diffstat (limited to '')
-rw-r--r-- | dirmngr/dirmngr_ldap.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/dirmngr/dirmngr_ldap.c b/dirmngr/dirmngr_ldap.c index 166ba4ab3..f166f19e2 100644 --- a/dirmngr/dirmngr_ldap.c +++ b/dirmngr/dirmngr_ldap.c @@ -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) |