Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[busybox] Suppot loading $ENV when using SSH. JB#50984
Also use %autosetup instead of applying patches manually.
- Loading branch information
Showing
2 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
rpm/0001-ash-Load-ENV-file-also-if-SSH_CLIENT-SSH2_CLIENT-is-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From d192ebbee237f3a89f1fe50f092e4b43c1dd6ac5 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com> | ||
Date: Thu, 3 Sep 2020 16:00:07 +0300 | ||
Subject: [PATCH] ash: Load $ENV file also if $SSH_CLIENT/SSH2_CLIENT is preset | ||
in env | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
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@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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters