From 8b3ba47a11122cb3d101d10e2fafd6b093d0189a Mon Sep 17 00:00:00 2001 From: Chuang Zhu Date: Tue, 11 Oct 2022 22:19:16 +0800 Subject: [PATCH] proxychains{,-ng}: swap priority 4 and 5 in get_config_path --- .../networking/proxychains-ng/default.nix | 2 ++ ...-priority-4-and-5-in-get_config_path.patch | 25 +++++++++++++++++++ pkgs/tools/networking/proxychains/default.nix | 5 ++++ ...-priority-4-and-5-in-get_config_path.patch | 25 +++++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 pkgs/tools/networking/proxychains-ng/swap-priority-4-and-5-in-get_config_path.patch create mode 100644 pkgs/tools/networking/proxychains/swap-priority-4-and-5-in-get_config_path.patch diff --git a/pkgs/tools/networking/proxychains-ng/default.nix b/pkgs/tools/networking/proxychains-ng/default.nix index 12b3932b8f9..b94dcaf9518 100644 --- a/pkgs/tools/networking/proxychains-ng/default.nix +++ b/pkgs/tools/networking/proxychains-ng/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { url = "https://github.com/rofl0r/proxychains-ng/commit/9b42da71f4df7b783cf07a58ffa095e293c43380.patch"; sha256 = "sha256-tYv9XP51WtsjaoklwQk3D/MQceoOvtdMwBraECt6AXQ="; }) + # https://github.com/NixOS/nixpkgs/issues/136093 + ./swap-priority-4-and-5-in-get_config_path.patch ]; installFlags = [ diff --git a/pkgs/tools/networking/proxychains-ng/swap-priority-4-and-5-in-get_config_path.patch b/pkgs/tools/networking/proxychains-ng/swap-priority-4-and-5-in-get_config_path.patch new file mode 100644 index 00000000000..05d5546e674 --- /dev/null +++ b/pkgs/tools/networking/proxychains-ng/swap-priority-4-and-5-in-get_config_path.patch @@ -0,0 +1,25 @@ +diff --git a/src/common.c b/src/common.c +index 1da1c45..fb68ada 100644 +--- a/src/common.c ++++ b/src/common.c +@@ -113,13 +113,13 @@ char *get_config_path(char* default_path, char* pbuf, size_t bufsize) { + if(check_path(path)) + goto have; + +- // priority 4: $SYSCONFDIR/proxychains.conf +- path = SYSCONFDIR "/" PROXYCHAINS_CONF_FILE; ++ // priority 4: /etc/proxychains.conf ++ path = "/etc/" PROXYCHAINS_CONF_FILE; + if(check_path(path)) + goto have; + +- // priority 5: /etc/proxychains.conf +- path = "/etc/" PROXYCHAINS_CONF_FILE; ++ // priority 5: $SYSCONFDIR/proxychains.conf ++ path = SYSCONFDIR "/" PROXYCHAINS_CONF_FILE; + if(check_path(path)) + goto have; + +-- +2.37.2 + diff --git a/pkgs/tools/networking/proxychains/default.nix b/pkgs/tools/networking/proxychains/default.nix index df692f372c8..5cfb6f88f0d 100644 --- a/pkgs/tools/networking/proxychains/default.nix +++ b/pkgs/tools/networking/proxychains/default.nix @@ -14,6 +14,11 @@ stdenv.mkDerivation rec { sha256 = "083xdg6fsn8c2ns93lvy794rixxq8va6jdf99w1z0xi4j7f1nyjw"; }; + patches = [ + # https://github.com/NixOS/nixpkgs/issues/136093 + ./swap-priority-4-and-5-in-get_config_path.patch + ]; + postPatch = '' # Suppress compiler warning. Remove it when upstream fix arrives substituteInPlace Makefile --replace "-Werror" "-Werror -Wno-stringop-truncation" diff --git a/pkgs/tools/networking/proxychains/swap-priority-4-and-5-in-get_config_path.patch b/pkgs/tools/networking/proxychains/swap-priority-4-and-5-in-get_config_path.patch new file mode 100644 index 00000000000..dd2c3031184 --- /dev/null +++ b/pkgs/tools/networking/proxychains/swap-priority-4-and-5-in-get_config_path.patch @@ -0,0 +1,25 @@ +diff --git a/src/common.c b/src/common.c +index 1ca612a..7c21377 100644 +--- a/src/common.c ++++ b/src/common.c +@@ -37,13 +37,13 @@ char *get_config_path(char* default_path, char* pbuf, size_t bufsize) { + if(check_path(path)) + return path; + +- // priority 4: $SYSCONFDIR/proxychains.conf +- path = SYSCONFDIR "/" PROXYCHAINS_CONF_FILE; ++ // priority 4: /etc/proxychains.conf ++ path = "/etc/" PROXYCHAINS_CONF_FILE; + if(check_path(path)) + return path; + +- // priority 5: /etc/proxychains.conf +- path = "/etc/" PROXYCHAINS_CONF_FILE; ++ // priority 5: $SYSCONFDIR/proxychains.conf ++ path = SYSCONFDIR "/" PROXYCHAINS_CONF_FILE; + if(check_path(path)) + return path; + +-- +2.37.2 +