diff options
author | Badhri Jagan Sridharan <badhri@google.com> | 2014-07-10 00:49:56 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-07-10 00:49:56 +0000 |
commit | bf9ef5196995119a9801b55d2df2e683eeba2168 (patch) | |
tree | 8feae684055727806e7e9937726b960b5c8410c3 /adb | |
parent | c89c0c65c7683835248c06899dc0712a50f6caa2 (diff) | |
parent | cb7be1e8cd4e4388d014a5c48df455a5715f2180 (diff) | |
download | system_core-bf9ef5196995119a9801b55d2df2e683eeba2168.tar.gz system_core-bf9ef5196995119a9801b55d2df2e683eeba2168.tar.bz2 system_core-bf9ef5196995119a9801b55d2df2e683eeba2168.zip |
am cb7be1e8: am 87c7a0d7: am 77a2c22d: Merge "adbd: adb root should terminate adbd only if it\'s debuggable"
* commit 'cb7be1e8cd4e4388d014a5c48df455a5715f2180':
adbd: adb root should terminate adbd only if it's debuggable
Diffstat (limited to 'adb')
-rw-r--r-- | adb/sockets.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/adb/sockets.c b/adb/sockets.c index de14a2254..faa9564ca 100644 --- a/adb/sockets.c +++ b/adb/sockets.c @@ -23,6 +23,10 @@ #include "sysdeps.h" +#if !ADB_HOST +#include <cutils/properties.h> +#endif + #define TRACE_TAG TRACE_SOCKETS #include "adb.h" @@ -428,6 +432,9 @@ asocket *create_local_service_socket(const char *name) { asocket *s; int fd; +#if !ADB_HOST + char debug[PROPERTY_VALUE_MAX]; +#endif #if !ADB_HOST if (!strcmp(name,"jdwp")) { @@ -444,7 +451,11 @@ asocket *create_local_service_socket(const char *name) D("LS(%d): bound to '%s' via %d\n", s->id, name, fd); #if !ADB_HOST - if ((!strncmp(name, "root:", 5) && getuid() != 0) + if (!strncmp(name, "root:", 5)) + property_get("ro.debuggable", debug, ""); + + if ((!strncmp(name, "root:", 5) && getuid() != 0 + && strcmp(debug, "1") == 0) || !strncmp(name, "usb:", 4) || !strncmp(name, "tcpip:", 6)) { D("LS(%d): enabling exit_on_close\n", s->id); |