static const char *_get_db_path(uid_t uid) {
const char *db_path = NULL;
- if (uid != GLOBAL_USER) {
+ if (uid != GLOBAL_USER && uid != ROOT_UID) {
tzplatform_set_user(uid);
db_path = tzplatform_getenv(TZ_USER_DB);
tzplatform_reset_user();
char *err;
char query[MAX_QUERY_LEN];
- if (uid == GLOBAL_USER)
+ if (uid == GLOBAL_USER || uid == ROOT_UID)
return SQLITE_OK;
snprintf(query, sizeof(query), "ATTACH DATABASE '%s' AS Global", db);
uid_t uid_caller = getuid();
gid_t gid = ROOT_UID;
- if (uid == ROOT_UID) {
- _LOGE("FAIL : Root is not allowed user! please fix it replacing with DEFAULT_USER");
- return NULL;
- }
-
- if (uid != GLOBAL_USER) {
+ if (uid != GLOBAL_USER && uid != ROOT_UID) {
tzplatform_set_user(uid);
path = tzplatform_mkpath(TZ_USER_ICONS, "/");
gid = _get_gid(tzplatform_getenv(TZ_SYS_USER_GROUP));
uid_t uid_caller = getuid();
gid_t gid = ROOT_UID;
- if (uid == ROOT_UID) {
- _LOGE("FAIL : Root is not allowed user! please fix it replacing with DEFAULT_USER");
- return NULL;
- }
-
- if (uid != GLOBAL_USER) {
+ if (uid != GLOBAL_USER && uid != ROOT_UID) {
tzplatform_set_user(uid);
pkgmgr_parser_db = tzplatform_mkpath(TZ_USER_DB, ".pkgmgr_parser.db");
gid = _get_gid(tzplatform_getenv(TZ_SYS_USER_GROUP));
uid_t uid_caller = getuid();
gid_t gid = ROOT_UID;
- if (uid == ROOT_UID) {
- _LOGE("FAIL : Root is not allowed user! please fix it replacing with DEFAULT_USER");
- return NULL;
- }
-
- if (uid != GLOBAL_USER) {
+ if (uid != GLOBAL_USER && uid != ROOT_UID) {
tzplatform_set_user(uid);
pkgmgr_cert_db = tzplatform_mkpath(TZ_USER_DB, ".pkgmgr_cert.db");
gid = _get_gid(tzplatform_getenv(TZ_SYS_USER_GROUP));
uid_t uid_caller = getuid();
gid_t gid = ROOT_UID;
- if (uid == ROOT_UID) {
- _LOGE("FAIL : Root is not allowed user! please fix it replacing with DEFAULT_USER");
- return NULL;
- }
-
- if (uid != GLOBAL_USER) {
+ if (uid != GLOBAL_USER && uid != ROOT_UID) {
tzplatform_set_user(uid);
path = tzplatform_mkpath(TZ_USER_DESKTOP, "/");
gid = _get_gid(tzplatform_getenv(TZ_SYS_USER_GROUP));
uid_t uid_caller = getuid();
gid_t gid = ROOT_UID;
- if (uid == ROOT_UID) {
- _LOGE("FAIL : Root is not allowed user! please fix it replacing with DEFAULT_USER");
- return NULL;
- }
-
- if (uid != GLOBAL_USER) {
+ if (uid != GLOBAL_USER && uid != ROOT_UID) {
tzplatform_set_user(uid);
path = tzplatform_mkpath(TZ_USER_PACKAGES, "/");
gid = _get_gid(tzplatform_getenv(TZ_SYS_USER_GROUP));