From a93bf7eadce0f2968e4c16a1edfd61b7d90580c6 Mon Sep 17 00:00:00 2001 From: "jk7744.park" Date: Sat, 24 Oct 2015 17:08:54 +0900 Subject: [PATCH] tizen 2.4 release --- CMakeLists.txt | 1 + LICENSE | 2 +- packaging/download-fonts-service.spec | 3 +- pkgmgr_font/src/font_service_register.c | 57 ++++++++++++++++++--------------- 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db48748..cc300bf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ pkg_check_modules(pkg REQUIRED capi-system-system-settings elementary pkgmgr-info + security-server ) SET(PACKAGE "${PROJECT_NAME}") diff --git a/LICENSE b/LICENSE index 704a2ab..e7ef455 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013 - 2014 Samsung Electronics Co., Ltd. All rights reserved. +Copyright (c) 2013 - 2015 Samsung Electronics Co., Ltd. All rights reserved. Apache License Version 2.0, January 2004 diff --git a/packaging/download-fonts-service.spec b/packaging/download-fonts-service.spec index 40f9693..68db2e0 100755 --- a/packaging/download-fonts-service.spec +++ b/packaging/download-fonts-service.spec @@ -1,6 +1,6 @@ Name: download-fonts-service Summary: Master Download fonts service. -Version: 0.0.6 +Version: 0.0.7 Release: 1 Group: TO_BE / FILLED_IN License: Apache-2.0 @@ -11,6 +11,7 @@ BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(capi-system-system-settings) BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(pkgmgr-info) +BuildRequires: pkgconfig(security-server) %description Master Download fonts service. diff --git a/pkgmgr_font/src/font_service_register.c b/pkgmgr_font/src/font_service_register.c index 4de31df..31e62e7 100755 --- a/pkgmgr_font/src/font_service_register.c +++ b/pkgmgr_font/src/font_service_register.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "system_settings.h" @@ -102,11 +103,11 @@ static int make_dir(const char *path) return ret; } } - ret = lsetxattr(path, "security.SMACK64", "_", 1, 0); + ret = security_server_label_access(path, "_"); if (ret < 0) { - DEBUG_ERROR("lsetxattr is failed %s\n",path); + DEBUG_ERROR("security_server_label_access is failed %s\n",path); return ret; } @@ -174,11 +175,11 @@ static int symbolic_link(const char *srcpath, const char *destpath) goto FAIL; } - ret = lsetxattr(destdir, "security.SMACK64", "_", 1, 0); + ret = security_server_label_access(destdir, "_"); if (ret < 0) { - DEBUG_ERROR("lsetxattr is failed %s\n",destdir); + DEBUG_ERROR("security_server_label_access is failed %s\n",destdir); goto FAIL; } } @@ -247,11 +248,11 @@ static int move_file(const char *srcpath, const char *destpath) goto FAIL; } - ret = lsetxattr(destdir, "security.SMACK64", "_", 1, 0); + ret = security_server_label_access(destdir, "_"); if (ret < 0) { - DEBUG_ERROR("lsetxattr is failed %s\n",destdir); + DEBUG_ERROR("security_server_label_access is failed %s\n",destdir); goto FAIL; } } @@ -752,42 +753,46 @@ int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList * chmod (ELM_PROFILE_CFG, 0777); } - ret = lsetxattr(ELM_PROFILE_CFG, "security.SMACK64", "system::homedir", 15, 0); + ret = security_server_label_access(ELM_PROFILE_CFG, "system::homedir"); if (ret < 0) { chmod (ELM_PROFILE_CFG, 0777); } - DIR *d; + DIR *d = NULL; struct dirent *e; - d = opendir (elm_profile_path); + if (elm_profile_path) + d = opendir (elm_profile_path); - while ((e = readdir (d))) + if (d) { - if (e->d_name[0] != '.' && (strstr(e->d_name, ".cfg") != 0 || strstr(e->d_name, ".CFG") != 0)) + while ((e = readdir (d))) { - char file_full_path[100]; + if (e->d_name[0] != '.' && (strstr(e->d_name, ".cfg") != 0 || strstr(e->d_name, ".CFG") != 0)) + { + char file_full_path[100]; - sprintf(file_full_path, "%s/%s", elm_profile_path, e->d_name); + sprintf(file_full_path, "%s/%s", elm_profile_path, e->d_name); - ret = chown(file_full_path, APP_OWNER_ID, APP_GROUP_ID); - if (ret < 0) - { - DEBUG_LOG("chown is failed %s", file_full_path); - chmod (file_full_path, 0777); - } + ret = chown(file_full_path, APP_OWNER_ID, APP_GROUP_ID); + if (ret < 0) + { + DEBUG_LOG("chown is failed %s", file_full_path); + chmod (file_full_path, 0777); + } - ret = lsetxattr(file_full_path, "security.SMACK64", "system::homedir", 15, 0); - if (ret < 0) - { - DEBUG_LOG("chsmack 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); + } } } - } - closedir (d); + closedir (d); + } free(default_font_name); free(elm_profile_path); -- 2.7.4