dirmngr (NEWS src/ChangeLog src/ldap.c)

cvs user wk cvs at cvs.gnupg.org
Thu Dec 16 08:44:58 CET 2004


    Date: Thursday, December 16, 2004 @ 08:49:25
  Author: wk
    Path: /cvs/dirmngr/dirmngr

Modified: NEWS src/ChangeLog src/ldap.c

(ldap_wrapper): Peek on the output to detect empty output
early.


---------------+
 NEWS          |    2 ++
 src/ChangeLog |    5 +++++
 src/ldap.c    |   31 +++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+)


Index: dirmngr/NEWS
diff -u dirmngr/NEWS:1.30 dirmngr/NEWS:1.31
--- dirmngr/NEWS:1.30	Thu Nov 25 12:37:38 2004
+++ dirmngr/NEWS	Thu Dec 16 08:49:25 2004
@@ -18,6 +18,8 @@
  * SIGHUP may be used to reread the configuration and to flush the
    certificate cache.
 
+ * An authorithyKeyIdentifier in a CRL is now handled correctly.
+
 
 Noteworthy changes in version 0.5.6 (2004-09-28)
 ------------------------------------------------
Index: dirmngr/src/ChangeLog
diff -u dirmngr/src/ChangeLog:1.36 dirmngr/src/ChangeLog:1.37
--- dirmngr/src/ChangeLog:1.36	Wed Dec 15 23:11:59 2004
+++ dirmngr/src/ChangeLog	Thu Dec 16 08:49:25 2004
@@ -1,3 +1,8 @@
+2004-12-16  Werner Koch  <wk at g10code.com>
+
+	* ldap.c (ldap_wrapper): Peek on the output to detect empty output
+	early.
+
 2004-12-15  Werner Koch  <wk at g10code.com>
 
 	* ldap.c (ldap_wrapper): Print a diagnostic after forking for the
Index: dirmngr/src/ldap.c
diff -u dirmngr/src/ldap.c:1.43 dirmngr/src/ldap.c:1.44
--- dirmngr/src/ldap.c:1.43	Wed Dec 15 23:11:59 2004
+++ dirmngr/src/ldap.c	Thu Dec 16 08:49:25 2004
@@ -94,6 +94,14 @@
 static struct wrapper_context_s *wrapper_list;
 
 
+/* Prototypes.  */
+static gpg_error_t read_buffer (ksba_reader_t reader,
+                                unsigned char *buffer, size_t count);
+
+
+
+
+
 /* Add HOST and PORT to our list of LDAP servers.  Fixme: We should
    better use an extra list of servers. */
 static void
@@ -686,6 +694,29 @@
   wrapper_list = ctx;
   if (opt.verbose)
     log_info (_("ldap wrapper %d started\n"), (int)ctx->pid);
+
+  /* Need to wait for the first byte so we are able todetect an empty
+     output and not let the consumer se an EOF without further error
+     indications.  The CRL loading logic assumes that after return
+     from this function, a failed search (e.g. host not found ) is
+     indicated right away. */
+  {
+    unsigned char c;
+
+    err = read_buffer (*reader, &c, 1);
+    if (err)
+      {
+        ldap_wrapper_release_context (*reader);
+        ksba_reader_release (*reader);
+        *reader = NULL;
+        if (gpg_err_code (err) == GPG_ERR_EOF)
+          return gpg_error (GPG_ERR_NO_DATA);
+        else
+          return err;
+      }
+    ksba_reader_unread (*reader, &c, 1);
+  }
+
   return 0;
 }
 




More information about the Gnupg-commits mailing list