summaryrefslogtreecommitdiffstats
path: root/adb/shell_service.cpp
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2015-12-10 20:42:18 +0000
committerNick Kralevich <nnk@google.com>2015-12-10 20:42:18 +0000
commitb118762241da6676fce834728be4a10260ac28a1 (patch)
tree3ea8b53716b25d8986aad17df22813b0f9ed99f6 /adb/shell_service.cpp
parent173eb396c7854a3b6c18d0d65865ad05c8b0e195 (diff)
downloadsystem_core-b118762241da6676fce834728be4a10260ac28a1.tar.gz
system_core-b118762241da6676fce834728be4a10260ac28a1.tar.bz2
system_core-b118762241da6676fce834728be4a10260ac28a1.zip
Revert "adb: Make HOME=/data/local/tmp"
During early boot, we may be mounting and unmounting /data. Having the home directory for adb shell commands, such as "adb shell logcat", on the /data directory prevents unmounting. This reverts commit 173eb396c7854a3b6c18d0d65865ad05c8b0e195. Bug: 26132185 Change-Id: Ib7c2f9e696f52bf5bbb79223d90dd76791779587
Diffstat (limited to 'adb/shell_service.cpp')
-rw-r--r--adb/shell_service.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/adb/shell_service.cpp b/adb/shell_service.cpp
index 6c066694d..3fc70b026 100644
--- a/adb/shell_service.cpp
+++ b/adb/shell_service.cpp
@@ -289,6 +289,7 @@ bool Subprocess::ForkAndExec() {
// TODO: $HOSTNAME? Normally bash automatically sets that, but mksh doesn't.
passwd* pw = getpwuid(getuid());
if (pw != nullptr) {
+ setenv("HOME", pw->pw_dir, 1);
setenv("LOGNAME", pw->pw_name, 1);
setenv("SHELL", pw->pw_shell, 1);
setenv("USER", pw->pw_name, 1);
@@ -297,8 +298,6 @@ bool Subprocess::ForkAndExec() {
setenv("TERM", terminal_type_.c_str(), 1);
}
- setenv("HOME", "/data/local/tmp", 1);
- chdir(getenv("HOME"));
if (is_interactive()) {
execl(_PATH_BSHELL, _PATH_BSHELL, "-", nullptr);
} else {