Skip to content

Commit

Permalink
Force user to confirm edit-zone on secondaries.
Browse files Browse the repository at this point in the history
Fix #11392
  • Loading branch information
miodvallat committed Feb 7, 2025
1 parent 8067395 commit be1bf8d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pdns/pdnsutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,23 @@ static int editZone(const DNSName &zone, const PDNSColors& col) {
return EXIT_FAILURE;
}

if (di.isSecondaryType()) {
cout << "Zone '" << zone << "' is not a primary zone." << endl;
while (true) {
cout << "Edit the zone anyway? (N/y) " << std::flush;
int resp = read1char();
if (resp != '\n') {
cout << endl;
}
if (resp == 'y' || resp == 'Y') {
break;
}
if (resp == 'n' || resp == 'N' || resp == '\n') {
return EXIT_FAILURE;
}
}
}

/* ensure that the temporary file will only
be accessible by the current user, not even
by other users in the same group, and certainly
Expand Down

0 comments on commit be1bf8d

Please sign in to comment.