From 2eb8fa935517f89404d7618abeb19cb3c6a78941 Mon Sep 17 00:00:00 2001 From: Greg Alexander Date: Sat, 18 Jun 2016 15:15:27 -0400 Subject: [PATCH] don't clear the environment when spawning shells, so that android system variables remain available (so you can run 'am' and 'pm') --- dropbear/svr-chansession.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dropbear/svr-chansession.c b/dropbear/svr-chansession.c index cbc4223..5d212ec 100644 --- a/dropbear/svr-chansession.c +++ b/dropbear/svr-chansession.c @@ -912,6 +912,10 @@ static void execchild(void *user_data) { /* clear environment */ /* if we're debugging using valgrind etc, we need to keep the LD_PRELOAD * etc. This is hazardous, so should only be used for debugging. */ +#if 0 + /* don't clear the environment so that we inherit all of the android + * system environment, which lets utilities like am (android manager?) + * and pm (package manager?) run */ #ifndef DEBUG_VALGRIND #ifdef HAVE_CLEARENV clearenv(); @@ -922,6 +926,7 @@ static void execchild(void *user_data) { } #endif /* HAVE_CLEARENV */ #endif /* DEBUG_VALGRIND */ +#endif #if 0 /* We can only change uid/gid as root ... */