Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth: do additional processing for NAPTR #12966

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/tinydnsbackend/data
Original file line number Diff line number Diff line change
Expand Up @@ -20187,7 +20187,7 @@ Zexample.com:ns1.example.com.:ahu.example.com.:2847484148:28800:7200:604800:8640
:_underscore.test.com:16:\030underscores\040are\040terrible:3600
:aland.test.com:16:\016\303\205LAND\040ISLANDS:3600
:d.test.com:39:\002d2\005test2\003com\000:3600
:enum.test.com:35:\000d\0002\001u\007e2u\053sip\000\010testuser\006domain\003com\000:3600
:enum.test.com:35:\000d\0002\001u\007e2u\053sip\000\007server1\004test\003com\000:3600
:hightxt.test.com:16:\042v\075spf1\040mx\040ip4\07278.46.192.210\040\342\200\223all:3600
:hightxt.test.com:99:\042v\075spf1\040mx\040ip4\07278.46.192.210\040\342\200\223all:3600
:interrupted-rrset.test.com:16:\023check\040AXFR\040signpipe:3600
Expand Down
Binary file modified modules/tinydnsbackend/data.cdb
Binary file not shown.
1 change: 0 additions & 1 deletion pdns/dnsrecords.hh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public:
{
return d_replacement;
}
private:
uint16_t d_order, d_preference;
string d_flags, d_services, d_regexp;
DNSName d_replacement;
Expand Down
12 changes: 12 additions & 0 deletions pdns/packethandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "misc.hh"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand Down Expand Up @@ -517,6 +518,17 @@ void PacketHandler::doAdditionalProcessing(DNSPacket& p, std::unique_ptr<DNSPack
case QType::SRV:
content=getRR<SRVRecordContent>(rr.dr)->d_target;
break;
case QType::NAPTR: {
auto naptrcontent = getRR<NAPTRRecordContent>(rr.dr);
auto flags = naptrcontent->getFlags();
toLowerInPlace(flags);
if (flags.find('a') != string::npos) {
content = naptrcontent->d_replacement;
} else {
content.clear();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continue; ?

}
break;
}
case QType::SVCB: /* fall-through */
case QType::HTTPS: {
auto rrc = getRR<SVCBBaseRecordContent>(rr.dr);
Expand Down
2 changes: 1 addition & 1 deletion regression-tests/zones/test.com
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ server1 IN A 1.2.3.4
*.test IN CNAME server1
www.test IN A 4.3.2.1
sub.test IN NS ns-test.example.net
enum IN NAPTR 100 50 "u" "e2u+sip" "" testuser.domain.com.
enum IN NAPTR 100 50 "u" "e2u+sip" "" server1.test.com.
counter IN A 1.1.1.5
_ldap._tcp.dc IN SRV 0 100 389 server2.example.net.
_double._tcp.dc IN SRV 0 100 389 server1
Expand Down