#include <grp.h>
#include <pwd.h>
-#include <tzplatform_config.h>
#include <sys/stat.h>
#include <db-util.h>
char *_rua_util_get_db_path(uid_t uid, char *db_name)
{
char db_path[PATH_MAX];
- const char *db_path_prefix;
- tzplatform_set_user(uid);
- db_path_prefix = tzplatform_getenv(TZ_USER_DB);
- tzplatform_reset_user();
-
- snprintf(db_path, sizeof(db_path), "%s/%s", db_path_prefix, db_name);
+ snprintf(db_path, sizeof(db_path), "/run/aul/dbspace/%d/%s",
+ uid, db_name);
LOGD("db path %s", db_path);
return strdup(db_path);
int _rua_util_open_db(sqlite3 **db, int flags, uid_t uid, char *db_name)
{
int r;
- char *db_path = _rua_util_get_db_path(uid, db_name);
+ char *db_path;
+
+ db_path = _rua_util_get_db_path(uid, db_name);
if (db_path == NULL) {
LOGE("out of memory _rua_util_get_db_path fail");
return -1;
int _rua_util_check_uid(uid_t target_uid)
{
uid_t uid = getuid();
+
if (uid > BASE_UID && uid != target_uid) {
LOGE("Invalid UID : %d, target UID : %d", uid, target_uid);
return -1;