Add contact-service and email-service rule to read shared dirs.
authorJanusz Kozerski <j.kozerski@samsung.com>
Tue, 9 Jul 2013 08:13:32 +0000 (10:13 +0200)
committerJanusz Kozerski <j.kozerski@samsung.com>
Tue, 9 Jul 2013 08:13:32 +0000 (10:13 +0200)
[Issue#]        N/A
[Bug/Feature]   Add contact-service and email-service rule to read shared dirs.
[Cause]         N/A
[Solution]      N/A
[Verification]  Build, run tests, check if "contats-service ~SHARED_DIR~ rx" and
                "email-service ~SHARED_DIR~ rx" rules are pressent in system.

Change-Id: I0a54ac67a15e9dd5e6509eecd5bdffbc008379ce

src/privilege-control.c

index 5996ec0..e99ccbf 100644 (file)
@@ -1855,6 +1855,18 @@ API int app_setup_path(const char* pkg_id, const char* path, app_path_type_t app
                        free(app_ids[i]);
                }
 
+               // TODO: This is only a quick fix. Should be re-write to use rule-config file.
+               ret = app_add_rule("contacts-service", label, "rx");
+               if (ret != PC_OPERATION_SUCCESS) {
+                       C_LOGE("smack_accesses_new failed");
+                       return ret;
+               }
+               ret = app_add_rule("email-service", label, "rx");
+               if (ret != PC_OPERATION_SUCCESS) {
+                       C_LOGE("smack_accesses_new failed");
+                       return ret;
+               }
+
                return PC_OPERATION_SUCCESS;
        }