-diff's removed-name budget ignores the names the -ptr pass tested
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- cli, networking
Hướng nghiên cứu
Đọc internal/cli/diff.go để theo dõi ngân sách tên đã bị xóa, sau đó kiểm tra internal/output/summary.go, internal/cli/summary.go và internal/report/ptr.go để tìm nơi ghi lại số lượt quét PTR. Thêm số lượt PTR vào phép tính ngân sách cho từng mục tiêu và kiểm thử một lần chạy có đủ cả ba lượt. Chạy go test ./internal/cli/ và xác nhận việc kiểm tra tên đã bị xóa vẫn nằm trong giới hạn -max-queries.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
-diff's check of removed names spends what is left of -max-queries per target. It subtracts the names the main pass and the -permute pass tested, but not the names the -ptr pass tested, because the report has no count of them. A run with -ptr can therefore test more names than -max-queries allows.
Where
internal/cli/diff.go(the budget:left -= t.Processed, andt.Permutation.Processed)internal/output/summary.go(TargetSummary:PTRNamescounts the names to be tested, not the ones that were)
Details
left := int64(s.f.maxQueries) * int64(len(summary.Targets))
for _, t := range summary.Targets {
left -= t.Processed
if t.Permutation != nil {
left -= t.Permutation.Processed
}
}
Since #478, -max-queries is one budget for a target's passes. The PTR pass's scan is one of them, and its tested names are missing here.
Impact
With -diff -ptr -max-queries N, the removed-name check can look up as many names again as the PTR pass tested, on top of the budget. The overshoot is small (PTR passes test few names), and affects only runs where the previous results had names this run did not find.
Steps to reproduce
- Run a scan with
-ptr -max-queries 3whose main pass tests 1 name and whose PTR pass tests 2, with-diffagainst a previous run that had two more names. - The removed-name check looks up both, for 5 names tested under a budget of 3.
Suggested fix
Record how many names the PTR pass's scan tested (a ptr_processed field next to ptr_names, or the pass's Processed kept on the session) and subtract it in the -diff budget. Add a test with all three passes.
Acceptance criteria
- The removed-name check's budget is
-max-queriesper target less the names every pass tested. - A test covers a run with
-ptr.
Getting started
- Relevant files:
internal/cli/diff.go,internal/cli/summary.go,internal/report/ptr.go - How to run tests:
go test ./internal/cli/ - Related: #478, #276
Filed by repo-audit/fix-issues at b8afd4d. Severity: low. Effort: S. audit-key: bug|internal/cli/diff.go|removed-name budget
- Ngôn ngữ chính
- Go
- Star
- 1
- Fork
- 1
- Merge trung bình
- 10 giờ
- Pull request đã merge (30 ngày)
- 26
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/subenum
-
area: tui bug good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
TMHSDigital/subenum#494 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
security
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
TMHSDigital/subenum#453 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted severity: low
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 57/100
TMHSDigital/subenum#489 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: dns enhancement severity: medium
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
TMHSDigital/subenum#477 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
TMHSDigital/subenum#457 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TMHSDigital/subenum
Issue tương tự
-
good first issue tools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Edwin-metcalf/MetCode#76 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
deskclose human-decided leaves the legacy decision-needed label and applies no human-decidedĐang mởbug effort:s impact:med raised-by:worker risk:low to:worker
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
medici-finance/assay#8120 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
factory:subtask
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
reportedBy/community
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openchoreo/openchoreo#5751 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
agent-substrate/substrate#4308 ·
Maintainer thường phản hồi trong vòng 2 ngày