Name: account-parser
Summary: Account Parser Library
-Version: 0.1.0
+Version: 0.1.1
Release: 0
Group: Social & Content/Other
License: Apache-2.0
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires: pkgconfig(pkgmgr-installer)
BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(libtzplatform-config)
#include <account-types.h>
#include <account_internal.h>
#include <pkgmgr-info.h>
+#include <pkgmgr_installer_info.h>
#include <app_manager.h>
#include <tzplatform_config.h>
{
int account_type_db_id = 0;
uid_t uid = -1;
- uid = getuid();
+ if (pkgmgr_installer_info_get_target_uid(&uid) < 0) {
+ _E("pkgmgr_installer_info_get_target_uid() fail");
+ goto CATCH;
+ }
+
if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
ret = account_type_insert_to_db_offline(account_type_handle, &account_type_db_id);
} else {
int ret = ACCOUNT_ERROR_NONE;
uid_t uid = -1;
- uid = getuid();
+ if (pkgmgr_installer_info_get_target_uid(&uid) < 0) {
+ _E("pkgmgr_installer_info_get_target_uid() fail");
+ goto CATCH;
+ }
//To Do : delete accounts of this app from all user db.
if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
pkgmgrinfo_appinfo_get_appid(handle, &app_id);
_D("appid : %s", app_id);
- uid = getuid();
+ if (pkgmgr_installer_info_get_target_uid(&uid) < 0) {
+ _E("pkgmgr_installer_info_get_target_uid() fail");
+ return -1;
+ }
+
if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
ret = account_type_delete_by_app_id_offline((char*)app_id);
} else {
int ret = -1;
uid_t uid = 0;
- uid = getuid();
+ if (pkgmgr_installer_info_get_target_uid(&uid) < 0) {
+ _E("pkgmgr_installer_info_get_target_uid() fail");
+ return -1;
+ }
+
if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
ret = pkgmgrinfo_pkginfo_get_pkginfo(packageId, &package_info_handle);
} else {
int ret = -1;
uid_t uid = 0;
- uid = getuid();
+ if (pkgmgr_installer_info_get_target_uid(&uid) < 0) {
+ _E("pkgmgr_installer_info_get_target_uid() fail");
+ return -1;
+ }
+
if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
ret = pkgmgrinfo_pkginfo_get_pkginfo(packageId, &package_info_handle);
} else {