rpms/seahorse-plugins/F-12 gnupg-getinfo.patch, NONE, 1.1 seahorse-plugins.spec, 1.30, 1.31
Matthias Clasen
mclasen at fedoraproject.org
Thu Oct 8 00:28:56 UTC 2009
Author: mclasen
Update of /cvs/pkgs/rpms/seahorse-plugins/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9649
Modified Files:
seahorse-plugins.spec
Added Files:
gnupg-getinfo.patch
Log Message:
implement GETINFO
gnupg-getinfo.patch:
seahorse-agent-io.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++-
seahorse-agent-prompt.c | 9 ++++-
seahorse-agent.h | 1
3 files changed, 90 insertions(+), 3 deletions(-)
--- NEW FILE gnupg-getinfo.patch ---
diff --git a/agent/seahorse-agent-io.c b/agent/seahorse-agent-io.c
index 11f2a3c..ffb9417 100644
--- a/agent/seahorse-agent-io.c
+++ b/agent/seahorse-agent-io.c
@@ -93,12 +93,14 @@ struct _SeahorseAgentConn {
#define ASS_OPTION "OPTION"
#define ASS_GETPASS "GET_PASSPHRASE"
#define ASS_CLRPASS "CLEAR_PASSPHRASE"
+#define ASS_GETINFO "GETINFO"
#define ASS_OPT_DISPLAY "display="
/* Options */
#define ASS_FLAG_DATA "data"
#define ASS_FLAG_CHECK "check"
+#define ASS_FLAG_REPEAT "repeat"
/* Responses */
#define ASS_OK "OK "
@@ -269,8 +271,21 @@ static guint32
parse_assuan_flag (gchar *flag)
{
g_assert (flag);
- if (g_str_equal (flag, "data"))
+ if (g_str_equal (flag, ASS_FLAG_DATA))
return SEAHORSE_AGENT_PASS_AS_DATA;
+ else if (g_str_has_prefix (flag, ASS_FLAG_REPEAT)) {
+ gint count = 1;
+
+ flag += strlen(ASS_FLAG_REPEAT);
+ if (*flag == '=') {
+ count = atoi (++flag);
+ if (!(count == 0 || count == 1))
+ g_warning ("--repeat=%d treated as --repeat=1", count);
+ }
+
+ if (count)
+ return SEAHORSE_AGENT_REPEAT;
+ }
return 0;
}
@@ -373,6 +388,68 @@ x11_displays_eq (const gchar *d1, const gchar *d2)
return (g_ascii_strncasecmp (d1, d2, l1 > l2 ? l1 : l2) == 0);
}
+/* Does command have option? */
+static gboolean
+command_has_option (SeahorseAgentConn *cn, gchar * command, gchar * option)
+{
+ gboolean has_option = FALSE;
+
+ if (!strcmp (command, ASS_GETPASS)) {
+ has_option = (!strcmp (option, ASS_FLAG_DATA) ||
+ !strcmp (option, ASS_FLAG_REPEAT));
+ }
+ /* else if (other commands) */
+
+ if (has_option)
+ seahorse_agent_io_reply (cn, TRUE, NULL);
+
+ return has_option;
+}
+
+/* Process a GETINFO request */
+static void
+ass_getinfo (SeahorseAgentConn *cn, gchar * request)
+{
+ gchar *args;
+ gboolean implemented = FALSE;
+
+ args = strchr (request, ' ');
+ if (args) {
+ *args = 0;
+ args++;
+ while (isspace (*args))
+ args++;
+ }
+
+ if (!strcmp (request, "cmd_has_option")) {
+ gchar *command = args;
+ gchar *option;
+
+ if (!command || !*command) {
+ seahorse_agent_io_reply (cn, FALSE, "105 parameter error");
+ return;
+ }
+
+ option = strchr(args, ' ');
+
+ if (option) {
+ *option = 0;
+ option++;
+ while (isspace (*option))
+ option++;
+ } else {
+ seahorse_agent_io_reply (cn, FALSE, "105 parameter error");
+ return;
+ }
+
+ implemented = command_has_option(cn, command, option);
+ }
+ /* else if (other info request) */
+
+ if (!implemented)
+ seahorse_agent_io_reply (cn, FALSE, "100 not implemented");
+}
+
/* Process a request line from client */
static void
process_line (SeahorseAgentConn *cn, gchar *string)
@@ -484,6 +561,10 @@ process_line (SeahorseAgentConn *cn, gchar *string)
seahorse_agent_actions_clrpass (cn, id);
}
+ else if (strcasecmp (string, ASS_GETINFO) == 0) {
+ ass_getinfo (cn, args);
+ }
+
else if (strcasecmp (string, ASS_NOP) == 0) {
seahorse_agent_io_reply (cn, TRUE, NULL);
}
diff --git a/agent/seahorse-agent-prompt.c b/agent/seahorse-agent-prompt.c
index e897464..b69b773 100644
--- a/agent/seahorse-agent-prompt.c
+++ b/agent/seahorse-agent-prompt.c
@@ -155,8 +155,13 @@ seahorse_agent_prompt_pass (SeahorseAgentPassReq *pr)
g_return_if_fail (!seahorse_agent_prompt_have ());
- dialog = seahorse_passphrase_prompt_show (NULL, pr->errmsg ? pr->errmsg : pr->description,
- pr->prompt, NULL, FALSE);
+ dialog =
+ seahorse_passphrase_prompt_show (NULL,
+ (pr->errmsg ?
+ pr->errmsg : pr->description),
+ pr->prompt, NULL,
+ pr->flags & SEAHORSE_AGENT_REPEAT);
+
g_signal_connect (dialog, "response", G_CALLBACK (passphrase_response), pr);
g_current_win = GTK_WIDGET (dialog);
}
diff --git a/agent/seahorse-agent.h b/agent/seahorse-agent.h
index 92267a9..0be3209 100644
--- a/agent/seahorse-agent.h
+++ b/agent/seahorse-agent.h
@@ -81,6 +81,7 @@ void seahorse_agent_io_data (SeahorseAgentConn *cn, const gchar *data);
*/
#define SEAHORSE_AGENT_PASS_AS_DATA 0x00000001
+#define SEAHORSE_AGENT_REPEAT 0x00000002
typedef struct _SeahorseAgentPassReq {
const gchar *id;
Index: seahorse-plugins.spec
===================================================================
RCS file: /cvs/pkgs/rpms/seahorse-plugins/F-12/seahorse-plugins.spec,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -p -r1.30 -r1.31
--- seahorse-plugins.spec 24 Sep 2009 02:24:26 -0000 1.30
+++ seahorse-plugins.spec 8 Oct 2009 00:28:56 -0000 1.31
@@ -1,6 +1,6 @@
Name: seahorse-plugins
Version: 2.28.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Plugins and utilities for encryption in GNOME
Group: User Interface/Desktops
License: GPLv2+ and GFDL
@@ -8,6 +8,9 @@ URL: http://projects.gnome.or
Source: http://download.gnome.org/sources/seahorse-plugins/2.28/%{name}-%{version}.tar.bz2
Source1: seahorse-agent.sh
+# from upstream: https://bugzilla.gnome.org/show_bug.cgi?id=586855
+Patch0: gnupg-getinfo.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: intltool
@@ -59,6 +62,7 @@ from applications like nautilus or gedit
%prep
%setup -q
+%patch0 -p1 -b .getinfo
autoreconf -i -f
@@ -183,6 +187,9 @@ fi
#%{_libdir}/epiphany/2.27/extensions/seahorse.ephy-extension
%changelog
+* Wed Oct 7 2009 Matthias Clasen <mclasen at redhat.com> - 2.28.0-2
+- Implement GETINFO to make seahorse-agent work with gnupg >= 2.0.12
+
* Wed Sep 23 2009 Matthias Clasen <mclasen at redhat.com> - 2.28.0-1
- Update to 2.28.0
More information about the fedora-extras-commits
mailing list