gnome-keyring/gnome-keyring-no-human-secu...

60 lines
1.8 KiB
Diff

Index: configure.in
===================================================================
--- configure.in (revision 1140)
+++ configure.in (working copy)
@@ -297,6 +297,17 @@
fi
fi
+# --------------------------------------------------------------------
+# Mess with this if you want to cause user confusion
+
+AC_ARG_ENABLE(unreliable-human-guesswork-security,
+ AC_HELP_STRING([--enable-unreliable-human-guesswork-security],
+ [Enable if you want to ask users incomprehensible questions]))
+
+if test x"$enable_unreliable_human_guesswork_security" == x"yes"; then
+ AC_DEFINE(ENABLE_UNRELIABLE_HUMAN_GUESSWORK_SECURITY, 1, [Whether to ask users incomprehensible questions])
+fi
+
AC_ARG_WITH([pam-dir],
[AC_HELP_STRING([--with-pam-dir=DIR],
[directory to install pam modules in])],
Index: daemon/gkr-daemon-ops.c
===================================================================
--- daemon/gkr-daemon-ops.c (revision 1140)
+++ daemon/gkr-daemon-ops.c (working copy)
@@ -145,6 +145,7 @@
}
}
+#ifdef ENABLE_UNRELIABLE_HUMAN_GUESSWORK_SECURITY
static guint
check_acl_ask_request (GkrAskRequest* ask, GnomeKeyringApplicationRef *app)
{
@@ -198,11 +199,16 @@
/* Continue with prompting */
return GKR_ASK_DONT_CARE;
}
+#endif
static gboolean
request_item_access (GkrKeyringRequest *req, GkrKeyringItem *item,
GnomeKeyringAccessType access_type, gboolean secret)
{
+/* Asking general users this kind of question simply does not work. */
+#ifndef ENABLE_UNRELIABLE_HUMAN_GUESSWORK_SECURITY
+ return TRUE;
+#else
GnomeKeyringApplicationRef *app = req->app_ref;
const gchar *keyring_name = NULL;
GkrAskRequest *ask;
@@ -279,6 +285,7 @@
g_object_unref (ask);
return ret;
+#endif
}
static gboolean