seahorse r2178 - in trunk: . libseahorse
- From: sadam svn gnome org
- To: svn-commits-list gnome org
- Subject: seahorse r2178 - in trunk: . libseahorse
- Date: Thu, 17 Apr 2008 19:41:18 +0100 (BST)
Author: sadam
Date: Thu Apr 17 19:41:18 2008
New Revision: 2178
URL: http://svn.gnome.org/viewvc/seahorse?rev=2178&view=rev
Log:
2008-04-17 Adam Schreiber <sadam clemson edu>
* libseahorse/seahorse-secure-memory.c: Test for secure memory
before
remapping memory functions. Patch from Coleman Kane. Fixes bug
#527193
Modified:
trunk/ChangeLog
trunk/libseahorse/seahorse-secure-memory.c
Modified: trunk/libseahorse/seahorse-secure-memory.c
==============================================================================
--- trunk/libseahorse/seahorse-secure-memory.c (original)
+++ trunk/libseahorse/seahorse-secure-memory.c Thu Apr 17 19:41:18 2008
@@ -94,16 +94,34 @@
}
}
+static gboolean
+seahorse_try_gk_secure_memory ()
+{
+ gpointer p;
+
+ p = gnome_keyring_memory_try_alloc (10);
+ if (p != NULL) {
+ gnome_keyring_memory_free (p);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
void
seahorse_secure_memory_init ()
{
- GMemVTable vtable;
-
- memset (&vtable, 0, sizeof (vtable));
- vtable.malloc = switch_malloc;
- vtable.realloc = switch_realloc;
- vtable.free = switch_free;
- vtable.calloc = switch_calloc;
- g_mem_set_vtable (&vtable);
-}
+ if (seahorse_try_gk_secure_memory() == TRUE) {
+ GMemVTable vtable;
+ memset (&vtable, 0, sizeof (vtable));
+ vtable.malloc = switch_malloc;
+ vtable.realloc = switch_realloc;
+ vtable.free = switch_free;
+ vtable.calloc = switch_calloc;
+ g_mem_set_vtable (&vtable);
+ } else {
+ g_warning ("Unable to allocate secure memory from gnome-keyring.\n");
+ g_warning ("Proceeding using insecure memory for password fields.\n");
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]