Mir

Merge lp:~vanvugt/mir/fix-1483097 into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Alberto Aguirre
Approved revision: no longer in the source branch.
Merged at revision: 2827
Proposed branch: lp:~vanvugt/mir/fix-1483097
Merge into: lp:mir
Diff against target: 27 lines (+8/-5)
1 file modified
tests/acceptance-tests/test_client_authorization.cpp (+8/-5)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1483097
Reviewer Review Type Date Requested Status
Kevin DuBois (community) Approve
Cemil Azizoglu (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+267497@code.launchpad.net

Commit message

Fix spurious test failure that occurs under fakeroot, during deb
builds:
  ClientCredsTestFixture.
  session_authorizer_receives_pid_of_connecting_clients
(LP: #1483097)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Ok

review: Approve
Revision history for this message
Kevin DuBois (kdub) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/acceptance-tests/test_client_authorization.cpp'
2--- tests/acceptance-tests/test_client_authorization.cpp 2015-06-25 03:00:08 +0000
3+++ tests/acceptance-tests/test_client_authorization.cpp 2015-08-10 10:28:07 +0000
4@@ -64,15 +64,18 @@
5 struct SharedRegion
6 {
7 sem_t client_creds_set;
8- pid_t client_pid;
9- uid_t client_uid;
10- gid_t client_gid;
11+ pid_t client_pid = -1;
12+ uid_t client_uid = -1;
13+ gid_t client_gid = -1;
14
15 bool matches_client_process_creds(mf::SessionCredentials const& creds)
16 {
17+ // A perfect match is perfect. But sometimes it's not a perfect
18+ // match and that's OK too. Because fakeroot (used in deb builds)
19+ // returns 0 unconditionally, even for non-root users.
20 return client_pid == creds.pid() &&
21- client_uid == creds.uid() &&
22- client_gid == creds.gid();
23+ (client_uid == 0 || client_uid == creds.uid()) &&
24+ (client_gid == 0 || client_gid == creds.gid());
25 }
26
27 bool wait_for_client_creds()

Subscribers

People subscribed via source and target branches