Bug 175 - tzset() should be called before chroot
tzset() should be called before chroot
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
unspecified
Other All
: P2 normal
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-22 10:52 CEST by Jakob Schlyter
Modified: 2008-05-22 11:15 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakob Schlyter 2008-05-22 10:52:39 CEST
tzset() should be called before chroot or syslog will have the wrong timestamps.

--- daemon/unbound.c.orig       Thu May 22 10:41:08 2008
+++ daemon/unbound.c    Thu May 22 10:42:40 2008
@@ -376,6 +376,8 @@ run_daemon(char* cfgfile, int cmdline_verbose, int deb
        struct daemon* daemon = NULL;
        int done_chroot = 0;
 
+       tzset();
+
        if(!(daemon = daemon_init()))
                fatal_exit("alloc failure");
        while(!daemon->need_to_exit) {
Comment 1 Wouter Wijngaards 2008-05-22 11:15:29 CEST
Patched it up (with a configure detection portability safeguard).

Thanks, Jakob!