fix(cosh-ng): accept quoted dev null as sink - #2710
Conversation
|
PR number: #2710 Findings
结构评审结论未发现 blocking package/module/public API 组织问题。逐项核对:
安全语义复核(非 blocking)本 PR 收窄 fail-closed 规则(整词带引号的 剩余风险
未跑验证按评审约束未执行任何工具与构建命令; |
9bf29dc to
7c77cb7
Compare
|
Both findings addressed in 7c77cb7 (single commit, force-pushed): P1 (CI vs body) — two distinct failures, both explained:
The quoted-sink behavior itself is unchanged; full ECS re-verification on the amended commit is green (fmt/clippy clean, P2 (parser line-count registration) — Deferred with data: |
|
PR number: #2710 Findings
结构评审结论未发现 blocking package/module/public API 组织问题。逐项核对:
上轮 findings 复核
安全语义复核(非 blocking)收窄 fail-closed 规则的方向保守:开引号须紧邻重定向目标位置、内容逐字节等于 allowlist 条目、闭引号后必须为词边界(刻意排除 剩余风险
未跑验证按评审约束未执行任何工具; |
A quoted redirect target like 2>"/dev/null" was classified as a filesystem write instead of a null sink, so the approval card showed redirection-write. Recognize fully quoted SAFE_OUTPUT_SINKS targets as null redirections; every other quoted form stays fail-closed. The auto-approve policy itself is unchanged and remains a separate discussion. Refs #1752 Assisted-by: Qoder Signed-off-by: Jiangtian Feng <jiangtianf97@163.com>
7c77cb7 to
26035a8
Compare
Why
A quoted redirect target such as
2>"/dev/null"was classified as a filesystem write (redirection-write) instead of a null sink, so the approval card showed a misleading reason even though the unquoted form was already classified correctly (#1667).What changed
SAFE_OUTPUT_SINKStargets are now recognized as null redirections.apply_null_redirection_policystill resolves toAskUser— noted in a code comment. Layer 2 (auto-approving null redirections) is intentionally out of scope and remains a separate discussion.Related issue
Refs #1752 (not closing): this PR only fixes the Layer 1 misclassification; the issue's full auto-approve request is not resolved here.
User / Agent impact
The approval-card reason/impact for quoted null redirections now reads as a null redirection instead of redirection-write, aligning with the unquoted behavior from #1667. The execution decision (AskUser) is unchanged.
Risk and compatibility
Execution decision is identical before and after (AskUser); only the approval-card reason/impact changes. Low risk.
Validation
cargo fmtandclippyclean with zero warnings.Documentation and rollback
Single commit — revert it directly.