[PATCH] ash: Load $ENV file also if $SSH_CLIENT/SSH2_CLIENT is preset in env

Bjoern Bidar bjorn.bidar at jolla.com
Mon Sep 7 12:54:12 UTC 2020


This emulates the behavior of bash loading .bashrc when $SSH_CLIENT or 
$SSH2_CLIENT is preset in env.

Signed-off-by: Björn Bidar <bjorn.bidar at jolla.com>
---
 shell/ash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shell/ash.c b/shell/ash.c
index ecb9b132b..797763187 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -14467,7 +14467,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
 #ifndef linux
 	 getuid() == geteuid() && getgid() == getegid() &&
 #endif
-	 iflag
+	 iflag || ( minusc && ( lookupvar("SSH_CLIENT") != NULL || 
lookupvar("SSH2_CLIENT") != NULL)) && rootshell
 	) {
 		const char *shinit = lookupvar("ENV");
 		if (shinit != NULL && *shinit != '\0')
-- 
2.28.0






More information about the busybox mailing list