[ldns-users] ldns patch for ldns-verify-zone to take a time offset

Paul Wouters paul at xelerance.com
Tue Nov 1 22:51:16 UTC 2011


On Tue, 1 Nov 2011, Willem Toorop wrote:

> I faced the same problem when implementing a way to be able to specify
> how things should be converted to string; The output formats. You either
> have to do what you did (however with different function names so we
> don't break the API) or use a cover channel (carry the check_time in the
> rrsigs, or in the keys) but that is too weird, or use a global (
> 	void dns_set_time_func(time_t (*time_func)(time_t *))

I thought about those, but did not see an easy fix, as the call chain was
pretty long it would be duplicating way too many functions.

> and maybe also
> 	time_t (*ldns_get_time_func())(time_t *)
> ). But globals are considered bad practise and also issues with thread
> safety arise.

I've seen some icky gpg library issue arise out of those, please avoid :)

> I am not sure what to do. Similar needs might arise in the future. A
> global modifiable configuration for ldns would be convenient. On the
> other hand, the API currently does not use (configurable) globals. It
> would be more in the style of the current API to pass the check_time
> down. It would also make explicit which functions eventually test
> against "current" time.

Another more compatible, less invasive method might be to allow setting
an TIME_OFFSET env variable? That way we would not need to pass the offset
around all functions.

It won't be as nice as an option to ldns-verify-zone, but it would give
me something I can live with for now. And I do kinda need the option, but
I want to avoid needing to maintain a privately butchered ldns :P

Paul



More information about the ldns-users mailing list