aboutsummaryrefslogtreecommitdiffstats
path: root/adb/adb.c
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-13 13:04:37 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-13 13:04:37 -0700
commite037fd7e193ecccbb5c0888e49f6d58c224bc11d (patch)
tree3936f402311799c99169f8e1d6bf168a2d48f1a9 /adb/adb.c
parent2015549667fb77706a9879e974a3875ebccd8198 (diff)
downloadsystem_core-e037fd7e193ecccbb5c0888e49f6d58c224bc11d.tar.gz
system_core-e037fd7e193ecccbb5c0888e49f6d58c224bc11d.tar.bz2
system_core-e037fd7e193ecccbb5c0888e49f6d58c224bc11d.zip
auto import from //branches/cupcake_rel/...@138607
Diffstat (limited to 'adb/adb.c')
-rw-r--r--adb/adb.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/adb/adb.c b/adb/adb.c
index 7b23894b..12a36f5c 100644
--- a/adb/adb.c
+++ b/adb/adb.c
@@ -859,8 +859,20 @@ int adb_main(int is_daemon)
property_get("ro.kernel.qemu", value, "");
if (strcmp(value, "1") != 0) {
property_get("ro.secure", value, "");
- if (strcmp(value, "1") == 0)
+ if (strcmp(value, "1") == 0) {
+ // don't run as root if ro.secure is set...
secure = 1;
+
+ // ... except we allow running as root in userdebug builds if the
+ // service.adb.root property has been set by the "adb root" command
+ property_get("ro.debuggable", value, "");
+ if (strcmp(value, "1") == 0) {
+ property_get("service.adb.root", value, "");
+ if (strcmp(value, "1") == 0) {
+ secure = 0;
+ }
+ }
+ }
}
/* don't listen on port 5037 if we are running in secure mode */