Allow user 'app_fw' to create pkgmgr_parser.db 57/84457/2
authorTomasz Iwanek <t.iwanek@samsung.com>
Thu, 18 Aug 2016 14:45:53 +0000 (16:45 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Thu, 18 Aug 2016 14:52:03 +0000 (16:52 +0200)
Change-Id: I0036baf2e68b039d2512135f1d9a9df3066c22f7

include/pkgmgrinfo_private.h
src/pkgmgrinfo_db.c

index c7d241a..52d69a4 100644 (file)
@@ -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, "")
index c9ad72a..7f8ecf8 100644 (file)
@@ -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;