mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-24 20:02:58 +03:00
Strongswan: preserve PATH
This commit is contained in:
parent
2b91b9b594
commit
17d8029150
@ -13,7 +13,9 @@ stdenv.mkDerivation rec {
|
||||
buildInputs = [ gmp pkgconfig python autoreconfHook ];
|
||||
|
||||
patches = [
|
||||
./ext_auth-path.patch
|
||||
./firewall_defaults.patch
|
||||
./updown-path.patch
|
||||
];
|
||||
|
||||
configureFlags = [ "--enable-swanctl" "--enable-cmd" ];
|
||||
|
13
pkgs/tools/networking/strongswan/ext_auth-path.patch
Normal file
13
pkgs/tools/networking/strongswan/ext_auth-path.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: strongswan-5.2.1/src/libcharon/plugins/ext_auth/ext_auth_listener.c
|
||||
===================================================================
|
||||
--- strongswan-5.2.1.orig/src/libcharon/plugins/ext_auth/ext_auth_listener.c
|
||||
+++ strongswan-5.2.1/src/libcharon/plugins/ext_auth/ext_auth_listener.c
|
||||
@@ -101,6 +101,8 @@ METHOD(listener_t, authorize, bool,
|
||||
|
||||
*success = FALSE;
|
||||
|
||||
+ push_env(envp, countof(envp), "PATH=%s", getenv("PATH"));
|
||||
+
|
||||
push_env(envp, countof(envp), "IKE_UNIQUE_ID=%u",
|
||||
ike_sa->get_unique_id(ike_sa));
|
||||
push_env(envp, countof(envp), "IKE_NAME=%s",
|
26
pkgs/tools/networking/strongswan/updown-path.patch
Normal file
26
pkgs/tools/networking/strongswan/updown-path.patch
Normal file
@ -0,0 +1,26 @@
|
||||
Index: strongswan-5.2.1/src/_updown/_updown.in
|
||||
===================================================================
|
||||
--- strongswan-5.2.1.orig/src/_updown/_updown.in
|
||||
+++ strongswan-5.2.1/src/_updown/_updown.in
|
||||
@@ -125,7 +125,7 @@
|
||||
#
|
||||
|
||||
# define a minimum PATH environment in case it is not set
|
||||
-PATH="/sbin:/bin:/usr/sbin:/usr/bin:@sbindir@"
|
||||
+PATH="${PATH:-/sbin:/bin:/usr/sbin:/usr/bin}"
|
||||
export PATH
|
||||
|
||||
# uncomment to log VPN connections
|
||||
Index: strongswan-5.2.1/src/libcharon/plugins/updown/updown_listener.c
|
||||
===================================================================
|
||||
--- strongswan-5.2.1.orig/src/libcharon/plugins/updown/updown_listener.c
|
||||
+++ strongswan-5.2.1/src/libcharon/plugins/updown/updown_listener.c
|
||||
@@ -240,6 +240,8 @@ static void invoke_once(private_updown_l
|
||||
process_t *process;
|
||||
char *envp[128] = {};
|
||||
|
||||
+ push_env(envp, countof(envp), "PATH=%s", getenv("PATH"));
|
||||
+
|
||||
me = ike_sa->get_my_host(ike_sa);
|
||||
other = ike_sa->get_other_host(ike_sa);
|
||||
|
Loading…
Reference in New Issue
Block a user