[Pdns-users] Strange time drift in log
Nikolaos Milas
nmilas at admin.noa.gr
Thu Sep 9 09:30:24 UTC 2010
Thanks Christian,
I tried to configure, but it fails:
...
configure: error: ldap library (libldap) not found
But there is libldap:
# find / -name '*libldap*'
/usr/lib/libldap_r-2.3.so.0.2.31
/usr/lib/libldap-2.3.so.0
/usr/lib/libldap_r-2.3.so.0
/usr/lib/libldap-2.3.so.0.2.31
Nick
On 9/9/2010 11:27 ÃÂÃÅ, Christian Hofstaedtler wrote:
> * Christian Hofstaedtler<ch at zeha.at> [100909 09:56]:
>> Nikolas,
>>
>> The LDAP backend does indeed re-set the timezone to UTC.
>> Why this propagates to your syslogd and into your log files, is
>> beyond my imagination right now.
> You could try out the following patch. It is compile-tested only, as
> I don't have a test environment with ldapbackend, but it should
> probably work. What you need to especially test is the autoserial
> feature (might now give wrong timezones or whatnot).
>
> Index: modules/ldapbackend/ldapbackend.cc
> ===================================================================
> --- modules/ldapbackend/ldapbackend.cc (revision 1707)
> +++ modules/ldapbackend/ldapbackend.cc (working copy)
> @@ -22,9 +22,6 @@
> m_default_ttl = arg().asNum( "default-ttl" );
> m_myname = "[LdapBackend]";
>
> - // we need UTC time for timestamps
> - setenv( "TZ", "", 1 ); tzset();
> -
> setArgPrefix( "ldap" + suffix );
>
> m_getdn = false;
> Index: modules/ldapbackend/utils.hh
> ===================================================================
> --- modules/ldapbackend/utils.hh (revision 1707)
> +++ modules/ldapbackend/utils.hh (working copy)
> @@ -3,6 +3,7 @@
> #include<time.h>
> #include<stdlib.h>
> #include<pdns/misc.hh>
> +#include<pdns/utility.hh>
>
>
> #ifndef LDAPBACKEND_UTILS_HH
> @@ -146,7 +147,7 @@
>
> if( tmp != NULL&& *tmp == 0 )
> {
> - return mktime(&tm );
> + return timegm(&tm );
> }
>
> return 0;
>
More information about the Pdns-users
mailing list