summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2016-10-10 17:35:37 +0900
committerYoungbok Shin <youngb.shin@samsung.com>2016-11-08 14:16:20 +0900
commit3ea6bd7b1ba605d7b9e52b281355842e1e0a53ff (patch)
tree8ead31d4a622b00d52dd4e0ef3a61e68199697a6
parentcb50cea2028becdb682d9d3681c5febee182fff2 (diff)
downloaddownload-fonts-service-3ea6bd7b1ba605d7b9e52b281355842e1e0a53ff.tar.gz
download-fonts-service-3ea6bd7b1ba605d7b9e52b281355842e1e0a53ff.tar.bz2
download-fonts-service-3ea6bd7b1ba605d7b9e52b281355842e1e0a53ff.zip
Change-Id: I49354bbab76c71d33ccd2c3b2c82f626664930d4
-rwxr-xr-xCMakeLists.txt2
-rwxr-xr-xdownload-fonts-service.manifest14
-rw-r--r--packaging/download-fonts-service.manifest5
-rw-r--r--[-rwxr-xr-x]packaging/download-fonts-service.spec16
-rwxr-xr-xpkgmgr_font/CMakeLists.txt5
-rwxr-xr-xpkgmgr_font/src/font_service_register.c78
6 files changed, 45 insertions, 75 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc300bf..a6faea3 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,7 @@ pkg_check_modules(pkg REQUIRED
capi-system-system-settings
elementary
pkgmgr-info
- security-server
+ pkgmgr-installer
)
SET(PACKAGE "${PROJECT_NAME}")
diff --git a/download-fonts-service.manifest b/download-fonts-service.manifest
deleted file mode 100755
index b6c8305..0000000
--- a/download-fonts-service.manifest
+++ /dev/null
@@ -1,14 +0,0 @@
-<manifest>
- <!-- Provider master label -->
- <define>
- <domain name="download-fonts-service" />
- </define>
- <request>
- <domain name="_" />
- </request>
-
- <assign>
- <!-- Package manager plugin -->
- <filesystem path="/usr/etc/package-manager/parserlib/metadata/libfont.so" label="_" />
- </assign>
-</manifest>
diff --git a/packaging/download-fonts-service.manifest b/packaging/download-fonts-service.manifest
new file mode 100644
index 0000000..a76fdba
--- /dev/null
+++ b/packaging/download-fonts-service.manifest
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+ <domain name="_" />
+ </request>
+</manifest>
diff --git a/packaging/download-fonts-service.spec b/packaging/download-fonts-service.spec
index 3e3986e..174fadd 100755..100644
--- a/packaging/download-fonts-service.spec
+++ b/packaging/download-fonts-service.spec
@@ -1,23 +1,25 @@
Name: download-fonts-service
-Summary: Master Download fonts service.
-Version: 0.0.8
+Summary: Master Download fonts service
+Version: 1.0.0
Release: 1
-Group: TO_BE / FILLED_IN
+Group: Base/Package Management
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
+Source1001: download-fonts-service.manifest
BuildRequires: cmake, gettext-tools, smack, coreutils
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(capi-system-system-settings)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(pkgmgr-info)
-BuildRequires: pkgconfig(security-server)
+BuildRequires: pkgconfig(pkgmgr-installer)
%description
Master Download fonts service.
%prep
%setup -q
+cp %{SOURCE1001} .
%build
%if 0%{?sec_build_binary_debug_enable}
@@ -30,7 +32,7 @@ export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
%endif
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DPRODUCT=private
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
CFLAGS="${CFLAGS} -Wall -Winline -Werror" LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs}
@@ -38,9 +40,11 @@ CFLAGS="${CFLAGS} -Wall -Winline -Werror" LDFLAGS="${LDFLAGS}" make %{?jobs:-j%j
rm -rf %{buildroot}
%make_install
+mkdir -p %{buildroot}%{_tmpfilesdir}
+
%files -n download-fonts-service
%manifest download-fonts-service.manifest
%defattr(-,root,root,-)
-%{_prefix}/etc/package-manager/parserlib/category/*
+/etc/package-manager/parserlib/category/*
# End of a file
diff --git a/pkgmgr_font/CMakeLists.txt b/pkgmgr_font/CMakeLists.txt
index 7086af2..5d6424e 100755
--- a/pkgmgr_font/CMakeLists.txt
+++ b/pkgmgr_font/CMakeLists.txt
@@ -8,14 +8,13 @@ pkg_check_modules(bin_pkgs REQUIRED
fontconfig
capi-system-system-settings
elementary
- pkgmgr-info
)
FOREACH(flag ${bin_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Wall -Werror")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Wall")
ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
@@ -25,5 +24,5 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${bin_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION "etc/package-manager/parserlib/category")
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION "/etc/package-manager/parserlib/category")
# End of a file
diff --git a/pkgmgr_font/src/font_service_register.c b/pkgmgr_font/src/font_service_register.c
index 31e62e7..3147a7d 100755
--- a/pkgmgr_font/src/font_service_register.c
+++ b/pkgmgr_font/src/font_service_register.c
@@ -28,7 +28,7 @@
#include <fontconfig/fontconfig.h>
#include <Elementary.h>
#include <pkgmgr-info.h>
-#include <security-server.h>
+#include <pkgmgr_installer_info.h>
#include "system_settings.h"
@@ -49,8 +49,8 @@ static const char *PRELOADED_PATH = "/opt/share/fonts/preloaded";
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);
@@ -95,7 +95,14 @@ static int make_dir(const char *path)
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);
@@ -103,13 +110,6 @@ static int make_dir(const char *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;
}
@@ -174,14 +174,6 @@ static int symbolic_link(const char *srcpath, const char *destpath)
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);
@@ -247,14 +239,6 @@ static int move_file(const char *srcpath, const char *destpath)
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);
@@ -500,8 +484,11 @@ int COMMON_PKGMGR_PLUGIN_INSTALL(const char *pkgid, const char *appid, GList *li
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);
@@ -561,8 +548,11 @@ int COMMON_PKGMGR_PLUGIN_UPGRADE(const char *pkgid, const char *appid, GList *li
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);
@@ -594,7 +584,7 @@ int COMMON_PKGMGR_PLUGIN_UPGRADE(const char *pkgid, const char *appid, GList *li
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;
}
@@ -606,18 +596,16 @@ int COMMON_PKGMGR_PLUGIN_UPGRADE(const char *pkgid, const char *appid, GList *li
}
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;
}
@@ -644,9 +632,11 @@ int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *
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);
@@ -656,10 +646,9 @@ int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *
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);
@@ -753,12 +742,6 @@ int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *
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;
@@ -781,13 +764,6 @@ int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *
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);
- }
}
}
@@ -805,7 +781,7 @@ int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *
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;
}