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

Walter Harms wharms at bfs.de
Mon Nov 2 12:45:14 UTC 2020


i am sorry i am not an expert in bash booting behavior.
Would you mind to drop a few words what bash does in such cases ?
________________________________________
Von: busybox <busybox-bounces at busybox.net> im Auftrag von Björn Bidar <bjorn.bidar at jolla.com>
Gesendet: Montag, 2. November 2020 11:16:32
An: busybox at busybox.net
Betreff: [PATCH] ash: Load $ENV file also if $SSH_CLIENT/SSH2_CLIENT is preset in env, reformat

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



16:00
_______________________________________________
busybox mailing list
busybox at busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list