OSDN Git Service

Drop compatibility with pre 2012 adb clients
authorNick Kralevich <nnk@google.com>
Tue, 12 Apr 2016 23:32:33 +0000 (16:32 -0700)
committerNick Kralevich <nnk@google.com>
Tue, 12 Apr 2016 23:32:33 +0000 (16:32 -0700)
On very old versions of adb, when "adb bugreport" was executed,
the command "adb shell dumpstate" was run. This was later changed
to "adb shell bugreport". Change
1e339878c128ef47271278779c2685a8dfa49cd1 added a backwards
compatibility hack (see bug 6391938).

It turns out that nobody has been able to execute
/system/bin/dumpstate as a non-root user for 2 releases now due
to SELinux restrictions, so maintaining the code bloat to support
this workaround is pointless.

Delete the code.

Bug: 6391938
Change-Id: I49eebcca1fcec5a39593c53e2e6d23ec87f65a35

cmds/dumpstate/dumpstate.cpp

index af95d16..f207bb5 100644 (file)
@@ -1025,15 +1025,6 @@ int main(int argc, char *argv[]) {
 
     now = time(NULL);
 
-    if (getuid() != 0) {
-        // Old versions of the adb client would call the
-        // dumpstate command directly. Newer clients
-        // call /system/bin/bugreport instead. If we detect
-        // we're being called incorrectly, then exec the
-        // correct program.
-        return execl("/system/bin/bugreport", "/system/bin/bugreport", NULL);
-    }
-
     MYLOGI("begin\n");
 
     /* gets the sequential id */