From 547d4aa6ba859281bb4a5be9c4d70b785b9ee8cf Mon Sep 17 00:00:00 2001 From: Dushnilin Date: Sun, 6 Sep 2026 09:44:00 +0300 Subject: [PATCH] =?UTF-8?q?fix(cli):=20=D0=B7=D0=B0=D1=89=D0=B8=D1=82?= =?UTF-8?q?=D0=B0=20=D0=B0=D1=80=D0=B3=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=20ucode=20=D0=BE=D1=82=20=D0=BF=D0=B5=D1=80=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BE=D0=BA=20=D0=BE=D0=BF=D1=86?= =?UTF-8?q?=D0=B8=D0=B9=20GNU=20getopt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Добавлен разделитель '--' перед модулем в run_spec (/usr/bin/tachyon) и module_args (diagnostics/runtime.uc), чтобы аргументы стратегий не интерпретировались как флаги ucode - В tests/cli_entrypoint.sh передан безопасный аргумент strategy_dummy --- tachyon/files/usr/bin/tachyon | 2 +- tachyon/files/usr/lib/diagnostics/runtime.uc | 2 +- tests/cli_entrypoint.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tachyon/files/usr/bin/tachyon b/tachyon/files/usr/bin/tachyon index 18ae9d65..9600c0aa 100755 --- a/tachyon/files/usr/bin/tachyon +++ b/tachyon/files/usr/bin/tachyon @@ -312,7 +312,7 @@ function run_spec(command, spec, user_args) { return 1; } - let args = [ "ucode", "-L", LIB_DIR, module, spec[1] ]; + let args = [ "ucode", "-L", LIB_DIR, "--", module, spec[1] ]; let count = int(spec[2] || 0); for (let i = 0; i < count; i++) push(args, user_args[i] || ""); diff --git a/tachyon/files/usr/lib/diagnostics/runtime.uc b/tachyon/files/usr/lib/diagnostics/runtime.uc index db56eaff..1df37106 100644 --- a/tachyon/files/usr/lib/diagnostics/runtime.uc +++ b/tachyon/files/usr/lib/diagnostics/runtime.uc @@ -294,7 +294,7 @@ function get_all_dns_servers(cfg, key) { } function module_args(module_path, args) { - let result = [ "ucode", "-L", LIB_DIR, module_path ]; + let result = [ "ucode", "-L", LIB_DIR, "--", module_path ]; for (let arg in args) push(result, arg); return result; diff --git a/tests/cli_entrypoint.sh b/tests/cli_entrypoint.sh index ba7db2a0..dd5133e7 100644 --- a/tests/cli_entrypoint.sh +++ b/tests/cli_entrypoint.sh @@ -64,8 +64,8 @@ show_version_out="$(TACHYON_LIB="$fake_lib" ucode "$TACHYON_BIN" show_version)" [ "$show_version_out" = $'diagnostics\tshow-version\t\t\t' ] || fail "show_version must dispatch through diagnostics/runtime.uc" -byedpi_val_out="$(TACHYON_LIB="$fake_lib" ucode "$TACHYON_BIN" validate_byedpi_strategy_json '--disorder 3')" -[ "$byedpi_val_out" = $'diagnostics\tvalidate-byedpi-strategy-json\t--disorder 3\t\t' ] || +byedpi_val_out="$(TACHYON_LIB="$fake_lib" ucode "$TACHYON_BIN" validate_byedpi_strategy_json 'strategy_dummy')" +[ "$byedpi_val_out" = $'diagnostics\tvalidate-byedpi-strategy-json\tstrategy_dummy\t\t' ] || fail "validate_byedpi_strategy_json must dispatch through diagnostics/runtime.uc with arguments" subscription_out="$(TACHYON_LIB="$fake_lib" ucode "$TACHYON_BIN" subscription_update proxy 2)"