From: Rafal Krypa Date: Mon, 19 Aug 2013 12:06:43 +0000 (+0200) Subject: Fix unwanted differences between SLP and RSA repositories. X-Git-Tag: accepted/tizen/generic/20140307.163253~1^2~22^2~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=81aff112308005d9efc798f1e7ac8360e4bce80d;p=platform%2Fcore%2Fsecurity%2Flibprivilege-control.git Fix unwanted differences between SLP and RSA repositories. [Issue#] N/A [Bug] Undesired differences in source code between SLP and RSA. [Cause] Developers not careful while submitting changes to both repos. [Solution] Enumerate and fix the differences. [Verification] No functional changes has been made. Change-Id: Ifec35b4ee5bdc2f3613de25cb49b0ebe876681bf --- diff --git a/src/access-db.c b/src/access-db.c index 3bc26a5..b4167ca 100644 --- a/src/access-db.c +++ b/src/access-db.c @@ -362,10 +362,10 @@ int get_app_gids(const char *app_id, unsigned **gids, int *len) goto out; } - if (NULL == app_id) { - *len = 0; - return PC_OPERATION_SUCCESS; - } + if (NULL == app_id) { + *len = 0; + return PC_OPERATION_SUCCESS; + } if (!strcmp(app_id, app_id_tmp)) { unsigned *gids_realloc = realloc(*gids, sizeof(unsigned) * (*len + 1)); diff --git a/src/privilege-control.c b/src/privilege-control.c index a34e046..8fe7ede 100644 --- a/src/privilege-control.c +++ b/src/privilege-control.c @@ -577,7 +577,6 @@ API int perm_app_set_privilege(const char* name, const char* type, const char* p ret = get_smack_from_binary(&smack_label, path, verify_app_type(type, path)); if (ret != PC_OPERATION_SUCCESS) return ret; - were_rules_loaded = check_if_rules_were_loaded(smack_label); if (were_rules_loaded < 0) { C_LOGE("check_if_rules_was_loaded failed."); @@ -1247,12 +1246,12 @@ static int register_app_for_appsetting(const char *app_id) /* for each appsetting put rule: "appsetting_id app_id rx"*/ for (i = 0; i < smack_label_list_len; ++i) { - SECURE_C_LOGD("Appsetting: app_add_rule (%s, %s rx)", smack_label_list[i], app_id); if (strcmp(app_id, smack_label_list[i])==0) { SECURE_C_LOGW("Trying to add setting rule for self. Skipping"); continue; } + ret = app_add_rule(smack_label_list[i], app_id, "rx"); if (ret != PC_OPERATION_SUCCESS) { C_LOGE("app_add_rule failed"); @@ -1847,7 +1846,7 @@ static char* smack_label_for_path(const char *app_id, const char *path) /* * This function should be called in perm_app_setup_path_internal(). * After installation of new application (pkg_id) and labeling its shared directory (RW or RO), - * all others apps installed in system should get rules to this shared directory. + * all others apps installed on system should get rules to this shared directory. * This function will add and store those rules in rule-file of new installed app (pkg_id) */ static int add_other_apps_rules_for_shared_dir(const char *pkg_id, const char *type_of_shared_dir, const char *shared_dir_label)