Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 108604 Details for
Bug 164523
gpg2 in gnome environment has some issues
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
seahorse-0.8.2-gpg2.patch
seahorse-0.8.2-gpg2.patch (text/plain), 13.58 KB, created by
Alon Bar-Lev (RETIRED)
on 2007-01-30 10:32:49 UTC
(
hide
)
Description:
seahorse-0.8.2-gpg2.patch
Filename:
MIME Type:
Creator:
Alon Bar-Lev (RETIRED)
Created:
2007-01-30 10:32:49 UTC
Size:
13.58 KB
patch
obsolete
>diff -urNp seahorse-0.8.2.org/agent/seahorse-agent-actions.c seahorse-0.8.2/agent/seahorse-agent-actions.c >--- seahorse-0.8.2.org/agent/seahorse-agent-actions.c 2005-04-27 07:06:25.000000000 +0300 >+++ seahorse-0.8.2/agent/seahorse-agent-actions.c 2007-01-30 12:06:46.000000000 +0200 >@@ -67,7 +67,7 @@ seahorse_agent_actions_uninit () > > /* Called for the assuan GET_PASSPHRASE command */ > void >-seahorse_agent_actions_getpass (SeahorseAgentConn * rq, gchar * id, >+seahorse_agent_actions_getpass (SeahorseAgentConn * rq, gboolean pass_as_data, gchar * id, > gchar * errmsg, gchar * prompt, gchar * desc) > { > SeahorseAgentPassReq *pr; >@@ -80,8 +80,14 @@ seahorse_agent_actions_getpass (Seahorse > * We don't need authorization, so if we have the password > * just reply now, without going to the queue. > */ >- if ((pass = seahorse_agent_cache_get (id)) != NULL) { >- seahorse_agent_io_reply (rq, TRUE, pass); >+ if ((pass = seahorse_agent_cache_get (pass_as_data, id)) != NULL) { >+ if (pass_as_data) { >+ seahorse_agent_io_data (rq, pass); >+ seahorse_agent_io_reply (rq, TRUE, NULL); >+ } >+ else { >+ seahorse_agent_io_reply (rq, TRUE, pass); >+ } > return; > } > } >@@ -89,6 +95,7 @@ seahorse_agent_actions_getpass (Seahorse > /* A new queue item */ > pr = g_chunk_new (SeahorseAgentPassReq, g_memory); > memset (pr, 0, sizeof (*pr)); >+ pr->pass_as_data = pass_as_data; > pr->id = id ? g_strdup (id) : NULL; > pr->errmsg = errmsg ? g_strdup (errmsg) : NULL; > pr->prompt = g_strdup (prompt ? prompt : _("Passphrase:")); >@@ -133,7 +140,7 @@ seahorse_agent_actions_doneauth (Seahors > * exists also locks it into the cache. > */ > g_assert (pr->id); >- pass = seahorse_agent_cache_get (pr->id); >+ pass = seahorse_agent_cache_get (pr->pass_as_data, pr->id); > g_assert (pass != NULL); > } > >@@ -146,8 +153,15 @@ seahorse_agent_actions_donepass (Seahors > { > if (pass == NULL) > seahorse_agent_io_reply (pr->request, FALSE, "111 cancelled"); >- else >- seahorse_agent_io_reply (pr->request, TRUE, pass); >+ else { >+ if (pr->pass_as_data) { >+ seahorse_agent_io_data (pr->request, pass); >+ seahorse_agent_io_reply (pr->request, TRUE, NULL); >+ } >+ else { >+ seahorse_agent_io_reply (pr->request, TRUE, pass); >+ } >+ } > > free_passreq (pr); > seahorse_agent_actions_nextgui (); >diff -urNp seahorse-0.8.2.org/agent/seahorse-agent-cache.c seahorse-0.8.2/agent/seahorse-agent-cache.c >--- seahorse-0.8.2.org/agent/seahorse-agent-cache.c 2005-08-14 09:47:46.000000000 +0300 >+++ seahorse-0.8.2/agent/seahorse-agent-cache.c 2007-01-30 12:21:34.000000000 +0200 >@@ -46,6 +46,7 @@ > typedef struct sa_cache_t { > gchar *id; /* The password id */ > gchar *pass; /* The password itself (pointer to secure mem) */ >+ gchar *enc_pass; /* The password itself (pointer to secure mem) */ > gchar *desc; /* A description of the key (parsed below) */ > gboolean locked; /* Whether this entry is locked in the cache */ > time_t stamp; /* The time which this password was last accessed */ >@@ -129,6 +130,9 @@ destroy_cache_item (gpointer data) > if (it->pass) > secmem_free (it->pass); > >+ if (it->enc_pass) >+ secmem_free (it->enc_pass); >+ > g_chunk_free (it, g_memory); > } > } >@@ -206,7 +210,7 @@ seahorse_agent_cache_uninit () > > /* Retrieve a password from the cache */ > const gchar * >-seahorse_agent_cache_get (const gchar *id) >+seahorse_agent_cache_get (gboolean pass_as_data, const gchar *id) > { > sa_cache_t *it; > >@@ -227,7 +231,12 @@ seahorse_agent_cache_get (const gchar *i > if (it->locked) > it->locked = FALSE; > >- return it->pass; >+ if (pass_as_data) { >+ return it->pass; >+ } >+ else { >+ return it->enc_pass; >+ } > } > > return NULL; >@@ -357,28 +366,24 @@ seahorse_agent_cache_set (const gchar *i > > len = strlen (pass); > >- if (encode) { >- c = sizeof (gchar *) * ((len * 2) + 1); >- it->pass = (gchar *) secmem_malloc (c); >- if (!it->pass) { >- g_critical ("out of secure memory"); >- return; >- } >- >- memset (it->pass, 0, c); >- encode_password (it->pass, pass); >+ c = sizeof (gchar) * ((len * 2) + 1); >+ it->enc_pass = (gchar *) secmem_malloc (c); >+ if (!it->enc_pass) { >+ g_critical ("out of secure memory"); >+ return; > } > >- else { >- it->pass = (gchar *) secmem_malloc (sizeof (gchar) * (len + 1)); >- if (!it->pass) { >- g_critical ("out of secure memory"); >- return; >- } >+ memset (it->enc_pass, 0, c); >+ encode_password (it->enc_pass, pass); > >- strcpy (it->pass, pass); >+ it->pass = (gchar *) secmem_malloc (sizeof (gchar) * (len + 1)); >+ if (!it->pass) { >+ g_critical ("out of secure memory"); >+ return; > } > >+ strcpy (it->pass, pass); >+ > /* If not caching set to the epoch which should always expire */ > it->stamp = cache ? time (NULL) : 0; > it->locked = lock ? TRUE : FALSE; >diff -urNp seahorse-0.8.2.org/agent/seahorse-agent.h seahorse-0.8.2/agent/seahorse-agent.h >--- seahorse-0.8.2.org/agent/seahorse-agent.h 2005-04-27 07:06:25.000000000 +0300 >+++ seahorse-0.8.2/agent/seahorse-agent.h 2007-01-30 12:05:57.000000000 +0200 >@@ -50,6 +50,7 @@ int seahorse_agent_io_socket (const char > int seahorse_agent_io_init (); > void seahorse_agent_io_uninit (); > void seahorse_agent_io_reply (SeahorseAgentConn *rq, gboolean ok, const gchar *response); >+void seahorse_agent_io_data (SeahorseAgentConn *cn, const gchar *data); > > /* ----------------------------------------------------------------------------- > * seahorse-agent-actions.c >@@ -57,6 +58,7 @@ void seahorse_agent_io_reply (SeahorseAg > > > typedef struct _SeahorseAgentPassReq { >+ gboolean pass_as_data; > const gchar *id; > const gchar *errmsg; > const gchar *prompt; >@@ -66,8 +68,8 @@ typedef struct _SeahorseAgentPassReq { > > void seahorse_agent_actions_init (); > void seahorse_agent_actions_uninit (); >-void seahorse_agent_actions_getpass (SeahorseAgentConn *rq, gchar *id, gchar *errmsg, >- gchar *prompt, gchar *desc); >+void seahorse_agent_actions_getpass (SeahorseAgentConn *rq, gboolean pass_as_data, gchar *id, >+ gchar *errmsg, gchar *prompt, gchar *desc); > void seahorse_agent_actions_clrpass (SeahorseAgentConn *rq, gchar *id); > void seahorse_agent_actions_doneauth (SeahorseAgentPassReq *pr, gboolean authorized); > void seahorse_agent_actions_donepass (SeahorseAgentPassReq *pr, const gchar *pass); >@@ -79,7 +81,7 @@ void seahorse_agent_actions_nextgui (); > > void seahorse_agent_cache_init (); > void seahorse_agent_cache_uninit (); >-const gchar *seahorse_agent_cache_get (const gchar *id); >+const gchar *seahorse_agent_cache_get (gboolean pass_as_data, const gchar *id); > void seahorse_agent_cache_set (const gchar *id, const gchar *pass, > gboolean encode, gboolean lock); > gboolean seahorse_agent_cache_has (const gchar *id, gboolean lock); >diff -urNp seahorse-0.8.2.org/agent/seahorse-agent-io.c seahorse-0.8.2/agent/seahorse-agent-io.c >--- seahorse-0.8.2.org/agent/seahorse-agent-io.c 2005-08-28 22:52:02.000000000 +0300 >+++ seahorse-0.8.2/agent/seahorse-agent-io.c 2007-01-30 12:14:46.000000000 +0200 >@@ -99,6 +99,7 @@ struct _SeahorseAgentConn { > /* Responses */ > #define ASS_OK "OK " > #define ASS_ERR "ERR " >+#define ASS_DATA "D " > #define NL "\n" > > /* ----------------------------------------------------------------------------- >@@ -327,10 +328,12 @@ process_line (SeahorseAgentConn *cn, gch > } > > else if (strcasecmp (string, ASS_GETPASS) == 0) { >+ gchar *tmp; > gchar *id; > gchar *errmsg; > gchar *prompt; > gchar *description; >+ gboolean pass_as_data = FALSE; > > /* We don't answer this unless it's from the right terminal */ > if (!cn->terminal_ok) { >@@ -339,7 +342,13 @@ process_line (SeahorseAgentConn *cn, gch > return; > } > >- split_arguments (args, &id, &errmsg, &prompt, &description, NULL); >+ if (strstr (args, "--data") != NULL) { >+ pass_as_data = TRUE; >+ split_arguments (args, &tmp, &tmp, &id, &errmsg, &prompt, &description, NULL); >+ } >+ else { >+ split_arguments (args, &id, &errmsg, &prompt, &description, NULL); >+ } > > if (!id || !errmsg || !prompt || !description) { > seahorse_agent_io_reply (cn, FALSE, "105 parameter error"); >@@ -356,7 +365,7 @@ process_line (SeahorseAgentConn *cn, gch > if (is_null_argument (description)) > description = NULL; > >- seahorse_agent_actions_getpass (cn, id, errmsg, prompt, description); >+ seahorse_agent_actions_getpass (cn, pass_as_data, id, errmsg, prompt, description); > } > > else if (strcasecmp (string, ASS_CLRPASS) == 0) { >@@ -512,6 +521,29 @@ seahorse_agent_io_reply (SeahorseAgentCo > return; > } > >+void >+seahorse_agent_io_data (SeahorseAgentConn *cn, const gchar *data) >+{ >+ int fd; >+ >+ /* The connection could have closed in the meantime */ >+ if (!is_valid_conn (cn)) >+ return; >+ >+ DEBUG_AGENTIO (("[agent-io] send data:\n%s%s\n", ASS_DATA, data)); >+ >+ fd = g_io_channel_unix_get_fd (cn->iochannel); >+ >+ if (write_raw_data (fd, ASS_DATA, KL (ASS_DATA)) == -1 || >+ write_raw_data (fd, data, -1) == -1 || >+ write_raw_data (fd, NL, KL (NL)) == -1) { >+ /* error message already printed */ >+ disconnect (cn); >+ } >+ >+ return; >+} >+ > /* Callback for new incoming connections */ > static gboolean > connect_handler (GIOChannel *source, GIOCondition cond, gpointer data) >diff -urNp seahorse-0.8.2.org/agent/seahorse-agent-prompt.c seahorse-0.8.2/agent/seahorse-agent-prompt.c >--- seahorse-0.8.2.org/agent/seahorse-agent-prompt.c 2006-01-18 20:03:15.000000000 +0200 >+++ seahorse-0.8.2/agent/seahorse-agent-prompt.c 2007-01-30 12:20:55.000000000 +0200 >@@ -121,7 +121,7 @@ prompt_done_dialog (SeahorseAgentPassReq > > if (ok) { > >- pass = seahorse_agent_cache_get (pr->id); >+ pass = seahorse_agent_cache_get (pr->pass_as_data, pr->id); > g_assert (pass); > } > >diff -urNp seahorse-0.8.2.org/configure seahorse-0.8.2/configure >--- seahorse-0.8.2.org/configure 2006-07-10 20:41:43.000000000 +0300 >+++ seahorse-0.8.2/configure 2007-01-30 11:21:45.000000000 +0200 >@@ -19569,8 +19569,7 @@ else > fi; > > if test "$DO_CHECK" = "yes"; then >- major_versions="1" >- minor_versions="2 4" >+ accept_versions="1.2 1.4 2.0" > # Extract the first word of "gpg", so it can be a program name with args. > set dummy gpg; ac_word=$2 > echo "$as_me:$LINENO: checking for $ac_word" >&5 >@@ -19623,21 +19622,11 @@ echo $ECHO_N "checking for appropriate G > micro=`echo $gnupg_version | \ > sed 's/^gpg (GnuPG) \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'` > >- for ver in $major_versions; do >- if test "$ver" = "$major"; then >- >- # Check the minor version >- for ver2 in $minor_versions; do >- if test "$ver2" = "$minor"; then >- >+ for ver in $accept_versions; do >+ if test "$ver" = "$major.$minor"; then > ok="yes" > break >- >- fi >- done >- break >- >- fi >+ fi > done > > fi >diff -urNp seahorse-0.8.2.org/configure.in seahorse-0.8.2/configure.in >--- seahorse-0.8.2.org/configure.in 2006-07-10 20:40:35.000000000 +0300 >+++ seahorse-0.8.2/configure.in 2007-01-30 11:21:45.000000000 +0200 >@@ -59,8 +59,7 @@ AC_ARG_ENABLE(gpg-check, > DO_CHECK=$enableval, DO_CHECK=yes) > > if test "$DO_CHECK" = "yes"; then >- major_versions="1" >- minor_versions="2 4" >+ accept_versions="1.2 1.4 2.0" > AC_PATH_PROG(GNUPG, gpg, no) > ok="no" > if test "$GNUPG" != "no"; then >@@ -72,22 +71,12 @@ if test "$DO_CHECK" = "yes"; then > sed 's/^gpg (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` > micro=`echo $gnupg_version | \ > sed 's/^gpg (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` >- >- for ver in $major_versions; do >- if test "$ver" = "$major"; then >- >- # Check the minor version >- for ver2 in $minor_versions; do >- if test "$ver2" = "$minor"; then >- >+ >+ for ver in $accept_versions; do >+ if test "$ver" = "$major.$minor"; then > ok="yes" > break >- >- fi >- done >- break >- >- fi >+ fi > done > > fi >--- seahorse-0.8.2.org/libseahorse/seahorse-gpg-options.c 2005-10-06 01:00:24.000000000 +0300 >+++ seahorse-0.8.2/libseahorse/seahorse-gpg-options.c 2007-01-30 11:21:45.000000000 +0200 >@@ -32,7 +32,6 @@ > #include "seahorse-gpg-options.h" > > #define GPG_CONF_HEADER "# FILE CREATED BY SEAHORSE\n\n" >-#define GPG_VERSION_PREFIX "1." > > static gchar gpg_homedir[MAXPATHLEN]; > static gboolean gpg_options_inited = FALSE; >@@ -271,9 +270,11 @@ gpg_options_init (GError **err) > /* > * Make sure it's the right version for us to be messing > * around with the configuration file. >+ * Both 1.* and 2.* are suitable. > */ > g_return_val_if_fail (engine && engine->version && engine->file_name && >- g_str_has_prefix (engine->version, GPG_VERSION_PREFIX), >+ (g_str_has_prefix (engine->version, "1.") || >+ g_str_has_prefix (engine->version, "2.")), > (seahorse_util_gpgme_to_error > (GPG_E (GPG_ERR_INV_ENGINE), err), FALSE)); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 164523
:
108604
|
113289