• 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

Revisionb6b13f2307f5608e6e2278ea6e8f92698aa384cb (tree)
Time2013-11-16 02:24:32
AuthorKoushik Dutta <koushd@gmai...>
CommiterKoushik Dutta

Log Message

Fix superuser when using ART.

Change-Id: I8ef488afe6f7912d8fac205088c3b431a5cb4a35

Change Summary

Incremental Difference

--- a/Superuser/jni/su/su.c
+++ b/Superuser/jni/su/su.c
@@ -631,12 +631,16 @@ int main(int argc, char *argv[]) {
631631
632632 // attempt to use the daemon client if not root,
633633 // or this is api 18 and adb shell (/data is not readable even as root)
634- if ((geteuid() != AID_ROOT && getuid() != AID_ROOT) || (is_api_18() && getuid() == AID_SHELL)) {
635- // attempt to connect to daemon...
636- LOGD("starting daemon client %d %d", getuid(), geteuid());
637- return connect_daemon(argc, argv);
634+ if (is_api_18()) {
635+ if (geteuid() != AID_ROOT || getuid() != AID_ROOT) {
636+ // attempt to connect to daemon...
637+ LOGD("starting daemon client %d %d", getuid(), geteuid());
638+ return connect_daemon(argc, argv);
639+ }
638640 }
639641
642+ LOGD("skipping daemon client %d %d", getuid(), geteuid());
643+
640644 // Sanitize all secure environment variables (from linker_environ.c in AOSP linker).
641645 /* The same list than GLibc at this point */
642646 static const char* const unsec_vars[] = {