-diff's removed-name budget ignores the names the -ptr pass tested
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- cli, networking
Direzione di ricerca
Leggi internal/cli/diff.go per ricostruire il budget dei nomi rimossi, poi esamina internal/output/summary.go, internal/cli/summary.go e internal/report/ptr.go per trovare dove vengono registrati i conteggi delle scansioni PTR. Aggiungi il conteggio PTR al calcolo del budget per destinazione e verifica con un test un'esecuzione con tutti e tre i passaggi. Esegui go test ./internal/cli/ e conferma che il controllo dei nomi rimossi resti entro -max-queries.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Go
- Stelle
- 1
- Fork
- 1
- Merge medio
- 10h
- PR unite (30g)
- 26
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TMHSDigital/subenum
-
area: tui bug good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
TMHSDigital/subenum#494 ·
I maintainer di solito rispondono entro 1 giorno
-
security
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
TMHSDigital/subenum#453 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement help wanted severity: low
Difficoltà 4/5 3-5 giorni Idoneità per principianti 57/100
TMHSDigital/subenum#489 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: dns enhancement severity: medium
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
TMHSDigital/subenum#477 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
security
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
TMHSDigital/subenum#457 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TMHSDigital/subenum
Issue simili
-
good first issue tools
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
Edwin-metcalf/MetCode#76 ·
I maintainer di solito rispondono entro 1 giorno
-
bug effort:s impact:med raised-by:worker risk:low to:worker
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
medici-finance/assay#8120 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
factory:subtask
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
reportedBy/community
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
openchoreo/openchoreo#5751 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
agent-substrate/substrate#4308 ·
I maintainer di solito rispondono entro 2 giorni