C_LOGE("EXIT_FAILURE");
exit(EXIT_FAILURE);
}
-
+/*
static const char* parse_widget_id(const char* path)
{
C_LOGD("Enter function: %s", __func__);
C_LOGD("return widget id: %s", basename);
return basename;
-}
+}*/
#endif // SMACK_ENABLED
API int set_app_privilege(const char* name, const char* type, const char* path)
switch(verify_app_type(type, path)) {
case APP_TYPE_WGT:
- widget_id = parse_widget_id(path);
+ //widget_id = parse_widget_id(path);
+ widget_id = name;
if (widget_id == NULL) {
C_LOGE("PC_ERR_INVALID_PARAM");
ret = PC_ERR_INVALID_PARAM;
C_LOGD("Enter function: %s", __func__);
if (!have_smack())
return PC_OPERATION_SUCCESS;
+/*
int ret;
-
ret = app_reset_permissions(widget_id);
if (ret != PC_OPERATION_SUCCESS) {
C_LOGE("app_reset_permissions failed");
return ret;
}
-
+*/
if (smack_set_label_for_self(widget_id) != 0) {
C_LOGE("smack_set_label_for_self failed");
return PC_ERR_INVALID_OPERATION;
if (ret != PC_OPERATION_SUCCESS)
return ret;
- fd = open(smack_path, O_RDWR|O_EXCL|O_CREAT, 0644);
+ fd = open(smack_path, O_RDWR|O_CREAT, 0644);
if (fd == -1) {
C_LOGE("file open failed: %s", strerror(errno));
return PC_ERR_FILE_OPERATION;
if (unlink(smack_path)) {
C_LOGE("unlink failed: ", strerror(errno));
- return PC_ERR_INVALID_OPERATION;
+// return PC_ERR_INVALID_OPERATION;
+ return PC_OPERATION_SUCCESS;
}
return PC_OPERATION_SUCCESS;