Merge lp:~mhr3/libunity/no-remote-writes into lp:libunity

Proposed by Michal Hruby
Status: Merged
Approved by: Michal Hruby
Approved revision: 257
Merged at revision: 257
Proposed branch: lp:~mhr3/libunity/no-remote-writes
Merge into: lp:libunity
Diff against target: 44 lines (+10/-4)
2 files modified
src/unity-models.vala (+2/-1)
src/unity-scope-channel.vala (+8/-3)
To merge this branch: bzr merge lp:~mhr3/libunity/no-remote-writes
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
James Henstridge Approve
Review via email: mp+174683@code.launchpad.net

Commit message

Don't allow commits from other peers to channels' result models

Description of the change

Don't allow commits from other peers to channels' result models.

To post a comment you must log in.
Revision history for this message
James Henstridge (jamesh) wrote :

Looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
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/unity-models.vala'
2--- src/unity-models.vala 2013-07-08 11:24:43 +0000
3+++ src/unity-models.vala 2013-07-15 10:39:23 +0000
4@@ -104,7 +104,8 @@
5 public DiffModel (Dee.Peer peer, Dee.Model target)
6 {
7 var model = new Dee.SequenceModel ();
8- Object (peer: peer, back_end: model, target_model: target);
9+ Object (peer: peer, back_end: model, target_model: target,
10+ access_mode: Dee.SharedModelAccessMode.LEADER_WRITABLE);
11 }
12
13 public Dee.Model target_model { get; construct set; }
14
15=== modified file 'src/unity-scope-channel.vala'
16--- src/unity-scope-channel.vala 2013-07-05 12:15:48 +0000
17+++ src/unity-scope-channel.vala 2013-07-15 10:39:23 +0000
18@@ -135,8 +135,11 @@
19 vardict_schema[field_name] = schema;
20 }
21
22- Dee.Peer peer = ChannelFlags.PRIVATE in flags ?
23- new Dee.Server (swarm_name) : new Dee.Peer (swarm_name);
24+ var peer_type = ChannelFlags.PRIVATE in flags ?
25+ typeof (Dee.Server) : typeof (Dee.Peer);
26+ Dee.Peer peer = Object.new (peer_type,
27+ "swarm-name", swarm_name,
28+ "swarm-owner", true) as Dee.Peer;
29
30 /* If NO_FILTERING is not specified, create_backend_model () will return
31 * a FilterModel which will ensure that all required fields
32@@ -167,9 +170,11 @@
33 }
34 else
35 {
36+ var mode_flag = Dee.SharedModelAccessMode.LEADER_WRITABLE;
37 var sm = Object.new (typeof (Dee.SharedModel),
38 "peer", peer,
39- "back-end", backend) as Dee.SharedModel;
40+ "back-end", backend,
41+ "access-mode", mode_flag) as Dee.SharedModel;
42 sm.flush_mode = Dee.SharedModelFlushMode.MANUAL;
43 transfer_model = sm;
44 }

Subscribers

People subscribed via source and target branches