summaryrefslogtreecommitdiffstats
path: root/source/l/gnome-keyring/gpg-agent-Hook-up-the-TTL-cache-option.patch
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2012-09-26 01:10:42 +0000
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:51:55 +0200
commit9664bee729d487bcc0a0bc35859f8e13d5421c75 (patch)
treeb428a16618e36ed864a8d76ea3435e19a452bf90 /source/l/gnome-keyring/gpg-agent-Hook-up-the-TTL-cache-option.patch
parent75a4a592e5ccda30715f93563d741b83e0dcf39e (diff)
downloadcurrent-9664bee729d487bcc0a0bc35859f8e13d5421c75.tar.gz
current-9664bee729d487bcc0a0bc35859f8e13d5421c75.tar.xz
Slackware 14.0slackware-14.0
Wed Sep 26 01:10:42 UTC 2012 Slackware 14.0 x86_64 stable is released! We're perfectionists here at Slackware, so this release has been a long time a-brewing. But we think you'll agree that it was worth the wait. Slackware 14.0 combines modern components, ease of use, and flexible configuration... our "KISS" philosophy demands it. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. Thanks to everyone who helped make this happen. The Slackware team, the upstream developers, and (of course) the awesome Slackware user community. Have fun! :-)
Diffstat (limited to 'source/l/gnome-keyring/gpg-agent-Hook-up-the-TTL-cache-option.patch')
-rw-r--r--source/l/gnome-keyring/gpg-agent-Hook-up-the-TTL-cache-option.patch98
1 files changed, 98 insertions, 0 deletions
diff --git a/source/l/gnome-keyring/gpg-agent-Hook-up-the-TTL-cache-option.patch b/source/l/gnome-keyring/gpg-agent-Hook-up-the-TTL-cache-option.patch
new file mode 100644
index 000000000..c1298f759
--- /dev/null
+++ b/source/l/gnome-keyring/gpg-agent-Hook-up-the-TTL-cache-option.patch
@@ -0,0 +1,98 @@
+From 7b65bf04737167fae6b0204d6524215550fcc079 Mon Sep 17 00:00:00 2001
+From: Stef Walter <stefw@gnome.org>
+Date: Wed, 8 Aug 2012 06:06:58 +0200
+Subject: [PATCH] gpg-agent: Hook up the TTL cache option
+
+ * So that when the gsettings gpg-cache-method is 'idle' or 'timeout'
+ we use gpg-cache-ttl to control how long the passphrase is cached
+ for.
+ * This is a regression from 3.3.x
+
+https://bugzilla.gnome.org/show_bug.cgi?id=681081
+---
+ daemon/gpg-agent/gkd-gpg-agent-ops.c | 40 ++++++++++++++++++++++--------------
+ 1 file changed, 25 insertions(+), 15 deletions(-)
+
+diff --git a/daemon/gpg-agent/gkd-gpg-agent-ops.c b/daemon/gpg-agent/gkd-gpg-agent-ops.c
+index a1a21ff..e1c188d 100644
+--- a/daemon/gpg-agent/gkd-gpg-agent-ops.c
++++ b/daemon/gpg-agent/gkd-gpg-agent-ops.c
+@@ -323,17 +323,6 @@ load_unlock_options (GcrPrompt *prompt)
+ g_free (method);
+ }
+
+-static void
+-save_unlock_options (GcrPrompt *prompt)
+-{
+- GSettings *settings;
+-
+- settings = gkd_gpg_agent_settings ();
+-
+- if (gcr_prompt_get_choice_chosen (prompt))
+- g_settings_set_string (settings, "gpg-cache-method", GCR_UNLOCK_OPTION_ALWAYS);
+-}
+-
+ static GcrPrompt *
+ open_password_prompt (GckSession *session,
+ const gchar *keyid,
+@@ -406,11 +395,14 @@ do_get_password (GckSession *session, const gchar *keyid, const gchar *errmsg,
+ const gchar *prompt_text, const gchar *description, gboolean confirm)
+ {
+ GckBuilder builder = GCK_BUILDER_INIT;
++ GSettings *settings;
+ GckAttributes *attrs;
+ gchar *password = NULL;
+ GcrPrompt *prompt;
+ gboolean chosen;
+ GError *error = NULL;
++ gint lifetime;
++ gchar *method;
+
+ g_assert (GCK_IS_SESSION (session));
+
+@@ -431,21 +423,39 @@ do_get_password (GckSession *session, const gchar *keyid, const gchar *errmsg,
+ }
+
+ if (password != NULL && keyid != NULL) {
++ settings = gkd_gpg_agent_settings ();
+
+ /* Load up the save options */
+ chosen = gcr_prompt_get_choice_chosen (prompt);
+
+- if (chosen)
++ if (chosen) {
++ g_settings_set_string (settings, "gpg-cache-method", GCR_UNLOCK_OPTION_ALWAYS);
+ gck_builder_add_string (&builder, CKA_G_COLLECTION, "login");
+- else
++
++ } else {
++ method = g_settings_get_string (settings, "gpg-cache-method");
++ lifetime = g_settings_get_int (settings, "gpg-cache-ttl");
++
++ if (g_strcmp0 (method, GCR_UNLOCK_OPTION_IDLE) == 0) {
++ gck_builder_add_boolean (&builder, CKA_GNOME_TRANSIENT, TRUE);
++ gck_builder_add_ulong (&builder, CKA_G_DESTRUCT_IDLE, lifetime);
++
++ } else if (g_strcmp0 (method, GCR_UNLOCK_OPTION_TIMEOUT) == 0) {
++ gck_builder_add_boolean (&builder, CKA_GNOME_TRANSIENT, TRUE);
++ gck_builder_add_ulong (&builder, CKA_G_DESTRUCT_AFTER, lifetime);
++
++ } else if (g_strcmp0 (method, GCR_UNLOCK_OPTION_SESSION)){
++ g_message ("Unsupported gpg-cache-method setting: %s", method);
++ }
++
+ gck_builder_add_string (&builder, CKA_G_COLLECTION, "session");
++ g_free (method);
++ }
+
+ /* Now actually save the password */
+ attrs = gck_attributes_ref_sink (gck_builder_end (&builder));
+ do_save_password (session, keyid, description, password, attrs);
+ gck_attributes_unref (attrs);
+-
+- save_unlock_options (prompt);
+ }
+
+ g_clear_object (&prompt);
+--
+1.7.11.2 \ No newline at end of file