From 5045c131535ec941f79483a08a46994ff9aebbc6 Mon Sep 17 00:00:00 2001 From: FUFSoB Date: Sun, 11 Oct 2026 21:14:04 +0500 Subject: [PATCH] fix: chained proxy bug --- modules/proxy-suite/service/script-blocks/outbounds.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/proxy-suite/service/script-blocks/outbounds.nix b/modules/proxy-suite/service/script-blocks/outbounds.nix index 23d9383..240ec4b 100644 --- a/modules/proxy-suite/service/script-blocks/outbounds.nix +++ b/modules/proxy-suite/service/script-blocks/outbounds.nix @@ -305,7 +305,9 @@ let } # $1 kind, $2 the outbound: whether its backend takes it, as one it refuses would fail - # the whole start. Alone (its references dropped), as the service user, from stdin. + # the whole start. Alone (its references dropped), as the service user, from stdin: + # read off fd 0 ("stdin", "stdin:"), as reopening /dev/stdin - root's 0600 pipe - is + # denied to the service user. _proxy_suite_check_json_outbound() { local kind="$1" ob="$2" as=() [ "$(${pkgs.coreutils}/bin/id -u)" = 0 ] && as=(${constants.runAsServiceUser pkgs [ ]}) @@ -313,7 +315,7 @@ let ${lib.optionalString (singBoxBin != null) '' sing-box) ${jq} -c '{outbounds: [del(.detour, .domain_resolver) | select(.type != "selector" and .type != "urltest")]}' <<< "$ob" \ - | "''${as[@]}" ${singBoxBin} check -c /dev/stdin >/dev/null 2>&1 + | "''${as[@]}" ${singBoxBin} check -c stdin >/dev/null 2>&1 ;; ''} ${lib.optionalString (xrayBin != null) ''