Skip to content

pdnsutil: non-interactive zone edit#17567

Open
miodvallat wants to merge 1 commit into
PowerDNS:masterfrom
miodvallat:ENOTTY
Open

pdnsutil: non-interactive zone edit#17567
miodvallat wants to merge 1 commit into
PowerDNS:masterfrom
miodvallat:ENOTTY

Conversation

@miodvallat

Copy link
Copy Markdown
Contributor

Short description

Somewhat recent changes in pdnsutil caused the zone edit command to refuse to do anything if the standard input is not a terminal.

Some users have rightly complained that, by making EDITOR point to an ad hoc script (e.g. EDITOR="sed -i s,\<$OLDTTL\>,$NEWTTL,") one may be able to shoot oneself in the foot perform zone modifications, without needing an interactive editor.

This PR makes pdnsutil zone edit accept to work in non-interactive mode, by defaulting all prompts in this case, so that erroneous contents will not be applied.

The serial number of the zone, if left unchanged, will not be modified either; one may use the zone increase-serial for that purpose.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • read and accepted the Developer Certificate of Origin document, including the AI Policy, and added a "Signed-off-by" to my commits
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

In this case, we will trust EDITOR to point to something able to edit
the zone file, and assume "no" to all prompts in case of warnings or errors.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
@coveralls

coveralls commented Jun 12, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27417067017

Coverage increased (+11.4%) to 71.06%

Details

  • Coverage increased (+11.4%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 21658 coverage regressions across 291 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

21658 previously-covered lines in 291 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
pdns/lua-record.cc 809 0.17%
pdns/dnsdistdist/dnsdist-lua.cc 741 52.0%
pdns/recursordist/rec-main.cc 690 65.0%
pdns/recursordist/syncres.cc 585 81.27%
modules/lmdbbackend/lmdbbackend.cc 573 71.94%
pdns/recursordist/rec_channel_rec.cc 563 35.34%
pdns/dnsdistdist/dnsdist.cc 541 68.36%
pdns/auth-main.cc 520 50.03%
pdns/recursordist/ws-recursor.cc 502 22.03%
pdns/tcpiohandler.cc 474 59.89%

Coverage Stats

Coverage Status
Relevant Lines: 171240
Covered Lines: 133369
Line Coverage: 77.88%
Relevant Branches: 81876
Covered Branches: 46496
Branch Coverage: 56.79%
Branches in Coverage %: Yes
Coverage Strength: 5939211.88 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants