seahorse r2053 - in trunk: . agent



Author: nnielsen
Date: Tue Jan 29 03:54:27 2008
New Revision: 2053
URL: http://svn.gnome.org/viewvc/seahorse?rev=2053&view=rev

Log:
	* agent/seahorse-agent-main.c:
	* agent/seahorse-agent.c:
	* agent/seahorse-agent.h: Remove option to munge gpg.conf on startup
	from seahorse-agent.


Modified:
   trunk/ChangeLog
   trunk/agent/seahorse-agent-main.c
   trunk/agent/seahorse-agent.c
   trunk/agent/seahorse-agent.h

Modified: trunk/agent/seahorse-agent-main.c
==============================================================================
--- trunk/agent/seahorse-agent-main.c	(original)
+++ trunk/agent/seahorse-agent-main.c	Tue Jan 29 03:54:27 2008
@@ -40,6 +40,7 @@
 #include "seahorse-unix-signal.h"
 #include "seahorse-secure-memory.h"
 
+static gboolean display_vars_dummy = TRUE;
 static gboolean agent_no_daemonize = FALSE;
 static gboolean agent_running = FALSE;
 static gboolean agent_quit = FALSE;
@@ -53,8 +54,9 @@
     { "cshell", 'c', 0, G_OPTION_ARG_NONE, &seahorse_agent_cshell, 
         N_("Print variables in for a C type shell"), NULL },
 
-    { "variables", 'v', 0, G_OPTION_ARG_NONE, &seahorse_agent_displayvars, 
-        N_("Display variables instead of editing gpg.conf file"), NULL },
+    /* This is the default but is kept here for backward compatibility */
+    { "variables", 'v', 0, G_OPTION_ARG_NONE, &display_vars_dummy, 
+        N_("Display environment variables (the default)"), NULL },
 
     { "execute", 'x', 0, G_OPTION_ARG_NONE, &seahorse_agent_execvars, 
         N_("Execute other arguments on the command line"), NULL },

Modified: trunk/agent/seahorse-agent.c
==============================================================================
--- trunk/agent/seahorse-agent.c	(original)
+++ trunk/agent/seahorse-agent.c	Tue Jan 29 03:54:27 2008
@@ -34,13 +34,11 @@
 
 #include <gnome.h>
 
-#include "config.h"
 #include "seahorse-agent.h"
 #include "seahorse-gpg-options.h"
 #include "seahorse-passphrase.h"
 #include "seahorse-pgp-key.h"
 
-gboolean seahorse_agent_displayvars = FALSE;
 gboolean seahorse_agent_cshell = FALSE;
 gboolean seahorse_agent_execvars = FALSE;
 
@@ -48,15 +46,6 @@
 
 /* PUBLISHING AGENT INFO ---------------------------------------------------- */
 
-/* The GPG settings we modify */
-static const gchar *confs[2] = {
-    "gpg-agent-info",
-    NULL
-};
-    
-/* Previous gpg.conf settings */
-static gchar *prev_values[2];
-
 /* Print out the socket name info: <name>:<pid>:<protocol_version> */
 static void
 process_display (const gchar *socket, pid_t pid)
@@ -82,53 +71,6 @@
     g_setenv ("GPG_AGENT_INFO", var, TRUE);
 }
 
-/* Add our agent info to gpg.conf */
-static void
-process_gpg_conf (const gchar *socket, pid_t pid)
-{
-    GError *error = NULL;
-    gchar *agent_info;
-    gchar *values[2];
-    gboolean b;
-
-    g_assert (socket && socket[0]);
-    memset (prev_values, 0, sizeof (prev_values));
-
-    /* Read in the current values for the options */
-    if (!seahorse_gpg_options_find_vals (confs, prev_values, &error)) {
-    
-        /* Warn and put in defaults */
-        warnx (_("couldn't read gpg configuration, will try to create"));
-	  	g_clear_error (&error);
-    
-        prev_values[0] = NULL;  /* gpg-agent-info */
-        prev_values[1] = NULL;  /* null terminate */
-    }
-
-    agent_info = g_strdup_printf ("%s:%lu:1", socket, (unsigned long) pid);
-    
-    values[0] = agent_info;     /* gpg-agent-info */
-    values[1] = NULL;           /* null teriminate */
-    
-    b = seahorse_gpg_options_change_vals (confs, values, &error);
-
-    g_free (agent_info);
-
-    if (!b) {
-        g_assert (error);
-        errx (1, _("couldn't modify gpg configuration: %s"),
-              error ? error->message : "");
-        g_clear_error (&error);
-    }
-}
-
-/* Remove our agent info from gpg.conf */
-static void
-unprocess_gpg_conf ()
-{
-    seahorse_gpg_options_change_vals (confs, prev_values, NULL);
-}
-
 /* 
  * Called before forking as a daemon, creates the GPG agent 
  * socket. This socket path needs to be present and decided
@@ -154,7 +96,7 @@
 /* 
  * Called after forking off the agent daemon child. At this 
  * point we communicate the socket path to the environment
- * or gpg.conf as requested.
+ * as requested.
  */
 void
 seahorse_agent_postfork (pid_t child)
@@ -168,12 +110,10 @@
     g_return_if_fail (socket != NULL);
     
     /* If any of these fail, they simply exit */
-    if (seahorse_agent_displayvars)
-        process_display (socket, child);
-    else if(seahorse_agent_execvars)
+    if(seahorse_agent_execvars)
         process_setenv (socket, child);
-    else
-        process_gpg_conf (socket, child);    
+    else 
+        process_display (socket, child);
 }
 
 /* 
@@ -212,9 +152,6 @@
     if(!seahorse_agent_enabled)
         return;
 
-    if (!seahorse_agent_displayvars)
-        unprocess_gpg_conf ();
-        
     /* If any windows are open this closes them */
     seahorse_agent_prompt_cleanup ();
     seahorse_agent_status_cleanup ();

Modified: trunk/agent/seahorse-agent.h
==============================================================================
--- trunk/agent/seahorse-agent.h	(original)
+++ trunk/agent/seahorse-agent.h	Tue Jan 29 03:54:27 2008
@@ -57,7 +57,6 @@
 void seahorse_agent_uninit ();
 
 /* Global options to set from the command line */
-extern gboolean seahorse_agent_displayvars;
 extern gboolean seahorse_agent_cshell;
 extern gboolean seahorse_agent_execvars;
 extern gboolean seahorse_agent_any_display;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]