external/koush/Superuser
Revision | b6b13f2307f5608e6e2278ea6e8f92698aa384cb (tree) |
---|---|
Time | 2013-11-16 02:24:32 |
Author | Koushik Dutta <koushd@gmai...> |
Commiter | Koushik Dutta |
Fix superuser when using ART.
Change-Id: I8ef488afe6f7912d8fac205088c3b431a5cb4a35
@@ -631,12 +631,16 @@ int main(int argc, char *argv[]) { | ||
631 | 631 | |
632 | 632 | // attempt to use the daemon client if not root, |
633 | 633 | // 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 | + } | |
638 | 640 | } |
639 | 641 | |
642 | + LOGD("skipping daemon client %d %d", getuid(), geteuid()); | |
643 | + | |
640 | 644 | // Sanitize all secure environment variables (from linker_environ.c in AOSP linker). |
641 | 645 | /* The same list than GLibc at this point */ |
642 | 646 | static const char* const unsec_vars[] = { |