From 0086b6c3645de8fbfc64a9c943920d3a4ba5f3cb Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Thu, 18 Aug 2016 16:45:53 +0200 Subject: [PATCH] Allow user 'app_fw' to create pkgmgr_parser.db Change-Id: I0036baf2e68b039d2512135f1d9a9df3066c22f7 --- include/pkgmgrinfo_private.h | 1 + src/pkgmgrinfo_db.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/pkgmgrinfo_private.h b/include/pkgmgrinfo_private.h index c7d241a..52d69a4 100644 --- a/include/pkgmgrinfo_private.h +++ b/include/pkgmgrinfo_private.h @@ -63,6 +63,7 @@ #define BLOCK_SIZE 4096 /*in bytes*/ #define BUFSIZE 4096 #define ROOT_UID 0 +#define APPFW_UID 301 #define PKG_SD_PATH tzplatform_mkpath3(TZ_SYS_STORAGE, "sdcard", "app2sd/") #define PKG_INSTALLATION_PATH tzplatform_mkpath(TZ_USER_APP, "") diff --git a/src/pkgmgrinfo_db.c b/src/pkgmgrinfo_db.c index c9ad72a..7f8ecf8 100644 --- a/src/pkgmgrinfo_db.c +++ b/src/pkgmgrinfo_db.c @@ -283,7 +283,7 @@ API const char *getIconPath(uid_t uid, bool readonly) path = tzplatform_mkpath(TZ_SYS_RW_ICONS, "/"); /* just allow certain users to create the icon directory if needed. */ - if (uid_caller == ROOT_UID || uid_caller == uid) + if (uid_caller == ROOT_UID || uid_caller == APPFW_UID || uid_caller == uid) _mkdir_for_user(path, uid, gid); return path; @@ -316,7 +316,7 @@ API char *getUserPkgParserDBPathUID(uid_t uid) } // just allow certain users to create the dbspace directory if needed. - if (uid_caller == ROOT_UID || uid_caller == uid) + if (uid_caller == ROOT_UID || uid_caller == APPFW_UID || uid_caller == uid) _mkdir_for_user(db_path, uid, gid); free(db_path); @@ -351,7 +351,7 @@ API char *getUserPkgCertDBPathUID(uid_t uid) } // just allow certain users to create the dbspace directory if needed. - if (uid_caller == ROOT_UID || uid_caller == uid) + if (uid_caller == ROOT_UID || uid_caller == APPFW_UID || uid_caller == uid) _mkdir_for_user(db_path, uid, gid); free(db_path); @@ -378,7 +378,7 @@ API const char *getUserManifestPath(uid_t uid, bool readonly) } /* just allow certain users to create the icon directory if needed. */ - if (uid_caller == ROOT_UID || uid_caller == uid) + if (uid_caller == ROOT_UID || uid_caller == APPFW_UID || uid_caller == uid) _mkdir_for_user(path, uid, gid); return path; -- 2.7.4