pdnsutil: non-interactive zone edit#17567
Open
miodvallat wants to merge 1 commit into
Open
Conversation
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>
Coverage Report for CI Build 27417067017Coverage increased (+11.4%) to 71.06%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions21658 previously-covered lines in 291 files lost coverage.
Coverage Stats💛 - Coveralls |
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.
Short description
Somewhat recent changes in
pdnsutilcaused thezone editcommand to refuse to do anything if the standard input is not a terminal.Some users have rightly complained that, by making
EDITORpoint to an ad hoc script (e.g.EDITOR="sed -i s,\<$OLDTTL\>,$NEWTTL,") one may be able toshoot oneself in the footperform zone modifications, without needing an interactive editor.This PR makes
pdnsutil zone editaccept 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-serialfor that purpose.Checklist
I have: