Skip to content

Commit

Permalink
pdnsutil {add-record,delete-rrset}: Don't append ZONE if NAME ends wi…
Browse files Browse the repository at this point in the history
…th .

If a NAME ends with a . it is to be understood as an absolute name and
appending the zone is not intuitive then.

Closes: #8595
  • Loading branch information
ukleinek committed Dec 17, 2024
1 parent fe75d35 commit 0429faf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pdns/pdnsutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,8 @@ static int addOrReplaceRecord(bool addOrReplace, const vector<string>& cmds) {
DNSName name;
if (cmds.at(2) == "@")
name=zone;
else if (boost::ends_with(cmds.at(2), "."))

Check warning on line 1602 in pdns/pdnsutil.cc

View workflow job for this annotation

GitHub Actions / Analyze (cpp, auth)

statement should be inside braces (readability-braces-around-statements - Level=Warning)
name = DNSName(cmds.at(2));
else
name = DNSName(cmds.at(2)) + zone;

Expand Down Expand Up @@ -1737,6 +1739,8 @@ static int deleteRRSet(const std::string& zone_, const std::string& name_, const
DNSName name;
if(name_=="@")
name=zone;
else if (boost::ends_with(name_, "."))

Check warning on line 1742 in pdns/pdnsutil.cc

View workflow job for this annotation

GitHub Actions / Analyze (cpp, auth)

statement should be inside braces (readability-braces-around-statements - Level=Warning)
name = DNSName(name_);
else
name=DNSName(name_)+zone;

Expand Down

0 comments on commit 0429faf

Please sign in to comment.