Merge lp:~mir-team/unity-system-compositor/override-cookie-authority into lp:unity-system-compositor

Proposed by Brandon Schaefer
Status: Merged
Approved by: Brandon Schaefer
Approved revision: 268
Merged at revision: 270
Proposed branch: lp:~mir-team/unity-system-compositor/override-cookie-authority
Merge into: lp:unity-system-compositor
Diff against target: 58 lines (+34/-0)
1 file modified
src/server.cpp (+34/-0)
To merge this branch: bzr merge lp:~mir-team/unity-system-compositor/override-cookie-authority
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Chris Halse Rogers Approve
Alberto Aguirre (community) Approve
Andreas Pokorny (community) Approve
Review via email: mp+283657@code.launchpad.net

Commit message

Set the cookie authority to a stub that does not do anything because we dont need cookies in USC.

The overall issue is mir cookie authority depends on needing to create a secret. This secret depends on randomness ie. urandom. So a system booting up that depends on the mir server will then need to block until urandom has some entropy. Really USC does not need the cookie authority so, we are overrideing it so we dont block on boot.

Description of the change

Set the cookie authority to a stub that does not do anything because we dont need cookies in USC.

The overall issue is mir cookie authority depends on needing to create a secret. This secret depends on randomness ie. urandom. So a system booting up that depends on the mir server will then need to block until urandom has some entropy. Really USC does not need the cookie authority so, we are overrideing it so we dont block on boot.

To post a comment you must log in.
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

OK, needs a mir dep ver bump though.

review: Needs Fixing
267. By Brandon Schaefer

* Bump to 0.19

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

ok

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
268. By Brandon Schaefer

* Wait for release branch to do this

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

OK, I guess we don't need to bump when merging to lp:unity-system-compositor...confusing.

review: Approve
Revision history for this message
Chris Halse Rogers (raof) wrote :

Looks OK to me.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server.cpp'
2--- src/server.cpp 2016-01-19 21:43:11 +0000
3+++ src/server.cpp 2016-01-22 17:33:53 +0000
4@@ -32,6 +32,7 @@
5 #include "display_configuration_policy.h"
6 #include "steady_clock.h"
7
8+#include <mir/cookie/authority.h>
9 #include <mir/input/cursor_listener.h>
10 #include <mir/server_status_listener.h>
11 #include <mir/shell/focus_controller.h>
12@@ -99,6 +100,33 @@
13
14 std::shared_ptr<msh::FocusController> const focus_controller;
15 };
16+
17+struct StubCookie : public mir::cookie::Cookie
18+{
19+ uint64_t timestamp() const override
20+ {
21+ return 0;
22+ }
23+
24+ std::vector<uint8_t> serialize() const override
25+ {
26+ return std::vector<uint8_t>();
27+ }
28+};
29+
30+struct StubCookieAuthority : public mir::cookie::Authority
31+{
32+ std::unique_ptr<mir::cookie::Cookie> make_cookie(uint64_t const& timestamp) override
33+ {
34+ return std::unique_ptr<StubCookie>(new StubCookie());
35+ }
36+
37+ std::unique_ptr<mir::cookie::Cookie> make_cookie(std::vector<uint8_t> const& raw_cookie) override
38+ {
39+ return std::unique_ptr<StubCookie>(new StubCookie());
40+ }
41+};
42+
43 const char* const dm_from_fd = "from-dm-fd";
44 const char* const dm_to_fd = "to-dm-fd";
45 const char* const dm_stub = "debug-without-dm";
46@@ -160,6 +188,12 @@
47 the_session_switcher());
48 });
49
50+ override_the_cookie_authority([this]()
51+ -> std::shared_ptr<mir::cookie::Authority>
52+ {
53+ return std::make_unique<StubCookieAuthority>();
54+ });
55+
56 set_config_filename("unity-system-compositor.conf");
57
58 apply_settings();

Subscribers

People subscribed via source and target branches