Merge lp:~azzar1/unity/lp-1552537 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 4101
Proposed branch: lp:~azzar1/unity/lp-1552537
Merge into: lp:unity
Diff against target: 17 lines (+6/-2)
1 file modified
lockscreen/LockScreenController.cpp (+6/-2)
To merge this branch: bzr merge lp:~azzar1/unity/lp-1552537
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+290976@code.launchpad.net

Commit message

LockscreenController: Don't use SetActivate(False) for gnome-screensaver to prevent unlocking on tty switch.
It will not only deactivate the screensaver but also unlock the screen.

Description of the change

LockscreenController: Don't use SetActivate(False) for gnome-screensaver to prevent unlocking on tty switch.
It will not only deactivate the screensaver but also unlock the screen.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Bella lì!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lockscreen/LockScreenController.cpp'
2--- lockscreen/LockScreenController.cpp 2016-03-31 09:59:30 +0000
3+++ lockscreen/LockScreenController.cpp 2016-04-05 17:16:44 +0000
4@@ -426,8 +426,12 @@
5 {
6 if (Settings::Instance().use_legacy())
7 {
8- auto proxy = std::make_shared<glib::DBusProxy>("org.gnome.ScreenSaver", "/org/gnome/ScreenSaver", "org.gnome.ScreenSaver");
9- proxy->CallBegin("SetActive", g_variant_new("(b)", activate != FALSE), [proxy] (GVariant*, glib::Error const&) {});
10+ // SetActive(FALSE) will unlock the screen. This used to cause security issues (see lp:1552537).
11+ if (activate)
12+ {
13+ auto proxy = std::make_shared<glib::DBusProxy>("org.gnome.ScreenSaver", "/org/gnome/ScreenSaver", "org.gnome.ScreenSaver");
14+ proxy->CallBegin("SetActive", g_variant_new("(b)", TRUE), [proxy] (GVariant*, glib::Error const&) {});
15+ }
16 return;
17 }
18