Subject: | TSIG::create fails with some filenames |
Net::DNS::RR::create (and its callers, like Net::DNS::Resolver::Base::tsig) fail if a filename is specified with a path containing 'K'.
E.g.
'/foo/bar/DnsKeys/Kinternal_view_key.+157+03117.private'
creates a key name of 'eys/Kinternal_view_key.'
Things go down hill from there.
In Net::DNS::RR::TSIG, around line 342, you need to do something like
} elsif ( $karg =~ /K([^+]+)[+0-9]+\.private$/ ) { # ( keyfile, options )
my $kname = $1;
require File::Basename;
$kname = (File::Basename::fileparse($kname))[0];
$kname =~ /^K([^+]+)$/ or die "Invalid key filename $kname";
$kname = $1;
(on any OS, fileparse()[0] is the filename with any path removed. Don't assume Unix syntax...)
Preferably, something less ugly (sorry, I'm on the trail of something else.)