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
=== modified file 'tests/acceptance-tests/test_client_authorization.cpp'
--- tests/acceptance-tests/test_client_authorization.cpp 2015-06-25 03:00:08 +0000
+++ tests/acceptance-tests/test_client_authorization.cpp 2015-08-10 10:28:07 +0000
@@ -64,15 +64,18 @@
64 struct SharedRegion64 struct SharedRegion
65 {65 {
66 sem_t client_creds_set;66 sem_t client_creds_set;
67 pid_t client_pid;67 pid_t client_pid = -1;
68 uid_t client_uid;68 uid_t client_uid = -1;
69 gid_t client_gid;69 gid_t client_gid = -1;
7070
71 bool matches_client_process_creds(mf::SessionCredentials const& creds)71 bool matches_client_process_creds(mf::SessionCredentials const& creds)
72 {72 {
73 // A perfect match is perfect. But sometimes it's not a perfect
74 // match and that's OK too. Because fakeroot (used in deb builds)
75 // returns 0 unconditionally, even for non-root users.
73 return client_pid == creds.pid() &&76 return client_pid == creds.pid() &&
74 client_uid == creds.uid() &&77 (client_uid == 0 || client_uid == creds.uid()) &&
75 client_gid == creds.gid();78 (client_gid == 0 || client_gid == creds.gid());
76 }79 }
7780
78 bool wait_for_client_creds()81 bool wait_for_client_creds()

Subscribers

People subscribed via source and target branches