[Gpa-commits] r737 - trunk/src

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Fri Jan 13 11:33:12 CET 2006


Author: werner
Date: 2006-01-13 11:33:11 +0100 (Fri, 13 Jan 2006)
New Revision: 737

Modified:
   trunk/src/ChangeLog
   trunk/src/gpgmeedit.c
   trunk/src/server_access.c
Log:
Fix keysigning of some keys.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2006-01-13 08:41:52 UTC (rev 736)
+++ trunk/src/ChangeLog	2006-01-13 10:33:11 UTC (rev 737)
@@ -1,3 +1,9 @@
+2006-01-13  Werner Koch  <wk at g10code.com>
+
+	* gpgmeedit.c (edit_fnc): Do not call write for empty strings.
+	 Add support for debugging.
+	(edit_sign_fnc_transit) <SIGN_UID>: Detect sign_uid.okay.
+
 2006-01-12  Werner Koch  <wk at g10code.com>
 
 	* server_access.c (helper_path): Add special version for W32.

Modified: trunk/src/gpgmeedit.c
===================================================================
--- trunk/src/gpgmeedit.c	2006-01-13 08:41:52 UTC (rev 736)
+++ trunk/src/gpgmeedit.c	2006-01-13 10:33:11 UTC (rev 737)
@@ -23,6 +23,7 @@
 
 #include <unistd.h>
 
+
 /* The edit callback for all the edit operations is edit_fnc(). Each
  * operation is modelled as a sequential machine (a Moore machine, to be
  * precise). Therefore, for each operation you must write two functions.
@@ -36,6 +37,10 @@
  * See the comments below for details.
  */
 
+/* Define this macro to 1 to enable debugging of the FSM. */
+#define DEBUG_FSM 0
+
+
 /* Prototype of the action function. Returns the error if there is one */
 typedef gpg_error_t (*EditAction) (int state, void *opaque,
 				     char **result);
@@ -90,6 +95,9 @@
       return parms->err;
     }
 
+#if DEBUG_FSM
+  g_debug ("edit_fnc: state=%d input=%d (%s)", parms->state, status, args);
+#endif
   /* Choose the next state based on the current one and the input */
   parms->state = parms->transit (parms->state, status, args, parms->opaque, 
 				 &parms->err);
@@ -98,6 +106,10 @@
       gpg_error_t err;
       /* Choose the action based on the state */
       err = parms->action (parms->state, parms->opaque, &result);
+#if DEBUG_FSM
+      g_debug ("edit_fnc: newstate=%d err=%s result=%s",
+               parms->state, gpg_strerror (err), result);
+#endif
       if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
 	{
 	  parms->err = err;
@@ -105,10 +117,18 @@
       /* Send the command, if any was provided */
       if (result)
 	{
-	  write (fd, result, strlen (result));
+          if (*result)
+            write (fd, result, strlen (result));
 	  write (fd, "\n", 1);
 	}
     }
+  else
+    {
+#if DEBUG_FSM
+      g_debug ("edit_fnc: newstate=%d err=%s transit failed",
+               parms->state, gpg_strerror (parms->err));
+#endif
+    }
   return parms->err;
 }
 
@@ -517,6 +537,11 @@
         {
           next_state = SIGN_SET_CHECK_LEVEL;
         }
+      else if (status == GPGME_STATUS_GET_BOOL &&
+               g_str_equal (args, "sign_uid.okay"))
+        {
+          next_state = SIGN_CONFIRM;
+        }
       else if (status == GPGME_STATUS_GET_LINE &&
           g_str_equal (args, "keyedit.prompt"))
         {

Modified: trunk/src/server_access.c
===================================================================
--- trunk/src/server_access.c	2006-01-13 08:41:52 UTC (rev 736)
+++ trunk/src/server_access.c	2006-01-13 10:33:11 UTC (rev 737)
@@ -233,7 +233,7 @@
   gchar *helper[] = {helper_path (scheme), "-V", NULL};
   gchar *output = NULL;
   gint version;
-  less ~/hage
+
   g_spawn_sync (NULL, helper, NULL, G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, 
 		&output, NULL, NULL, NULL);
   if (output && *output)



More information about the Gpa-commits mailing list