Making dropbear sessions inherit the PATH

svn path=/nixpkgs/trunk/; revision=26967
This commit is contained in:
Lluís Batlle i Rossell
2011-04-25 14:40:10 +00:00
parent d7325f69dd
commit e1a78aa1a0
2 changed files with 21 additions and 0 deletions
@@ -0,0 +1,15 @@
Allow sessions to inherit the PATH from the parent dropbear.
diff --git a/svr-chansession.c b/svr-chansession.c
index 23dad8c..9af8e55 100644
--- a/svr-chansession.c
+++ b/svr-chansession.c
@@ -878,7 +878,7 @@ static void execchild(void *user_data) {
addnewvar("LOGNAME", ses.authstate.pw_name);
addnewvar("HOME", ses.authstate.pw_dir);
addnewvar("SHELL", get_user_shell());
- addnewvar("PATH", DEFAULT_PATH);
+ addnewvar("PATH", getenv("PATH"));
if (chansess->term != NULL) {
addnewvar("TERM", chansess->term);
}