diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-13 13:04:37 -0700 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-13 13:04:37 -0700 |
| commit | e037fd7e193ecccbb5c0888e49f6d58c224bc11d (patch) | |
| tree | 3936f402311799c99169f8e1d6bf168a2d48f1a9 /adb/adb.c | |
| parent | 2015549667fb77706a9879e974a3875ebccd8198 (diff) | |
| download | system_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.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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 */ |
