+ /* /opt/usr/apps/[pkgid] directory's label is "_" */
+ std::string tzPkgid = DPL::ToUTF8String(m_context.widgetConfig.tzPkgid);
+ if (PC_OPERATION_SUCCESS != app_label_dir("_",
+ m_context.locations->
+ getPackageInstallationDir().
+ c_str()))
+ {
+ LogError("Set smack failure. Failed to add label for app root directory");
+ ThrowMsg(Exceptions::NotAllowed, "Instalation failure. "
+ "Add Label failure");
+ }
+
+ /* res directory */
+ std::string resDir = m_context.locations->getPackageInstallationDir() +
+ "/res";
+ if (PC_OPERATION_SUCCESS != app_label_dir(tzPkgid.c_str(),
+ resDir.c_str()))
+ {
+ LogError("Set smack failure. Failed to add label for resource directory");
+ ThrowMsg(Exceptions::NotAllowed, "Instalation failure. "
+ "Add Label failure");
+ }
+
+ /* bin directory */
+ if (PC_OPERATION_SUCCESS != app_label_dir(tzPkgid.c_str(),
+ m_context.locations->getBinaryDir()
+ .c_str()))
+ {
+ LogError("Set smack failure. Failed to add label for binary directory");
+ ThrowMsg(Exceptions::NotAllowed, "Instalation failure. "
+ "Add Label failure");
+ }
+
+ /* data directory */
+ if (PC_OPERATION_SUCCESS != app_label_dir(tzPkgid.c_str(),
+ m_context.locations->
+ getPrivateStorageDir().c_str()))
+ {
+ LogError("Set smack failure. Failed to add label for private storage directory");
+ ThrowMsg(Exceptions::NotAllowed, "Instalation failure. "
+ "Add Label failure");
+ }
+
+#endif
+}
+
+void TaskSmack::SmackPrivilegeStep()
+{
+ LogInfo(
+ "----------------> SMACK: \
+ Jobs::WidgetInstall::TaskSmack::SmackPrivilegeStep()");
+#ifdef WRT_SMACK_ENABLED
+ WrtDB::TizenPkgId tzPkgid = m_context.widgetConfig.tzPkgid;
+#if 0
+ char** perm_list = new char*[m_context.staticPermittedDevCaps.size()];
+
+ int index = 0;