Repository navigation
fix(backup): reject --keep 0 - #139
Merged
Merged
Conversation
With --keep 0, prune ran tail -n +1 over the newest-first listing and deleted every dump, including the one written seconds earlier, then reported success. The check also rejects leading zeros, which the $((KEEP + 1)) arithmetic would parse as octal (08 and 09 abort the script after the dump).
Merged
usinfosec
pushed a commit
to usinfosec/ARTEX
that referenced
this pull request
Nov 17, 2026
合并 codex/approval-record-filters,解决与 BaaRai#133 在 web/src/components/approval-records.tsx 的冲突: - 导入同时保留 InterceptApprovalFilter 与 InterceptPending。 - load() 采用 BaaRai#133 的独立待审批队列(Promise.allSettled 拉取 /intercept/pending),并把 BaaRai#139 的 filter 参数透传给历史分页调用; 筛选只作用于历史记录,待处理队列不受 filter 影响,保证跨页/被筛 记录仍可审批。 - decide() 保留 BaaRai#133 的乐观更新(移除 pendingRows 对应项)叠加 BaaRai#139 决策后重新拉取以对齐筛选后的计数与行。 验证:前端 tsc 通过、Biome 仅剩预存告警;go build/vet 通过; db TestInterceptApprovalFilters(8 子用例)与 server TestInterceptFilterHTTP 在本地 dev 库均通过。 Closes BaaRai#139
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
scripts/backup.sh --keep 0passed validation (the check only rejected non-digits), thenprunerantail -n +1over the newest-first listing and deleted every dump, including the one written seconds earlier, and still printedbackup complete.Fix
The
--keepcheck now also rejects values starting with0. That covers0and also leading zeros such as08, which$((KEEP + 1))would read as octal and abort on after the dump was already written.Verification
bash -n scripts/backup.sh: OK.scripts/backup.sh --keep <v>for0,00,07,-1,abc: exit 2 with the usage message, before any docker command runs.casepattern run on its own:1,14,100are accepted;0,08are rejected.Not verified:
--keep. It needs the compose stack, and I did not run it against the live one.