• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

external/koush/Superuser


Commit MetaInfo

Revisioncd2f8cce8de56508afc0ae917d7094afec1dc6a8 (tree)
Time2018-02-02 11:14:23
AuthorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

jni: correct the database path

It was moved to the device encrypted user data dir.

Change Summary

Incremental Difference

--- a/Superuser/jni/su/db.c
+++ b/Superuser/jni/su/db.c
@@ -84,7 +84,7 @@ policy_t database_check(struct su_context *ctx) {
8484 snprintf(query, sizeof(query), "select policy, until, command from uid_policy where uid=%d", ctx->from.uid);
8585 int ret = sqlite3_open_v2(ctx->user.database_path, &db, SQLITE_OPEN_READONLY, NULL);
8686 if (ret) {
87- LOGE("sqlite3 open failure: %d", ret);
87+ LOGE("sqlite3 open %s failure: %d", ctx->user.database_path, ret);
8888 sqlite3_close(db);
8989 return INTERACTIVE;
9090 }
--- a/Superuser/jni/su/su.c
+++ b/Superuser/jni/su/su.c
@@ -239,12 +239,10 @@ static void read_options(struct su_context *ctx) {
239239 }
240240
241241 static void user_init(struct su_context *ctx) {
242- if (ctx->from.uid > 99999) {
242+ if (ctx->user.multiuser_mode != MULTIUSER_MODE_NONE) {
243243 ctx->user.android_user_id = ctx->from.uid / 100000;
244- if (ctx->user.multiuser_mode == MULTIUSER_MODE_USER) {
245- snprintf(ctx->user.database_path, PATH_MAX, "%s/%d/%s", REQUESTOR_USER_PATH, ctx->user.android_user_id, REQUESTOR_DATABASE_PATH);
246- snprintf(ctx->user.base_path, PATH_MAX, "%s/%d/%s", REQUESTOR_USER_PATH, ctx->user.android_user_id, REQUESTOR);
247- }
244+ snprintf(ctx->user.database_path, PATH_MAX, "%s/%d/%s", REQUESTOR_USER_PATH, ctx->user.android_user_id, REQUESTOR_DATABASE_PATH);
245+ snprintf(ctx->user.base_path, PATH_MAX, "%s/%d/%s", REQUESTOR_USER_PATH, ctx->user.android_user_id, REQUESTOR);
248246 }
249247 }
250248
--- a/Superuser/jni/su/su.h
+++ b/Superuser/jni/su/su.h
@@ -61,7 +61,7 @@
6161 #endif
6262 #define REQUESTOR_DATA_PATH "/data/data/"
6363 #define REQUESTOR_FILES_PATH REQUESTOR_DATA_PATH REQUESTOR "/files"
64-#define REQUESTOR_USER_PATH "/data/user/"
64+#define REQUESTOR_USER_PATH "/data/user_de"
6565 #define REQUESTOR_CACHE_PATH "/dev/" REQUESTOR
6666 #define REQUESTOR_DAEMON_PATH REQUESTOR_CACHE_PATH ".daemon"
6767