X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=parser%2Fpkgmgr_parser_db.c;h=1a4a0bd646f92569335db4e9705002565f72d94a;hb=9a03c9ee5c0e091f449d5105ea56ce4345a11d1b;hp=004f34fed26e742c37f264e4598c6fb9ab69e912;hpb=5b4a140ba7b61099be03ab0c379a190d491193f3;p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git diff --git a/parser/pkgmgr_parser_db.c b/parser/pkgmgr_parser_db.c index 004f34f..1a4a0bd 100644 --- a/parser/pkgmgr_parser_db.c +++ b/parser/pkgmgr_parser_db.c @@ -52,9 +52,13 @@ #define BUFSIZE 4096 #define OWNER_ROOT 0 -#define SET_SMACK_LABEL(x,uid) \ - if(smack_setlabel((x), (((uid) == GLOBAL_USER)?"*":"User"), SMACK_LABEL_ACCESS)) _LOGE("failed chsmack -a \"User/*\" %s", x); \ - else _LOGD("chsmack -a \"User/*\" %s", x); +#define SET_SMACK_LABEL(x) \ +do { \ + if (smack_setlabel((x), "System::Shared", SMACK_LABEL_ACCESS)) \ + _LOGE("failed chsmack -a \"System::Shared\" %s", x); \ + else \ + _LOGD("chsmack -a \"System::Shared\" %s", x); \ +} while (0) sqlite3 *pkgmgr_parser_db; sqlite3 *pkgmgr_cert_db; @@ -64,6 +68,7 @@ sqlite3 *pkgmgr_cert_db; "(package text primary key not null, " \ "package_type text DEFAULT 'rpm', " \ "package_version text, " \ + "package_api_version text, " \ "install_location text, " \ "package_size text, " \ "package_removable text DEFAULT 'true', " \ @@ -129,6 +134,7 @@ sqlite3 *pkgmgr_cert_db; "app_preload text DEFAULT 'false', " \ "app_submode text DEFAULT 'false', " \ "app_submode_mainid text, " \ + "app_launch_mode text NOT NULL DEFAULT 'caller', " \ "component_type text, " \ "package text not null, " \ "FOREIGN KEY(package) " \ @@ -167,11 +173,8 @@ sqlite3 *pkgmgr_cert_db; #define QUERY_CREATE_TABLE_PACKAGE_APP_APP_CONTROL "create table if not exists package_app_app_control " \ "(app_id text not null, " \ - "operation text not null, " \ - "uri_scheme text, " \ - "mime_type text, " \ - "subapp_name text, " \ - "PRIMARY KEY(app_id,operation,uri_scheme,mime_type,subapp_name) " \ + "app_control text not null, " \ + "PRIMARY KEY(app_id,app_control) " \ "FOREIGN KEY(app_id) " \ "REFERENCES package_app_info(app_id) " \ "ON DELETE CASCADE)" @@ -251,13 +254,25 @@ sqlite3 *pkgmgr_cert_db; #define QUERY_CREATE_TABLE_PACKAGE_APP_DATA_CONTROL "create table if not exists package_app_data_control " \ "(app_id text not null, " \ - "provider_id text not null, " \ + "providerid text not null, " \ "access text not null, " \ "type text not null, " \ - "PRIMARY KEY(app_id, provider_id, access, type) " \ + "PRIMARY KEY(app_id, providerid, access, type) " \ "FOREIGN KEY(app_id) " \ "REFERENCES package_app_info(app_id) " \ "ON DELETE CASCADE)" +#define QUERY_CREATE_TABLE_PACKAGE_RESOURCE_INFO "CREATE TABLE IF NOT EXISTS package_resource_info" \ + "(pkg_id text NOT NULL," \ + "group_folder text NOT NULL," \ + "group_type text NOT NULL," \ + "PRIMARY KEY(pkg_id, group_type))" + +#define QUERY_CREATE_TABLE_PACKAGE_RESOURCE_DATA "CREATE TABLE IF NOT EXISTS package_resource_data" \ + "(id integer REFERENCES package_resource_info(rowid)," \ + "node_folder text NOT NULL," \ + "attr_name text NOT NULL," \ + "attr_value test NOT NULL," \ + "PRIMARY KEY(id, node_folder, attr_name))" static int __insert_uiapplication_info(manifest_x *mfx); static int __insert_serviceapplication_info(manifest_x *mfx); @@ -273,6 +288,7 @@ static int __insert_uiapplication_share_allowed_info(manifest_x *mfx); static int __insert_serviceapplication_share_allowed_info(manifest_x *mfx); static int __insert_uiapplication_share_request_info(manifest_x *mfx); static int __insert_serviceapplication_share_request_info(manifest_x *mfx); +static int __insert_uiapplication_datacontrol_info(manifest_x *mfx); static int __insert_serviceapplication_datacontrol_info(manifest_x *mfx); static void __insert_serviceapplication_locale_info(gpointer data, gpointer userdata); static void __insert_uiapplication_locale_info(gpointer data, gpointer userdata); @@ -290,6 +306,7 @@ static GList *__create_locale_list(GList *locale, label_x *lbl, license_x *lcn, static void __preserve_guestmode_visibility_value(manifest_x *mfx); static int __guestmode_visibility_cb(void *data, int ncols, char **coltxt, char **colname); static int __pkgmgr_parser_create_db(sqlite3 **db_handle, const char *db_path); +static int __parserdb_change_perm(const char *db_file, uid_t uid); static int __delete_subpkg_list_cb(void *data, int ncols, char **coltxt, char **colname) { @@ -299,7 +316,7 @@ static int __delete_subpkg_list_cb(void *data, int ncols, char **coltxt, char ** return 0; } -static char *__get_str(const char *str) +static const char *__get_str(const char *str) { if (str == NULL) { @@ -481,11 +498,6 @@ static GList *__create_image_list(GList *locale, image_x *image) return locale; } -static void __printfunc(gpointer data, gpointer userdata) -{ - _LOGD("%s ", (char*)data); -} - static void __trimfunc(GList* trim_list) { char *trim_data = NULL; @@ -831,8 +843,8 @@ static int __insert_uiapplication_info(manifest_x *mfx) "insert into package_app_info(app_id, app_component, app_exec, app_nodisplay, app_type, app_onboot, " \ "app_multiple, app_autorestart, app_taskmanage, app_enabled, app_hwacceleration, app_screenreader, app_mainapp , app_recentimage, " \ "app_launchcondition, app_indicatordisplay, app_portraitimg, app_landscapeimg, app_guestmodevisibility, app_permissiontype, "\ - "app_preload, app_submode, app_submode_mainid, component_type, package) " \ - "values('%s', '%s', '%s', '%s', '%s', '%s','%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\ + "app_preload, app_submode, app_submode_mainid, component_type, package, app_launch_mode) " \ + "values('%s', '%s', '%s', '%s', '%s', '%s','%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\ up->appid, "uiapp", up->exec, @@ -857,7 +869,8 @@ static int __insert_uiapplication_info(manifest_x *mfx) up->submode, __get_str(up->submode_mainid), up->component_type, - mfx->package); + mfx->package, + up->launch_mode); ret = __exec_query(query); if (ret == -1) { @@ -960,69 +973,26 @@ static int __insert_uiapplication_appcontrol_info(manifest_x *mfx) { uiapplication_x *up = mfx->uiapplication; appcontrol_x *acontrol = NULL; - operation_x *op = NULL; - mime_x *mi = NULL; - uri_x *ui = NULL; - subapp_x *sub = NULL; int ret = -1; char query[MAX_QUERY_LEN] = {'\0'}; - const char *operation = NULL; - const char *mime = NULL; - const char *uri = NULL; - const char *subapp = NULL; - while(up != NULL) - { + char buf[BUFSIZE] = {'\0'}; + while (up != NULL) { acontrol = up->appcontrol; - while(acontrol != NULL) - { - op = acontrol->operation; - while(op != NULL) - { - if (op) - operation = op->name; - mi = acontrol->mime; - - do - { - if (mi) - mime = mi->name; - sub = acontrol->subapp; - do - { - if (sub) - subapp = sub->name; - ui = acontrol->uri; - do - { - if (ui) - uri = ui->name; - snprintf(query, MAX_QUERY_LEN, - "insert into package_app_app_control(app_id, operation, uri_scheme, mime_type, subapp_name) " \ - "values('%s', '%s', '%s', '%s', '%s')",\ - up->appid, operation, uri, mime, subapp); - - ret = __exec_query(query); - if (ret == -1) { - _LOGD("Package UiApp AppSvc DB Insert Failed\n"); - return -1; - } - memset(query, '\0', MAX_QUERY_LEN); - if (ui) - ui = ui->next; - uri = NULL; - } while(ui != NULL); - if (sub) - sub = sub->next; - subapp = NULL; - }while(sub != NULL); - if (mi) - mi = mi->next; - mime = NULL; - }while(mi != NULL); - if (op) - op = op->next; - operation = NULL; + while (acontrol != NULL) { + snprintf(buf, BUFSIZE, "%s|%s|%s",\ + acontrol->operation ? (strlen(acontrol->operation) > 0 ? acontrol->operation : "NULL") : "NULL", + acontrol->uri ? (strlen(acontrol->uri) > 0 ? acontrol->uri : "NULL") : "NULL", + acontrol->mime ? (strlen(acontrol->mime) > 0 ? acontrol->mime : "NULL") : "NULL"); + snprintf(query, MAX_QUERY_LEN, + "insert into package_app_app_control(app_id, app_control) " \ + "values('%s', '%s')",\ + up->appid, buf); + ret = __exec_query(query); + if (ret == -1) { + _LOGD("Package UiApp AppSvc DB Insert Failed\n"); + return -1; } + memset(query, '\0', MAX_QUERY_LEN); acontrol = acontrol->next; } up = up->next; @@ -1108,6 +1078,39 @@ static int __insert_uiapplication_appsvc_info(manifest_x *mfx) return 0; } +static int __insert_uiapplication_datacontrol_info(manifest_x *mfx) +{ + uiapplication_x *up = mfx->uiapplication; + datacontrol_x *dc = NULL; + int ret = -1; + char query[MAX_QUERY_LEN] = {'\0'}; + + while(up != NULL) + { + dc = up->datacontrol; + while(dc != NULL) + { + snprintf(query, MAX_QUERY_LEN, + "insert into package_app_data_control(app_id, providerid, access, type) " \ + "values('%s', '%s', '%s', '%s')",\ + mfx->uiapplication->appid, + dc->providerid, + dc->access, + dc->type); + + ret = __exec_query(query); + if (ret == -1) { + _LOGD("Package UiApp Data Control DB Insert Failed\n"); + return -1; + } + memset(query, '\0', MAX_QUERY_LEN); + dc = dc->next; + } + up = up->next; + } + return 0; +} + static int __insert_uiapplication_share_request_info(manifest_x *mfx) { uiapplication_x *up = mfx->uiapplication; @@ -1298,65 +1301,24 @@ static int __insert_serviceapplication_appcontrol_info(manifest_x *mfx) appcontrol_x *acontrol = NULL; int ret = -1; char query[MAX_QUERY_LEN] = {'\0'}; - operation_x *op = NULL; - mime_x *mi = NULL; - uri_x *ui = NULL; - subapp_x *sub = NULL; - const char *operation = NULL; - const char *mime = NULL; - const char *uri = NULL; - const char *subapp = NULL; - while(sp != NULL) - { + char buf[BUFSIZE] = {'\0'}; + while (sp != NULL) { acontrol = sp->appcontrol; - while(acontrol != NULL) - { - op = acontrol->operation; - while(op != NULL) - { - if (op) - operation = op->name; - mi = acontrol->mime; - do - { - if (mi) - mime = mi->name; - sub = acontrol->subapp; - do - { - if (sub) - subapp = sub->name; - ui = acontrol->uri; - do - { - if (ui) - uri = ui->name; - snprintf(query, MAX_QUERY_LEN, - "insert into package_app_app_control(app_id, operation, uri_scheme, mime_type,subapp_name) " \ - "values('%s', '%s', '%s', '%s', '%s')",\ - sp->appid, operation, uri, mime, subapp); - ret = __exec_query(query); - if (ret == -1) { - _LOGD("Package UiApp AppSvc DB Insert Failed\n"); - return -1; - } - memset(query, '\0', MAX_QUERY_LEN); - if (ui) - ui = ui->next; - uri = NULL; - } while(ui != NULL); - if (sub) - sub = sub->next; - subapp = NULL; - }while(sub != NULL); - if (mi) - mi = mi->next; - mime = NULL; - }while(mi != NULL); - if (op) - op = op->next; - operation = NULL; + while (acontrol != NULL) { + snprintf(buf, BUFSIZE, "%s|%s|%s", + acontrol->operation ? (strlen(acontrol->operation) > 0 ? acontrol->operation : "NULL") : "NULL", + acontrol->uri ? (strlen(acontrol->uri) > 0 ? acontrol->uri : "NULL") : "NULL", + acontrol->mime ? (strlen(acontrol->mime) > 0 ? acontrol->mime : "NULL") : "NULL"); + snprintf(query, MAX_QUERY_LEN, + "insert into package_app_app_control(app_id, app_control) " \ + "values('%s', '%s')",\ + sp->appid, buf); + ret = __exec_query(query); + if (ret == -1) { + _LOGD("Package UiApp AppSvc DB Insert Failed\n"); + return -1; } + memset(query, '\0', MAX_QUERY_LEN); acontrol = acontrol->next; } sp = sp->next; @@ -1453,7 +1415,7 @@ static int __insert_serviceapplication_datacontrol_info(manifest_x *mfx) while(dc != NULL) { snprintf(query, MAX_QUERY_LEN, - "insert into package_app_data_control(app_id, provider_id, access, type) " \ + "insert into package_app_data_control(app_id, providerid, access, type) " \ "values('%s', '%s', '%s', '%s')",\ mfx->serviceapplication->appid, dc->providerid, @@ -1563,14 +1525,10 @@ static int __insert_manifest_info_in_db(manifest_x *mfx, uid_t uid) privileges_x *pvs = NULL; privilege_x *pv = NULL; char query[MAX_QUERY_LEN] = { '\0' }; - char root[MAX_QUERY_LEN] = { '\0' }; int ret = -1; - char *type = NULL; - char *path = NULL; const char *auth_name = NULL; const char *auth_email = NULL; const char *auth_href = NULL; - const char *apps_path = NULL; GList *pkglocale = NULL; GList *applocale = NULL; @@ -1601,31 +1559,15 @@ static int __insert_manifest_info_in_db(manifest_x *mfx, uid_t uid) } /*Insert in the package_info DB*/ - if (mfx->type) - type = strdup(mfx->type); - else - type = strdup("rpm"); - /*Insert in the package_info DB*/ - if (mfx->root_path) - path = strdup(mfx->root_path); - else{ - if (strcmp(type,"rpm")==0) { - apps_path = tzplatform_getenv(TZ_SYS_RO_APP); - snprintf(root, MAX_QUERY_LEN - 1, "%s/%s", apps_path, mfx->package); - } else { - apps_path = tzplatform_getenv(TZ_USER_APP); - snprintf(root, MAX_QUERY_LEN - 1, "%s/%s", apps_path, mfx->package); - } - path = strdup(root); - } snprintf(query, MAX_QUERY_LEN, - "insert into package_info(package, package_type, package_version, install_location, package_size, " \ + "insert into package_info(package, package_type, package_version, package_api_version, install_location, package_size, " \ "package_removable, package_preload, package_readonly, package_update, package_appsetting, package_nodisplay, package_system," \ "author_name, author_email, author_href, installed_time, installed_storage, storeclient_id, mainapp_id, package_url, root_path, csc_path) " \ - "values('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\ + "values('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\ mfx->package, - type, + mfx->type, mfx->version, + __get_str(mfx->api_version), __get_str(mfx->installlocation), __get_str(mfx->package_size), mfx->removable, @@ -1643,43 +1585,13 @@ static int __insert_manifest_info_in_db(manifest_x *mfx, uid_t uid) __get_str(mfx->storeclient_id), mfx->mainapp_id, __get_str(mfx->package_url), - path, + mfx->root_path, __get_str(mfx->csc_path)); - /*If package dont have main_package tag, this package is main package.*/ - if (mfx->main_package == NULL) { - ret = __exec_query(query); - if (ret == -1) { - _LOGD("Package Info DB Insert Failed\n"); - if (type) { - free(type); - type = NULL; - } - if (path) { - free(path); - path = NULL; - } - return -1; - } - } else { - /*If package has main_package tag, this package is sub package(ug, efl). - skip __exec_query for package_info and change pkgid with main_package*/ - memset(root, '\0', MAX_QUERY_LEN); - snprintf(root, MAX_QUERY_LEN - 1, "/usr/apps/%s", mfx->main_package); - if (access(root, F_OK) == 0) { - free((void *)mfx->package); - mfx->package = strdup(mfx->main_package); - } else { - _LOGE("main package[%s] is not installed\n", root); - return -1; - } - } - if (type) { - free(type); - type = NULL; - } - if (path) { - free(path); - path = NULL; + + ret = __exec_query(query); + if (ret == -1) { + _LOGD("Package Info DB Insert Failed\n"); + return -1; } /*Insert in the package_privilege_info DB*/ @@ -1745,13 +1657,7 @@ static int __insert_manifest_info_in_db(manifest_x *mfx, uid_t uid) /*remove duplicated data in appimage*/ __trimfunc(appimage); - /*g_list_foreach(pkglocale, __printfunc, NULL);*/ - /*_LOGD("\n");*/ - /*g_list_foreach(applocale, __printfunc, NULL);*/ - - /*package locale info, it is only for main package.*/ - if (mfx->main_package == NULL) - g_list_foreach(pkglocale, __insert_pkglocale_info, (gpointer)mfx); + g_list_foreach(pkglocale, __insert_pkglocale_info, (gpointer)mfx); /*native app locale info*/ up = mfx->uiapplication; @@ -1857,6 +1763,9 @@ static int __insert_manifest_info_in_db(manifest_x *mfx, uid_t uid) return -1; /*Insert in the package_app_data_control DB*/ + ret = __insert_uiapplication_datacontrol_info(mfx); + if (ret == -1) + return -1; ret = __insert_serviceapplication_datacontrol_info(mfx); if (ret == -1) return -1; @@ -1927,7 +1836,6 @@ static int __delete_subpkg_info_from_db(char *appid) static int __delete_subpkg_from_db(manifest_x *mfx) { char query[MAX_QUERY_LEN] = { '\0' }; - int ret = -1; char *error_message = NULL; snprintf(query, MAX_QUERY_LEN, "select app_id from package_app_info where package='%s'", mfx->package); @@ -2087,7 +1995,7 @@ static int __update_preload_condition_in_db() return ret; } -int pkgmgr_parser_initialize_db() +API int pkgmgr_parser_initialize_db(uid_t uid) { int ret = -1; /*Manifest DB*/ @@ -2177,11 +2085,29 @@ int pkgmgr_parser_initialize_db() _LOGD("package cert index info DB initialization failed\n"); return ret; } - + /*resource DB*/ + ret = __initialize_db(pkgmgr_parser_db, QUERY_CREATE_TABLE_PACKAGE_RESOURCE_INFO); + if (ret == -1) { + _LOGD("package resource info DB initialization failed\n"); + return ret; + } + ret = __initialize_db(pkgmgr_parser_db, QUERY_CREATE_TABLE_PACKAGE_RESOURCE_DATA); + if (ret == -1) { + _LOGD("package resource data DB initialization failed\n"); + return ret; + } + + if( 0 != __parserdb_change_perm(getUserPkgCertDBPathUID(uid), uid)) { + _LOGD("Failed to change cert db permission\n"); + } + if( 0 != __parserdb_change_perm(getUserPkgParserDBPathUID(uid), uid)) { + _LOGD("Failed to change parser db permission\n"); + } + return 0; } -static int parserdb_change_perm(const char *db_file, uid_t uid) +static int __parserdb_change_perm(const char *db_file, uid_t uid) { char buf[BUFSIZE]; char journal_file[BUFSIZE]; @@ -2192,14 +2118,16 @@ static int parserdb_change_perm(const char *db_file, uid_t uid) files[1] = journal_file; files[2] = NULL; - if(db_file == NULL) + if (db_file == NULL) return -1; - if(getuid() != OWNER_ROOT) //At this time we should be root to apply this - return 0; + if (getuid() != OWNER_ROOT) //At this time we should be root to apply this + return 0; snprintf(journal_file, sizeof(journal_file), "%s%s", db_file, "-journal"); - userinfo = getpwuid(uid); - if (!userinfo) { + if (uid == OWNER_ROOT) + uid = GLOBAL_USER; + userinfo = getpwuid(uid); + if (!userinfo) { _LOGE("FAIL: user %d doesn't exist", uid); return -1; } @@ -2207,24 +2135,59 @@ static int parserdb_change_perm(const char *db_file, uid_t uid) for (i = 0; files[i]; i++) { ret = chown(files[i], uid, userinfo->pw_gid); - SET_SMACK_LABEL(files[i],uid) if (ret == -1) { - strerror_r(errno, buf, sizeof(buf)); - _LOGD("FAIL : chown %s %d.%d, because %s", db_file, uid, userinfo->pw_gid, buf); + if (strerror_r(errno, buf, sizeof(buf))) + strcpy(buf, ""); + _LOGD("FAIL : chown %s %d.%d : %s", files[i], uid, + userinfo->pw_gid, buf); return -1; } ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); if (ret == -1) { - strerror_r(errno, buf, sizeof(buf)); - _LOGD("FAIL : chmod %s 0664, because %s", db_file, buf); + if (strerror_r(errno, buf, sizeof(buf))) + strcpy(buf, ""); + _LOGD("FAIL : chmod %s 0664 : %s", files[i], buf); return -1; } + SET_SMACK_LABEL(files[i]); + } + return 0; +} + +API int pkgmgr_parser_create_and_initialize_db(uid_t uid) +{ + int ret; + + if (getuid() != OWNER_ROOT) { + _LOGE("Only root user is allowed"); + return -1; + } + + if (access(getUserPkgParserDBPathUID(uid), F_OK) != -1) { + _LOGE("Manifest db for user %d is already exists", uid); + return -1; + } + + if (access(getUserPkgCertDBPathUID(uid), F_OK) != -1) { + _LOGE("Cert db for user %d is already exists", uid); + return -1; + } + + ret = pkgmgr_parser_check_and_create_db(uid); + if (ret < 0) + return -1; + ret = pkgmgr_parser_initialize_db(uid); + if (ret < 0) { + pkgmgr_parser_close_db(); + return -1; } + pkgmgr_parser_close_db(); + return 0; } -int pkgmgr_parser_check_and_create_db(uid_t uid) +API int pkgmgr_parser_check_and_create_db(uid_t uid) { int ret = -1; /*Manifest DB*/ @@ -2240,16 +2203,10 @@ int pkgmgr_parser_check_and_create_db(uid_t uid) _LOGD("Cert DB creation Failed\n"); return -1; } - if( 0 != parserdb_change_perm(getUserPkgCertDBPathUID(uid), uid)) { - _LOGD("Failed to change cert db permission\n"); - } - if( 0 != parserdb_change_perm(getUserPkgParserDBPathUID(uid), uid)) { - _LOGD("Failed to change parser db permission\n"); - } return 0; } -void pkgmgr_parser_close_db() +void pkgmgr_parser_close_db(void) { sqlite3_close(pkgmgr_parser_db); sqlite3_close(pkgmgr_cert_db); @@ -2269,7 +2226,7 @@ API int pkgmgr_parser_insert_manifest_info_in_db(manifest_x *mfx) _LOGD("Failed to open DB\n"); return ret; } - ret = pkgmgr_parser_initialize_db(); + ret = pkgmgr_parser_initialize_db(GLOBAL_USER); if (ret == -1) goto err; /*Begin transaction*/ @@ -2313,7 +2270,7 @@ API int pkgmgr_parser_insert_manifest_info_in_usr_db(manifest_x *mfx, uid_t uid) _LOGD("Failed to open DB\n"); return ret; } - ret = pkgmgr_parser_initialize_db(); + ret = pkgmgr_parser_initialize_db(uid); if (ret == -1) goto err; /*Begin transaction*/ @@ -2356,7 +2313,7 @@ API int pkgmgr_parser_update_manifest_info_in_usr_db(manifest_x *mfx, uid_t uid) _LOGD("Failed to open DB\n"); return ret; } - ret = pkgmgr_parser_initialize_db(); + ret = pkgmgr_parser_initialize_db(uid); if (ret == -1) goto err; /*Preserve guest mode visibility*/