From 9273d06df99648652b98adf86d7562811eb323b8 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 10 Nov 2005 07:47:34 +0000 Subject: check if OpenPGP protocol is available on startup. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@733 ee746299-78ed-0310-b773-934348b2243d --- src/passphrase.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/passphrase.c') diff --git a/src/passphrase.c b/src/passphrase.c index d4f50489..84c1c5b2 100644 --- a/src/passphrase.c +++ b/src/passphrase.c @@ -44,7 +44,9 @@ #include #include #include -#include +#if HAVE_SYS_MMAN_H +# include +#endif #include "passphrase.h" #include "prefs_common.h" @@ -263,7 +265,9 @@ create_description(const gchar *uid_hint, const gchar *pass_hint, gint prev_bad) static int free_passphrase(gpointer _unused) { if (last_pass != NULL) { +#if HAVE_MLOCK munlock(last_pass, strlen(last_pass)); +#endif g_free(last_pass); last_pass = NULL; debug_print("%% passphrase removed"); @@ -295,8 +299,10 @@ gpgmegtk_passphrase_cb(void *opaque, const char *uid_hint, else { if (prefs_common.store_passphrase) { last_pass = g_strdup(pass); +#if HAVE_MLOCK if (mlock(last_pass, strlen(last_pass)) == -1) debug_print("%% locking passphrase failed"); +#endif if (prefs_common.store_passphrase_timeout > 0) { gtk_timeout_add(prefs_common.store_passphrase_timeout*60*1000, -- cgit v1.2.3