diff options
author | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2011-04-25 14:40:10 +0000 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2011-04-25 14:40:10 +0000 |
commit | e1a78aa1a0d9caf2727810c5796517dc75a0bf1e (patch) | |
tree | 5b100fb36859f78bc3de5631438c7758bcc2fbea | |
parent | d7325f69ddd11b569053f1373f9e3eb471b79d18 (diff) | |
download | nixlib-e1a78aa1a0d9caf2727810c5796517dc75a0bf1e.tar nixlib-e1a78aa1a0d9caf2727810c5796517dc75a0bf1e.tar.gz nixlib-e1a78aa1a0d9caf2727810c5796517dc75a0bf1e.tar.bz2 nixlib-e1a78aa1a0d9caf2727810c5796517dc75a0bf1e.tar.lz nixlib-e1a78aa1a0d9caf2727810c5796517dc75a0bf1e.tar.xz nixlib-e1a78aa1a0d9caf2727810c5796517dc75a0bf1e.tar.zst nixlib-e1a78aa1a0d9caf2727810c5796517dc75a0bf1e.zip |
Making dropbear sessions inherit the PATH
svn path=/nixpkgs/trunk/; revision=26967
-rw-r--r-- | pkgs/tools/networking/dropbear/default.nix | 6 | ||||
-rw-r--r-- | pkgs/tools/networking/dropbear/pass-path.patch | 15 |
2 files changed, 21 insertions, 0 deletions
diff --git a/pkgs/tools/networking/dropbear/default.nix b/pkgs/tools/networking/dropbear/default.nix index 986c9806591a..836778673e1a 100644 --- a/pkgs/tools/networking/dropbear/default.nix +++ b/pkgs/tools/networking/dropbear/default.nix @@ -12,6 +12,12 @@ stdenv.mkDerivation rec { configureFlags = stdenv.lib.optional enableStatic "LDFLAGS=-static"; + patches = [ + # Allow sessions to inherit the PATH from the parent dropbear. + # Otherwise they only get the usual /bin:/usr/bin kind of PATH + ./pass-path.patch + ]; + buildInputs = [ zlib ]; meta = { diff --git a/pkgs/tools/networking/dropbear/pass-path.patch b/pkgs/tools/networking/dropbear/pass-path.patch new file mode 100644 index 000000000000..d664b00de350 --- /dev/null +++ b/pkgs/tools/networking/dropbear/pass-path.patch @@ -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); + } |