#include <fontconfig/fontconfig.h>
#include <Elementary.h>
#include <pkgmgr-info.h>
-#include <security-server.h>
+#include <pkgmgr_installer_info.h>
#include "system_settings.h"
static const char *ELM_PROFILE_CFG = "/opt/home/app/.elementary/config/profile.cfg";
#define MAX_FILE_LEN 4096
-#define APP_OWNER_ID 5000
-#define APP_GROUP_ID 5000
+#define APP_OWNER_ID 5001
+#define APP_GROUP_ID 100
static int make_dir(const char *path);
static int symbolic_link(const char *srcpath, const char *destpath);
return ret;
}
- ret = chmod (path, 0755);
+ ret = chown(path, getuid(), APP_GROUP_ID);
+ if (ret < 0)
+ {
+ DEBUG_ERROR("chown is failed %s\n",path);
+ return ret;
+ }
+
+ ret = chmod(path, 0755);
if (ret < 0)
{
DEBUG_ERROR("chmod is failed %s\n",path);
return ret;
}
}
- ret = security_server_label_access(path, "_");
-
- if (ret < 0)
- {
- DEBUG_ERROR("security_server_label_access is failed %s\n",path);
- return ret;
- }
return ret;
}
DEBUG_ERROR("symlink is failed \n");
goto FAIL;
}
-
- ret = security_server_label_access(destdir, "_");
-
- if (ret < 0)
- {
- DEBUG_ERROR("security_server_label_access is failed %s\n",destdir);
- goto FAIL;
- }
}
}
closedir (d);
DEBUG_ERROR("symlink is failed \n");
goto FAIL;
}
-
- ret = security_server_label_access(destdir, "_");
-
- if (ret < 0)
- {
- DEBUG_ERROR("security_server_label_access is failed %s\n",destdir);
- goto FAIL;
- }
}
}
closedir (d);
pkgmgrinfo_pkginfo_h handle = NULL;
const char *app_root_path = NULL;
const char *dest_path = NULL;
+ uid_t uid = 0;
+
+ pkgmgr_installer_info_get_target_uid(&uid);
+ ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
- ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
if (ret < 0)
{
DEBUG_ERROR("pkgid[%s] handle get fail", pkgid);
pkgmgrinfo_pkginfo_h handle = NULL;
const char* app_root_path = NULL;
const char* dest_path = NULL;
+ uid_t uid = 0;
+
+ pkgmgr_installer_info_get_target_uid(&uid);
+ ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
- ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
if (ret < 0)
{
DEBUG_ERROR("pkgid[%s] handle get fail", pkgid);
if (access(deletedir, F_OK) == -1)
{
- DEBUG_ERROR("dest directory is not exist \n");
+ DEBUG_ERROR("dest directory(%s) is not exist: %s\n", deletedir, strerror(errno));
goto FAIL;
}
}
ret = make_dir(PARENT_PATH);
-
if (ret < 0)
{
- DEBUG_ERROR("make current directory is failed \n");
+ DEBUG_ERROR("make current directory(%s) is failed: %s\n", PARENT_PATH, strerror(errno));
goto FAIL;
}
ret = make_dir(dest_path);
-
if (ret < 0)
{
- DEBUG_ERROR("make current directory is failed \n");
+ DEBUG_ERROR("make current directory(%s) is failed: %s\n", dest_path, strerror(errno));
goto FAIL;
}
FcObjectSet *os = NULL;
FcPattern *pat = NULL;
FcFontSet *fs = NULL;
+ pkgmgrinfo_pkginfo_h handle = NULL;
const char* app_root_path = NULL;
const char *dest_path = NULL;
int ret;
+ uid_t uid = 0;
elm_init(0, NULL);
return -1;
}
- pkgmgrinfo_pkginfo_h handle = NULL;
-
+ pkgmgr_installer_info_get_target_uid(&uid);
+ ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
- ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
if (ret < 0)
{
DEBUG_ERROR("pkgid[%s] handle get fail", pkgid);
chmod (ELM_PROFILE_CFG, 0777);
}
- ret = security_server_label_access(ELM_PROFILE_CFG, "system::homedir");
- if (ret < 0)
- {
- chmod (ELM_PROFILE_CFG, 0777);
- }
-
DIR *d = NULL;
struct dirent *e;
DEBUG_LOG("chown is failed %s", file_full_path);
chmod (file_full_path, 0777);
}
-
- ret = security_server_label_access(file_full_path, "system::homedir");
- if (ret < 0)
- {
- DEBUG_LOG("chsmack is failed %s", file_full_path);
- chmod (file_full_path, 0777);
- }
}
}
if (access(deletedir, F_OK) == -1)
{
- DEBUG_ERROR("dest directory(%s) is not exist \n", deletedir);
+ DEBUG_ERROR("dest directory(%s) is not exist: %s\n", deletedir, strerror(errno));
goto FAIL;
}