adjust global DB path for owner user 40/100340/4 accepted/tizen/3.0/common/20161201.135211 accepted/tizen/3.0/ivi/20161201.031808 accepted/tizen/3.0/mobile/20161201.031728 accepted/tizen/3.0/wearable/20161201.031747 submit/tizen_3.0/20161130.114206
authorIckhee Woo <ickhee.woo@samsung.com>
Mon, 28 Nov 2016 01:23:30 +0000 (10:23 +0900)
committerIckhee Woo <ickhee.woo@samsung.com>
Wed, 30 Nov 2016 11:27:19 +0000 (20:27 +0900)
Change-Id: I81ec17472bd6389ce1c48a7de9d3d9a0ed4aa921
Signed-off-by: Ickhee Woo <ickhee.woo@samsung.com>
packaging/libaccount-service.spec
src/account.c
src/account_offline.c

index 85a106c..c5209a6 100644 (file)
@@ -1,7 +1,6 @@
-
 Name:       libaccount-service
 Summary:    Account DB library
-Version:    0.4.10
+Version:    0.4.11
 Release:    1
 Group:      Social & Content/API
 License:    Apache-2.0
index 9bdee93..f083f3d 100644 (file)
@@ -1465,8 +1465,12 @@ ACCOUNT_API int account_query_account_by_account_id(int account_db_id, account_h
                return ACCOUNT_ERROR_PERMISSION_DENIED;
        }
 
+       uid_t uid = (int)getuid();
+       if (uid < 5001)
+               uid = 5001;
+
        GVariant *account_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_id, (int)getuid(), &account_variant, NULL, &error);
+       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_id, (int)uid, &account_variant, NULL, &error);
        _account_manager_release_instance();
 
        int error_code = _account_get_error_code(is_success, error);
@@ -1510,8 +1514,12 @@ ACCOUNT_API int account_query_account_by_user_name(account_cb callback, const ch
                return ACCOUNT_ERROR_PERMISSION_DENIED;
        }
 
+       uid_t uid = (int)getuid();
+       if (uid < 5001)
+               uid = 5001;
+
        GVariant *account_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_user_name_sync(acc_mgr, user_name, (int)getuid(), &account_list_variant, NULL, &error);
+       bool is_success = account_manager_call_account_query_account_by_user_name_sync(acc_mgr, user_name, (int)uid, &account_list_variant, NULL, &error);
        _account_manager_release_instance();
 
        int error_code = _account_get_error_code(is_success, error);
@@ -1565,7 +1573,11 @@ ACCOUNT_API int account_query_account_by_package_name(account_cb callback, const
                return ACCOUNT_ERROR_DB_NOT_OPENED;
        }
 
-       bool is_success = account_manager_call_account_query_account_by_package_name_sync(acc_mgr, package_name, (int)getuid(), &account_list_variant, NULL, &error);
+       uid = (int)getuid();
+       if (uid < 5001)
+               uid = 5001;
+
+       bool is_success = account_manager_call_account_query_account_by_package_name_sync(acc_mgr, package_name, (int)uid, &account_list_variant, NULL, &error);
        _account_manager_release_instance();
 
        int error_code = _account_get_error_code(is_success, error);
@@ -1617,8 +1629,12 @@ ACCOUNT_API int account_query_account_by_capability(account_cb callback, const c
                return ACCOUNT_ERROR_PERMISSION_DENIED;
        }
 
+       uid_t uid = (int)getuid();
+       if (uid < 5001)
+               uid = 5001;
+
        GVariant *account_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_capability_sync(acc_mgr, capability_type, capability_value, (int)getuid(), &account_list_variant, NULL, &error);
+       bool is_success = account_manager_call_account_query_account_by_capability_sync(acc_mgr, capability_type, capability_value, (int)uid, &account_list_variant, NULL, &error);
        _account_manager_release_instance();
 
        int error_code = _account_get_error_code(is_success, error);
@@ -1663,8 +1679,12 @@ ACCOUNT_API int account_query_account_by_capability_type(account_cb callback, co
                return ACCOUNT_ERROR_PERMISSION_DENIED;
        }
 
+       uid_t uid = (int)getuid();
+       if (uid < 5001)
+               uid = 5001;
+
        GVariant *account_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_capability_type_sync(acc_mgr, capability_type, (int)getuid(), &account_list_variant, NULL, &error);
+       bool is_success = account_manager_call_account_query_account_by_capability_type_sync(acc_mgr, capability_type, (int)uid, &account_list_variant, NULL, &error);
        _account_manager_release_instance();
 
        int error_code = _account_get_error_code(is_success, error);
@@ -1709,8 +1729,12 @@ ACCOUNT_API int account_query_capability_by_account_id(capability_cb callback, i
                return ACCOUNT_ERROR_PERMISSION_DENIED;
        }
 
+       uid_t uid = (int)getuid();
+       if (uid < 5001)
+               uid = 5001;
+
        GVariant *capability_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_capability_by_account_id_sync(acc_mgr, account_id, (int)getuid(), &capability_list_variant, NULL, &error);
+       bool is_success = account_manager_call_account_query_capability_by_account_id_sync(acc_mgr, account_id, (int)uid, &capability_list_variant, NULL, &error);
        _account_manager_release_instance();
 
        int error_code = _account_get_error_code(is_success, error);
index 5e9f891..7aa8922 100644 (file)
@@ -172,7 +172,7 @@ static int _account_global_db_open(int mode)
                return ACCOUNT_ERROR_PERMISSION_DENIED;
        }
 
-       ACCOUNT_GET_OWNER_DB_PATH(account_db_path, sizeof(account_db_path), 5001);
+       ACCOUNT_GET_GLOBAL_DB_PATH(account_db_path, sizeof(account_db_path));
 
        _INFO("account_db_path canonicalized = %s", account_db_path);