-diff's removed-name budget ignores the names the -ptr pass tested
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- go
- Área
- cli, networking
Línea de trabajo
Lee internal/cli/diff.go para rastrear el presupuesto de nombres eliminados y luego inspecciona internal/output/summary.go, internal/cli/summary.go y internal/report/ptr.go para encontrar dónde se registran los recuentos de escaneos PTR. Añade el recuento PTR al cálculo del presupuesto por objetivo y cubre en una prueba una ejecución con las tres pasadas. Ejecuta go test ./internal/cli/ y confirma que la comprobación de nombres eliminados se mantiene dentro de -max-queries.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Go
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 10 h
- PR fusionados (30 d)
- 26
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TMHSDigital/subenum
-
area: tui bug good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
TMHSDigital/subenum#494 ·
Los mantenedores suelen responder en 1 día
-
security
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
TMHSDigital/subenum#453 ·
Los mantenedores suelen responder en 1 día
-
enhancement help wanted severity: low
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
TMHSDigital/subenum#489 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area: dns enhancement severity: medium
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
TMHSDigital/subenum#477 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
security
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
TMHSDigital/subenum#457 ·
Los mantenedores suelen responder en 1 día
Todos los issues de TMHSDigital/subenum
Issues similares
-
good first issue tools
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
Edwin-metcalf/MetCode#76 ·
Los mantenedores suelen responder en 1 día
-
deskclose human-decided leaves the legacy decision-needed label and applies no human-decidedAbiertobug effort:s impact:med raised-by:worker risk:low to:worker
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
medici-finance/assay#8120 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
factory:subtask
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
reportedBy/community
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openchoreo/openchoreo#5751 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
agent-substrate/substrate#4308 ·
Los mantenedores suelen responder en 2 días