Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Strongswan: preserve PATH

+41
+2
pkgs/tools/networking/strongswan/default.nix
··· 13 buildInputs = [ gmp pkgconfig python autoreconfHook ]; 14 15 patches = [ 16 ./firewall_defaults.patch 17 ]; 18 19 configureFlags = [ "--enable-swanctl" "--enable-cmd" ];
··· 13 buildInputs = [ gmp pkgconfig python autoreconfHook ]; 14 15 patches = [ 16 + ./ext_auth-path.patch 17 ./firewall_defaults.patch 18 + ./updown-path.patch 19 ]; 20 21 configureFlags = [ "--enable-swanctl" "--enable-cmd" ];
+13
pkgs/tools/networking/strongswan/ext_auth-path.patch
···
··· 1 + Index: strongswan-5.2.1/src/libcharon/plugins/ext_auth/ext_auth_listener.c 2 + =================================================================== 3 + --- strongswan-5.2.1.orig/src/libcharon/plugins/ext_auth/ext_auth_listener.c 4 + +++ strongswan-5.2.1/src/libcharon/plugins/ext_auth/ext_auth_listener.c 5 + @@ -101,6 +101,8 @@ METHOD(listener_t, authorize, bool, 6 + 7 + *success = FALSE; 8 + 9 + + push_env(envp, countof(envp), "PATH=%s", getenv("PATH")); 10 + + 11 + push_env(envp, countof(envp), "IKE_UNIQUE_ID=%u", 12 + ike_sa->get_unique_id(ike_sa)); 13 + push_env(envp, countof(envp), "IKE_NAME=%s",
+26
pkgs/tools/networking/strongswan/updown-path.patch
···
··· 1 + Index: strongswan-5.2.1/src/_updown/_updown.in 2 + =================================================================== 3 + --- strongswan-5.2.1.orig/src/_updown/_updown.in 4 + +++ strongswan-5.2.1/src/_updown/_updown.in 5 + @@ -125,7 +125,7 @@ 6 + # 7 + 8 + # define a minimum PATH environment in case it is not set 9 + -PATH="/sbin:/bin:/usr/sbin:/usr/bin:@sbindir@" 10 + +PATH="${PATH:-/sbin:/bin:/usr/sbin:/usr/bin}" 11 + export PATH 12 + 13 + # uncomment to log VPN connections 14 + Index: strongswan-5.2.1/src/libcharon/plugins/updown/updown_listener.c 15 + =================================================================== 16 + --- strongswan-5.2.1.orig/src/libcharon/plugins/updown/updown_listener.c 17 + +++ strongswan-5.2.1/src/libcharon/plugins/updown/updown_listener.c 18 + @@ -240,6 +240,8 @@ static void invoke_once(private_updown_l 19 + process_t *process; 20 + char *envp[128] = {}; 21 + 22 + + push_env(envp, countof(envp), "PATH=%s", getenv("PATH")); 23 + + 24 + me = ike_sa->get_my_host(ike_sa); 25 + other = ike_sa->get_other_host(ike_sa); 26 +