From 60494a1b08707e6551ba9136ca9ff364e8a9e7a1 Mon Sep 17 00:00:00 2001 From: "Sabera Djelti (sdi2)" Date: Tue, 2 Sep 2014 17:13:51 +0200 Subject: [PATCH] Retrieve tizenglobalapp uid with tzplatform_getuid + create tizenglobalapp (ie GLOBAL_USER) user for global installation Change-Id: Ibdac0f53d51e0212e7fe501e525b8c0b13a8aa9f Signed-off-by: Sabera Djelti (sdi2) --- client/include/pkgmgr-dbinfo.h | 3 ++- client/src/pkgmgr-internal.c | 3 ++- client/src/pkgmgr.c | 2 +- packaging/pkgmgr.spec | 8 +++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/client/include/pkgmgr-dbinfo.h b/client/include/pkgmgr-dbinfo.h index 22b94db..74e6ce8 100755 --- a/client/include/pkgmgr-dbinfo.h +++ b/client/include/pkgmgr-dbinfo.h @@ -44,8 +44,9 @@ #define __PKGMGR_DBINFO_H__ #include +#include -#define GLOBAL_USER 0 //@TODO tzpl +#define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER) #ifdef __cplusplus extern "C" { diff --git a/client/src/pkgmgr-internal.c b/client/src/pkgmgr-internal.c index 4c16e34..78999f4 100755 --- a/client/src/pkgmgr-internal.c +++ b/client/src/pkgmgr-internal.c @@ -39,6 +39,7 @@ #include #include #include +#include #include "package-manager.h" #include @@ -48,7 +49,7 @@ #define LOG_TAG "PKGMGR" #endif /* LOG_TAG */ -#define GLOBAL_USER 0 //#define tzplatform_getenv(TZ_GLOBAL) //TODO +#define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER) #define IS_WHITESPACE(CHAR) \ ((CHAR == ' ' || CHAR == '\t' || CHAR == '\r' || CHAR == '\n') ? \ diff --git a/client/src/pkgmgr.c b/client/src/pkgmgr.c index bff40ef..d11714d 100755 --- a/client/src/pkgmgr.c +++ b/client/src/pkgmgr.c @@ -59,7 +59,7 @@ #define BINSH_NAME "/bin/sh" #define BINSH_SIZE 7 -#define GLOBAL_USER 0 //#define tzplatform_getenv(TZ_GLOBAL) //TODO +#define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER) static int _get_request_id() { diff --git a/packaging/pkgmgr.spec b/packaging/pkgmgr.spec index 463276e..dc205ce 100644 --- a/packaging/pkgmgr.spec +++ b/packaging/pkgmgr.spec @@ -30,6 +30,7 @@ BuildRequires: pkgconfig(iniparser) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgmgr-info-parser-devel BuildRequires: pkgmgr-info-parser +Requires: pwdutils %description Packager Manager client library package for packaging @@ -113,7 +114,6 @@ mkdir -p %{buildroot}%{_sysconfdir}/package-manager/server %find_lang package-manager - %post /sbin/ldconfig @@ -121,6 +121,12 @@ mkdir -p %{buildroot}%{_sysconfdir}/package-manager/server # Update mime database to support package mime types update-mime-database /usr/share/mime +# Create tizenglobalapp user needed for global installation +%{_sbindir}/useradd -d %TZ_SYS_RW_APP -m %TZ_SYS_GLOBALAPP_USER -r -c "system user for common applications" -g users +#mkdir -p %TZ_SYS_RW_APP/.config/xwalk-service/applications +#cd %TZ_SYS_RW_APP/ +#ln -s .config/xwalk-service/applications/ + %post -n pkgmgr-server -p /sbin/ldconfig %post -n pkgmgr-client -p /sbin/ldconfig -- 2.7.4