Merge lp:~teemperor/pantheon-greeter/fix-1130246 into lp:~elementary-pantheon/pantheon-greeter/trunk

Proposed by Raphael Isemann
Status: Merged
Approved by: Cody Garver
Approved revision: 204
Merged at revision: 204
Proposed branch: lp:~teemperor/pantheon-greeter/fix-1130246
Merge into: lp:~elementary-pantheon/pantheon-greeter/trunk
Diff against target: 42 lines (+16/-0)
3 files modified
CMakeLists.txt (+1/-0)
src/PantheonGreeter.vala (+3/-0)
vapi/posix-fixes.vapi (+12/-0)
To merge this branch: bzr merge lp:~teemperor/pantheon-greeter/fix-1130246
Reviewer Review Type Date Requested Status
Cody Garver (community) Abstain
Tom Beckmann (community) Approve
Sergey "Shnatsel" Davidoff (community) Abstain
Review via email: mp+172980@code.launchpad.net

This proposal supersedes a proposal from 2013-02-19.

Commit message

Call mlockall to prevent swapping of security-related data to fix bug #1130246.

Description of the change

The posix-fixes.vapi is needed because the mlockall isn't included in the system-vapi.
Kudos to the unity-greeter devs at canonical for the good tipps.

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote : Posted in a previous version of this proposal

Merge issue:

+N vapi/posix-fixes.vapi
 M CMakeLists.txt
 M src/PantheonGreeter.vala
Text conflict in CMakeLists.txt
1 conflicts encountered.

review: Needs Fixing
Revision history for this message
Cody Garver (codygarver) wrote : Posted in a previous version of this proposal

WIP, waiting on shnatsel collaboration with teemperor.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote : Posted in a previous version of this proposal

I don't think you need a new VAPI for this, Rico showed me a much simpler way to do that. For example, here's how I added fchmod which was missing from POSIX VAPI: http://bazaar.launchpad.net/~shnatsel/elementaryos/bluetooth-tryexecd-vala/view/head:/bluetooth-tryexecd.vala#L31

Btw, make sure you upstream your VAPI changes. Talking to Rico about it might be a good starting point.

review: Needs Fixing
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote : Posted in a previous version of this proposal

Other than that, looks good to me.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote : Posted in a previous version of this proposal

<ricotz> shnatsel, teemperor, better use a vapi if you need that much bindings

So, disregard my complaints. Still,

<ricotz> teemperor, better put it in an more private namespace (not Posix) to avoid clashes with future vala versions if you like to get the upstreamed

review: Abstain
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) :
review: Abstain
Revision history for this message
Tom Beckmann (tombeckmann) wrote :

Never heard of that function, but I will trust the docs here, the code looks fine.

review: Approve
Revision history for this message
Cody Garver (codygarver) :
review: Abstain

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-06-20 08:58:19 +0000
3+++ CMakeLists.txt 2013-07-04 09:27:30 +0000
4@@ -49,6 +49,7 @@
5 clutter-gtk-1.0
6 indicator-0.4
7 gl
8+ posix-fixes
9 OPTIONS
10 --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi
11 )
12
13=== modified file 'src/PantheonGreeter.vala'
14--- src/PantheonGreeter.vala 2013-06-16 19:55:36 +0000
15+++ src/PantheonGreeter.vala 2013-07-04 09:27:30 +0000
16@@ -287,6 +287,9 @@
17 }
18
19 public static int main (string [] args) {
20+ /* Protect memory from being paged to disk, as we deal with passwords */
21+ PosixMLock.mlockall (PosixMLock.MCL_CURRENT | PosixMLock.MCL_FUTURE);
22+
23 var init = GtkClutter.init (ref args);
24 if (init != Clutter.InitError.SUCCESS)
25 error ("Clutter could not be intiailized");
26
27=== added file 'vapi/posix-fixes.vapi'
28--- vapi/posix-fixes.vapi 1970-01-01 00:00:00 +0000
29+++ vapi/posix-fixes.vapi 2013-07-04 09:27:30 +0000
30@@ -0,0 +1,12 @@
31+[CCode (cprefix = "", lower_case_cprefix = "")]
32+namespace PosixMLock
33+{
34+ [CCode (cheader_filename = "sys/mman.h")]
35+ public const int MCL_CURRENT;
36+ [CCode (cheader_filename = "sys/mman.h")]
37+ public const int MCL_FUTURE;
38+ [CCode (cheader_filename = "sys/mman.h")]
39+ public int mlockall (int flags);
40+ [CCode (cheader_filename = "sys/mman.h")]
41+ public int munlockall ();
42+}

Subscribers

People subscribed via source and target branches