From 2f113ee90a8c97be2ccb70dc6738fe243dde1b84 Mon Sep 17 00:00:00 2001 From: Parnell Springmeyer Date: Sun, 29 Jan 2017 01:08:36 -0600 Subject: [PATCH] setcap-wrapper: Minor refactor --- nixos/modules/security/wrappers/default.nix | 2 +- .../security/wrappers/{permissions-wrapper.c => wrapper.c} | 0 .../sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename nixos/modules/security/wrappers/{permissions-wrapper.c => wrapper.c} (100%) diff --git a/nixos/modules/security/wrappers/default.nix b/nixos/modules/security/wrappers/default.nix index 69b62d7b2ff2..4d51796b676c 100644 --- a/nixos/modules/security/wrappers/default.nix +++ b/nixos/modules/security/wrappers/default.nix @@ -12,7 +12,7 @@ let fi gcc -Wall -O2 -DSOURCE_PROG=\"$source\" -DWRAPPER_DIR=\"${config.security.wrapperDir}\" \ - -lcap-ng -lcap ${./permissions-wrapper.c} -o $out/bin/${program}.wrapper -L ${pkgs.libcap.lib}/lib -L ${pkgs.libcap_ng}/lib \ + -lcap-ng -lcap ${./wrapper.c} -o $out/bin/${program}.wrapper -L ${pkgs.libcap.lib}/lib -L ${pkgs.libcap_ng}/lib \ -I ${pkgs.libcap.dev}/include -I ${pkgs.libcap_ng}/include -I ${pkgs.linuxHeaders}/include ''; diff --git a/nixos/modules/security/wrappers/permissions-wrapper.c b/nixos/modules/security/wrappers/wrapper.c similarity index 100% rename from nixos/modules/security/wrappers/permissions-wrapper.c rename to nixos/modules/security/wrappers/wrapper.c diff --git a/pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch b/pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch index 3d38cf3b604d..549da5436e60 100644 --- a/pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch +++ b/pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch @@ -4,7 +4,7 @@ Date: Thu, 26 Nov 2015 21:03:35 +0100 Subject: [PATCH] Lookup dumpcap in PATH NixOS patch: Look for dumpcap in PATH first, because there may be a -dumpcap permissions-wrapper that we want to use instead of the default +dumpcap wrapper that we want to use instead of the default non-setuid dumpcap binary. Also change execv() to execvp() because we've set argv[0] to "dumpcap" @@ -27,7 +27,7 @@ index 970688e..49914d5 100644 - exename = g_strdup_printf("%s/dumpcap", progfile_dir); + /* + * NixOS patch: Look for dumpcap in PATH first, because there may be a -+ * dumpcap permissions-wrapper that we want to use instead of the default ++ * dumpcap wrapper that we want to use instead of the default + * non-setuid dumpcap binary. + */ + if (system("command -v dumpcap >/dev/null") == 0) {