Before applied a label on the process context, check if the label is previously set. 55/5655/1 accepted/tizen/20130711.205247 submit/tizen/20130711.193443
authorBaptiste DURAND <baptiste.durand@eurogiciel.fr>
Wed, 10 Jul 2013 14:08:32 +0000 (16:08 +0200)
committerRusty Lynch <rusty.lynch@intel.com>
Thu, 11 Jul 2013 19:34:04 +0000 (12:34 -0700)
Wrt-installer could be compiled with SMACK OPTION to off.
In consequences, the smack label on the binary symbol link is not set.

So we can't applied this label in this case.
It better to use set_smack_from_binary instead of set_smack_for_wrt

Fix for TIVI-1119 & TZ-3514

Change-Id: Ie69136b3de04d79e6f6ac8bbc3be3f19e06fd808

CMakeLists.txt
packaging/libprivilege-control.changes
src/privilege-control.c

index e21f536..150f485 100644 (file)
@@ -34,6 +34,7 @@ ADD_DEFINITIONS("-Wall -Werror")
 #ADD_DEFINITIONS("-DSMACK_ENABLED")
 #ADD_DEFINITIONS("-DDLOG_DEBUG_ENABLED")    #enables dlogutil logs
 ADD_DEFINITIONS("-DDLOG_ERROR_ENABLED")
+ADD_DEFINITIONS("-Wno-unused-function")
 
 ###################################################################################################
 ## for libprivilege-control.so (library)
index ae21e04..94ac09f 100644 (file)
@@ -1,3 +1,6 @@
+* Thu Jul 11 2013 Rusty Lynch <rusty.lynch@intel.com> accepted/tizen/20130711.163636@43b59bc
+- Before applied a label on the process context, check if the label is previously set.
+
 * Thu Jul 11 2013 Anas Nashif <anas.nashif@intel.com> submit/tizen/20130711.003907@5533929
 - cleanup spec
 - - remove init.d scripts
index 92997b4..a361968 100644 (file)
@@ -508,7 +508,10 @@ API int set_app_privilege(const char* name, const char* type, const char* path)
                        ret = PC_ERR_INVALID_PARAM;
                }
                else
-                       ret = set_smack_for_wrt(&smack_label, widget_id);
+               {
+                       smack_label = strdup(widget_id);
+                       ret = set_smack_from_binary(&smack_label, path);
+               }
                break;
        default:
                if (path != NULL)
@@ -727,7 +730,6 @@ static int set_smack_for_wrt(char **smack_label, const char* widget_id)
                C_LOGE("smack_set_label_for_self failed");
                return PC_ERR_INVALID_OPERATION;
        }
-
        return PC_OPERATION_SUCCESS;
 }