sync code with tizen_3.0 branch 96/100596/1 accepted/tizen/common/20161130.070804 accepted/tizen/ivi/20161130.232422 accepted/tizen/mobile/20161130.232324 accepted/tizen/wearable/20161130.232401 submit/tizen/20161129.100222 submit/tizen/20161130.051215
authorIckhee Woo <ickhee.woo@samsung.com>
Mon, 28 Nov 2016 12:56:03 +0000 (21:56 +0900)
committerIckhee Woo <ickhee.woo@samsung.com>
Mon, 28 Nov 2016 12:56:03 +0000 (21:56 +0900)
Change-Id: Ibcacfa783e8f7bec3cc642d94f27bdde10692658
Signed-off-by: Ickhee Woo <ickhee.woo@samsung.com>
packaging/libaccount-service.spec
src/account_offline.c

index ddaa521..85a106c 100644 (file)
@@ -1,7 +1,7 @@
 
 Name:       libaccount-service
 Summary:    Account DB library
-Version:    0.4.8
+Version:    0.4.10
 Release:    1
 Group:      Social & Content/API
 License:    Apache-2.0
index f443a42..5e9f891 100644 (file)
@@ -98,15 +98,15 @@ static int _account_user_db_open(sqlite3 **p_hAccountDB, int mode, uid_t uid)
        ACCOUNT_GET_USER_DB_DIR(account_db_dir, sizeof(account_db_dir), uid);
        if ((-1 == access(account_db_dir, F_OK)) && uid != OWNER_ROOT) {
                int ret;
-               mkdir(account_db_dir, 777);
+               mkdir(account_db_dir, 755);
                ret = chown(account_db_dir, SERVICE_FW_UID, SERVICE_FW_GID);
                ACCOUNT_DEBUG("chown result = [%d]", ret);
-               ret = chmod(account_db_dir, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH);
+               ret = chmod(account_db_dir, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
                ACCOUNT_DEBUG("chmod result = [%d]", ret);
                rc = db_util_open(account_db_path, p_hAccountDB, DB_UTIL_REGISTER_HOOK_METHOD);
                ret = chown(account_db_path, SERVICE_FW_UID, SERVICE_FW_GID);
                ACCOUNT_DEBUG("chown result = [%d]", ret);
-               ret = chmod(account_db_path, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
+               ret = chmod(account_db_path, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
                ACCOUNT_DEBUG("chmod result = [%d]", ret);
        } else {
                if (mode == ACCOUNT_DB_OPEN_READWRITE)
@@ -172,7 +172,7 @@ static int _account_global_db_open(int mode)
                return ACCOUNT_ERROR_PERMISSION_DENIED;
        }
 
-       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);
 
        _INFO("account_db_path canonicalized = %s", account_db_path);
 
@@ -180,15 +180,15 @@ static int _account_global_db_open(int mode)
                ACCOUNT_GET_USER_DB_DIR(account_db_dir, sizeof(account_db_dir), uid);
                if ((-1 == access(account_db_dir, F_OK)) && uid != OWNER_ROOT) {
                        int ret;
-                       mkdir(account_db_dir, 777);
+                       mkdir(account_db_dir, 755);
                        ret = chown(account_db_dir, SERVICE_FW_UID, SERVICE_FW_GID);
                        ACCOUNT_DEBUG("chown result = [%d]", ret);
-                       ret = chmod(account_db_dir, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH);
+                       ret = chmod(account_db_dir, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
                        ACCOUNT_DEBUG("chmod result = [%d]", ret);
                        rc = db_util_open(account_db_path, &g_hAccountGlobalDB, DB_UTIL_REGISTER_HOOK_METHOD);
                        ret = chown(account_db_path, SERVICE_FW_UID, SERVICE_FW_GID);
                        ACCOUNT_DEBUG("chown result = [%d]", ret);
-                       ret = chmod(account_db_path, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
+                       ret = chmod(account_db_path, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
                        ACCOUNT_DEBUG("chmod result = [%d]", ret);
                } else {
                        if (mode == ACCOUNT_DB_OPEN_READWRITE)
@@ -292,6 +292,7 @@ ACCOUNT_INTERNAL_API int account_type_insert_to_db_offline(account_type_h accoun
        }
 
        /* Workaround for internal UTC */
+       _INFO("UID is [%d]", (int)uid);
        if (uid == 0)
                uid = getuid();