Merge lp:~thomas-voss/location-service/hot-fix-for-camera-app-and-osmtouch into lp:location-service/trunk

Proposed by Thomas Voß on 2014-08-07
Status: Merged
Approved by: Ricardo Salveti on 2014-08-07
Approved revision: 85
Merged at revision: 84
Proposed branch: lp:~thomas-voss/location-service/hot-fix-for-camera-app-and-osmtouch
Merge into: lp:location-service/trunk
Diff against target: 41 lines (+19/-0)
1 file modified
src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp (+19/-0)
To merge this branch: bzr merge lp:~thomas-voss/location-service/hot-fix-for-camera-app-and-osmtouch
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2014-08-08
Ricardo Salveti 2014-08-07 Approve on 2014-08-07
Review via email: mp+229975@code.launchpad.net

Commit message

Add camera app and osm touch to the whitelist for permission mgmt.

Description of the change

Add camera app and osm touch to the whitelist for permission mgmt.

To post a comment you must log in.
Ricardo Salveti (rsalveti) :
review: Needs Information
85. By Thomas Voß on 2014-08-07

Adjust camera-app version.

Ricardo Salveti (rsalveti) wrote :

Looks fine, can bite us again soon but better then allowing any version and forgetting to remove this fix.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp'
2--- src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp 2014-08-05 19:36:05 +0000
3+++ src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp 2014-08-07 20:41:24 +0000
4@@ -30,11 +30,24 @@
5
6 #include <sys/apparmor.h>
7
8+#include <set>
9+
10 namespace location = com::ubuntu::location;
11 namespace service = com::ubuntu::location::service;
12
13 namespace
14 {
15+std::set<std::string> whitelisted_apps
16+{
17+ "com.ubuntu.camera_camera_3.0.0.342",
18+ "me.yohanboniface.osmtouch_OSMTouch_0.1.3"
19+};
20+
21+bool is_application_with_confinement_profile_whitelisted(const std::string& profile)
22+{
23+ return whitelisted_apps.count(profile) > 0;
24+}
25+
26 bool is_running_under_testing()
27 {
28 return core::posix::this_process::env::get(
29@@ -133,6 +146,12 @@
30 return service::PermissionManager::Result::rejected;
31 }
32
33+ // This is an ugly hack to prevent a revert. It will be removed as soon as
34+ // https://bugs.launchpad.net/qtmir/+bug/1352977 is fixed. A separate bug tracks the removal
35+ // of this hack: https://bugs.launchpad.net/location-service/+bug/1354080
36+ if (is_application_with_confinement_profile_whitelisted(profile))
37+ return Result::granted;
38+
39 std::string description;
40
41 if (profile == "unconfined")

Subscribers

People subscribed via source and target branches