[tracker/miner-web: 30/31] libtracker-miner: Lock memory in Gnome password provider



commit fc4eef25ee835ad993fa17993b02194d03560308
Author: Adrien Bustany <madcat mymadcat com>
Date:   Thu Nov 12 17:31:09 2009 -0300

    libtracker-miner: Lock memory in Gnome password provider
    
    This commit adds a mlock call on the string returned by tracker_password_manager_get
    in gnome-keyring-password provider.

 src/libtracker-miner/gnome-password-provider.vala |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-miner/gnome-password-provider.vala b/src/libtracker-miner/gnome-password-provider.vala
index 6a3d204..e311020 100644
--- a/src/libtracker-miner/gnome-password-provider.vala
+++ b/src/libtracker-miner/gnome-password-provider.vala
@@ -42,7 +42,10 @@ namespace Tracker {
 							username = a.value.string;
 						}
 					}
-					return f.secret;
+					string *secret = malloc (f.secret.size ()+1);
+					Posix.mlock (secret, f.secret.size ()+1);
+					Memory.copy (secret, f.secret, f.secret.size ()+1);
+					return (owned)secret;
 				}
 
 			} else if (r == GnomeKeyring.Result.NO_MATCH) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]