proxychains{,-ng}: swap priority 4 and 5 in get_config_path

This commit is contained in:
Chuang Zhu 2022-10-11 22:19:16 +08:00 committed by GitHub
parent 33bc904dff
commit 8b3ba47a11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 0 deletions

View file

@ -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 = [

View file

@ -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

View file

@ -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"

View file

@ -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