Re: testing record start/end times with tinydns-get?

Daryl Tester <[email protected]> Thu, 22 Jul 2010 06:47:35 +0930
Newsgroups gmane.network.djbdns
Message-ID <[email protected]>
(* Reply to /dev/null'd *)

"Charles Cazabon" <[email protected]> wrote:

>> But how do I test my magic?  tinydns-data will happily query the cdb file, but
>> I don't see how to tell it what time to to use (so it gets the proper records
>> and I can test times other than "now") - is this possible?

Paul Jarc wrote:

> You'd have to patch it.  tinydns-get calls respond() from tdlookup.c,
> which uses tai_now() to set the timestamp to search for.  So the
> change would be fairly invasive--tdlookup.c is used by tinydns as
> well.
> 
> Or just run an unpatched tinydns-get from a (virtual) machine with a
> clock set forward. :)

Perhaps if it's a non-production server, do the LD_PRELOAD trick and
fiddle with tinydns' concept of time() and gettimeofday() behind its
back.  At least this restricts the modifications to only that executable.
It would require some C and Unix-fu though (google "fun with ld_preload").

-- 
Regards,
  Daryl Tester

"This is why I sell beer." -- jwz, http://jwz.livejournal.com/1224702.html