[svn] dirmngr - r312 - trunk/src

svn author wk cvs at cvs.gnupg.org
Fri Apr 3 11:26:08 CEST 2009


Author: wk
Date: 2009-04-03 11:26:08 +0200 (Fri, 03 Apr 2009)
New Revision: 312

Modified:
   trunk/src/ChangeLog
   trunk/src/dirmngr.h
   trunk/src/ldapserver.h
   trunk/src/server.c
Log:
Fix segv with "dirmngr --fetch-url".


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-10-30 10:21:19 UTC (rev 311)
+++ trunk/src/ChangeLog	2009-04-03 09:26:08 UTC (rev 312)
@@ -1,6 +1,12 @@
+2009-04-03  Werner Koch  <wk at g10code.com>
+
+	* dirmngr.h (struct server_local_s): Move back to ...
+	* server.c (struct server_local_s): ... here.
+	(get_ldapservers_from_ctrl): New.
+	* ldapserver.h (ldapserver_iter_begin): Use it.
+
 2008-10-29  Marcus Brinkmann  <marcus at g10code.de>
 
-
 	* estream.c (es_getline): Add explicit cast to silence gcc -W
 	warning.
 	* crlcache.c (finish_sig_check): Likewise.
@@ -327,7 +333,7 @@
 2007-08-13  Werner Koch  <wk at g10code.com>
 
 	* dirmngr.c (handle_connections): Use a timeout in the accept
-	fucntion.  Block signals while creating a new thread.  */
+	function.  Block signals while creating a new thread.
 	(shutdown_pending): Needs to be volatile as also accessed bt the
 	service function.
 	(w32_service_control): Do not use the regular log fucntions here.

Modified: trunk/src/dirmngr.h
===================================================================
--- trunk/src/dirmngr.h	2008-10-30 10:21:19 UTC (rev 311)
+++ trunk/src/dirmngr.h	2009-04-03 09:26:08 UTC (rev 312)
@@ -143,18 +143,10 @@
 };
 typedef struct cert_ref_s *cert_ref_t;
 
+/* Forward references; access only through server.c.  */
+struct server_local_s;
 
-/* Control structure per connection. */
-struct server_local_s 
-{
-  /* Data used to associate an Assuan context with local server data */
-  assuan_context_t assuan_ctx;
-
-  /* Per-session LDAP serfver.  */
-  ldap_server_t ldapservers;
-};
-
-
+/* Connection control structure.  */
 struct server_control_s
 {
   int refcount;      /* Count additional references to this object.  */
@@ -178,6 +170,7 @@
 void dirmngr_init_default_ctrl (ctrl_t ctrl);
 
 /*-- server.c --*/
+ldap_server_t get_ldapservers_from_ctrl (ctrl_t ctrl);
 ksba_cert_t get_cert_local (ctrl_t ctrl, const char *issuer);
 ksba_cert_t get_issuing_cert_local (ctrl_t ctrl, const char *issuer);
 ksba_cert_t get_cert_local_ski (ctrl_t ctrl,

Modified: trunk/src/ldapserver.h
===================================================================
--- trunk/src/ldapserver.h	2008-10-30 10:21:19 UTC (rev 311)
+++ trunk/src/ldapserver.h	2009-04-03 09:26:08 UTC (rev 312)
@@ -81,7 +81,7 @@
 {
   iter->ctrl = ctrl;
   iter->group = LDAPSERVER_SESSION;
-  iter->server = ctrl->server_local->ldapservers;
+  iter->server = get_ldapservers_from_ctrl (ctrl);
 
   while (iter->server == NULL && ! ldapserver_iter_end_p (iter))
     ldapserver_iter_next (iter);

Modified: trunk/src/server.c
===================================================================
--- trunk/src/server.c	2008-10-30 10:21:19 UTC (rev 311)
+++ trunk/src/server.c	2009-04-03 09:26:08 UTC (rev 312)
@@ -49,6 +49,32 @@
                                         gpg_error (GPG_ERR_ASS_PARAMETER), (t))
 
 
+
+/* Control structure per connection. */
+struct server_local_s 
+{
+  /* Data used to associate an Assuan context with local server data */
+  assuan_context_t assuan_ctx;
+
+  /* Per-session LDAP serfver.  */
+  ldap_server_t ldapservers;
+};
+
+
+
+
+/* Accessor for the local ldapservers variable. */
+ldap_server_t
+get_ldapservers_from_ctrl (ctrl_t ctrl)
+{
+  if (ctrl && ctrl->server_local)
+    return ctrl->server_local->ldapservers;
+  else
+    return NULL;
+}
+
+
+
 /* Copy the % and + escaped string S into the buffer D and replace the
    escape sequences.  Note, that it is sufficient to allocate the
    target string D as long as the source string S, i.e.: strlen(s)+1.




More information about the Gnupg-commits mailing list