-
Name: account-manager
Summary: Account Manager
-Version: 0.1.7
+Version: 0.1.9
Release: 1
Group: Social & Content/Other
License: Apache-2.0
BuildRequires: pkgconfig(cynara-session)
BuildRequires: pkgconfig(cynara-creds-gdbus)
BuildRequires: pkgconfig(account-common)
-#BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: pkgconfig(libtzplatform-config)
%define upgrade_script_path /usr/share/upgrade/scripts
+%define TZ_OWNER_DB %{TZ_SYS_DB}/5001
Requires(post): /sbin/ldconfig
Requires(post): /usr/bin/sqlite3
mkdir -p %{buildroot}%{upgrade_script_path}
cp -f scripts/%{name}-upgrade.sh %{buildroot}%{upgrade_script_path}
+
%post
/sbin/ldconfig
#if [ ! -d /opt/usr/dbspace ]
#then
# mkdir -p /opt/usr/dbspace
#fi
-if [ ! -f %{TZ_SYS_DB}/.account.db ]
+mkdir -p %{TZ_OWNER_DB}
+if [ ! -f %{TZ_OWNER_DB}/.account.db ]
then
- sqlite3 %{TZ_SYS_DB}/.account.db 'PRAGMA journal_mode = PERSIST;
+ sqlite3 %{TZ_OWNER_DB}/.account.db 'PRAGMA journal_mode = PERSIST;
CREATE TABLE if not exists label (AppId TEXT, Label TEXT, Locale TEXT);
CREATE TABLE if not exists account_type (_id INTEGER PRIMARY KEY AUTOINCREMENT, AppId TEXT,
ServiceProviderId TEXT, IconPath TEXT, SmallIconPath TEXT, MultipleAccountSupport INT);
'
fi
-chown service_fw:service_fw %{TZ_SYS_DB}/.account.db
-chown service_fw:service_fw %{TZ_SYS_DB}/.account.db-journal
+chown service_fw:service_fw %{TZ_OWNER_DB}
+chown service_fw:service_fw %{TZ_OWNER_DB}/.account.db
+chown service_fw:service_fw %{TZ_OWNER_DB}/.account.db-journal
-chmod 660 %{TZ_SYS_DB}/.account.db
-chmod 660 %{TZ_SYS_DB}/.account.db-journal
+chmod 644 %{TZ_OWNER_DB}/.account.db
+chmod 644 %{TZ_OWNER_DB}/.account.db-journal
#smack labeling
#chsmack -a 'System::Shared' %{TZ_SYS_DB}/.account.db-journal
ACCOUNT_DB_DIR_24=/opt/usr/dbspace
# 3.0
-ACCOUNT_GLOBAL_USER_DB_DIR_30=/opt/dbspace
-ACCOUNT_USER_DB_DIR_30=/opt/dbspace/5001
+ACCOUNT_GLOBAL_USER_DB_DIR_30=/opt/dbspace/5001
ACCOUNT_DB_24=$ACCOUNT_DB_DIR_24/.account.db
ACCOUNT_GLOBAL_USER_DB_30=$ACCOUNT_GLOBAL_USER_DB_DIR_30/.account.db
-ACCOUNT_USER_DB_30=$ACCOUNT_USER_DB_DIR_30/.account.db
mkdir -p $ACCOUNT_GLOBAL_USER_DB_DIR_30
-mkdir -p $ACCOUNT_USER_DB_DIR_30
-chown service_fw:service_fw $ACCOUNT_USER_DB_DIR_30
-chmod 755 $ACCOUNT_USER_DB_DIR_30
+chown service_fw:service_fw $ACCOUNT_GLOBAL_USER_DB_DIR_30
+chmod 755 $ACCOUNT_GLOBAL_USER_DB_DIR_30
# Copy DB
cp -rf $ACCOUNT_DB_24 $ACCOUNT_GLOBAL_USER_DB_DIR_30
cp -rf $ACCOUNT_DB_24-journal $ACCOUNT_GLOBAL_USER_DB_DIR_30
-cp -rf $ACCOUNT_DB_24 $ACCOUNT_USER_DB_DIR_30
-cp -rf $ACCOUNT_DB_24-journal $ACCOUNT_USER_DB_DIR_30
-
chown service_fw:service_fw $ACCOUNT_GLOBAL_USER_DB_30
chown service_fw:service_fw $ACCOUNT_GLOBAL_USER_DB_30-journal
-chown service_fw:service_fw $ACCOUNT_USER_DB_30
-chown service_fw:service_fw $ACCOUNT_USER_DB_30-journal
-chmod 660 $ACCOUNT_GLOBAL_USER_DB_30
-chmod 660 $ACCOUNT_GLOBAL_USER_DB_30-journal
-chmod 660 $ACCOUNT_USER_DB_30
-chmod 660 $ACCOUNT_USER_DB_30-journal
+chmod 644 $ACCOUNT_GLOBAL_USER_DB_30
+chmod 644 $ACCOUNT_GLOBAL_USER_DB_30-journal
# Delete DB
rm -rf $ACCOUNT_DB_24
rm -rf $ACCOUNT_DB_24-journal
-# Update account DB
-sqlite3 $ACCOUNT_GLOBAL_USER_DB_30 'delete from account'
-sqlite3 $ACCOUNT_GLOBAL_USER_DB_30 'delete from capability'
-sqlite3 $ACCOUNT_USER_DB_30 'delete from account_type'
-sqlite3 $ACCOUNT_USER_DB_30 'delete from label'
-sqlite3 $ACCOUNT_USER_DB_30 'delete from provider_feature'
-
exit 0
_INFO( "start _account_global_db_open()");
ACCOUNT_MEMSET(account_db_path, 0x00, sizeof(account_db_path));
- ACCOUNT_GET_GLOBAL_DB_PATH(account_db_path, sizeof(account_db_path));
+ ACCOUNT_GET_OWNER_DB_PATH(account_db_path, sizeof(account_db_path), 5001);
if( g_hAccountGlobalDB ) {
_ERR( "Account database is using in another app. %x", g_hAccountDB );
if( ret != _ACCOUNT_ERROR_NONE )
ACCOUNT_DEBUG( "db_util_close(g_hAccountGlobalDB2) fail ret = %d", ret);
- ACCOUNT_DEBUG( "before db_util_open()");
+ ACCOUNT_DEBUG( "before _account_global_db_open()");
// if(mode == ACCOUNT_DB_OPEN_READWRITE)
// rc = db_util_open(account_db_path, &g_hAccountDB, DB_UTIL_REGISTER_HOOK_METHOD);
// else if(mode == ACCOUNT_DB_OPEN_READONLY)
rc = db_util_open_with_options(account_db_path, &g_hAccountGlobalDB, SQLITE_OPEN_READONLY, NULL);
// else
// return _ACCOUNT_ERROR_DB_NOT_OPENED;
- ACCOUNT_DEBUG( "after db_util_open() sqlite_rc = %d", rc);
+ ACCOUNT_DEBUG( "after _account_global_db_open() sqlite_rc = %d", rc);
if( rc == SQLITE_PERM || _account_db_err_code(g_hAccountGlobalDB) == SQLITE_PERM ) {
ACCOUNT_ERROR( "Account permission denied");
char account_db_dir[256] = {0, };
char account_db_path[256] = {0, };
- _INFO( "start _account_db_open()");
+ _INFO( "start _account_db_open() pid [%d]. uid [%d]", pid, uid);
ACCOUNT_MEMSET(account_db_dir, 0x00, sizeof(account_db_dir));
ACCOUNT_MEMSET(account_db_path, 0x00, sizeof(account_db_path));
account_type_s* account_type = NULL;
guint pid = _get_client_pid(invocation);
- _INFO("client Id = [%u]", pid);
+ _INFO("client pid = [%u], uid = [%d]", pid, uid);
int return_code = _check_priviliege_account_read(invocation);
if (return_code != _ACCOUNT_ERROR_NONE)