From: Mark Andrews Date: Wed, 7 Jan 2004 05:48:15 +0000 (+0000) Subject: 1550. [port] Call tzset(), if available, before calling chroot(). X-Git-Tag: v9.2.4rc1~81^2~46 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=6286983c506433d642b23e64845c50be30f2a7f6;p=thirdparty%2Fbind9.git 1550. [port] Call tzset(), if available, before calling chroot(). --- diff --git a/CHANGES b/CHANGES index aec5db02520..e08bcc675c6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +1550. [port] Call tzset(), if available, before calling chroot(). + 1549. [func] named-checkzone can now write out the zone contents in a easily parsable format (-D and -o). diff --git a/acconfig.h b/acconfig.h index 7f99dce83d6..7e6fef6e747 100644 --- a/acconfig.h +++ b/acconfig.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: acconfig.h,v 1.41 2003/07/25 05:08:50 marka Exp $ */ +/* $Id: acconfig.h,v 1.42 2004/01/07 05:48:14 marka Exp $ */ /*** *** This file is not to be included by any public header files, because @@ -70,6 +70,9 @@ /* define if chroot() is available */ #undef HAVE_CHROOT +/* define if tzset() is available */ +#undef HAVE_TZSET + /* define if struct addrinfo exists */ #undef HAVE_ADDRINFO diff --git a/bin/named/main.c b/bin/named/main.c index 7260ce149dd..88a28e809bc 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: main.c,v 1.131 2003/09/24 23:20:54 marka Exp $ */ +/* $Id: main.c,v 1.132 2004/01/07 05:48:15 marka Exp $ */ #include @@ -537,6 +537,11 @@ setup(void) { */ ns_os_inituserinfo(ns_g_username); + /* + * Initialize time conversion information + */ + ns_os_tzset(); + ns_os_chroot(ns_g_chrootdir); /* diff --git a/bin/named/unix/include/named/os.h b/bin/named/unix/include/named/os.h index b7e195172d6..ccf8ceb4375 100644 --- a/bin/named/unix/include/named/os.h +++ b/bin/named/unix/include/named/os.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: os.h,v 1.19 2002/05/03 05:28:26 marka Exp $ */ +/* $Id: os.h,v 1.20 2004/01/07 05:48:15 marka Exp $ */ #ifndef NS_OS_H #define NS_OS_H 1 @@ -52,4 +52,7 @@ ns_os_gethostname(char *buf, size_t len); void ns_os_shutdownmsg(char *command, isc_buffer_t *text); +void +ns_os_tzset(void); + #endif /* NS_OS_H */ diff --git a/bin/named/unix/os.c b/bin/named/unix/os.c index 9eef889e02f..f5caf3a0b4c 100644 --- a/bin/named/unix/os.c +++ b/bin/named/unix/os.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: os.c,v 1.62 2002/12/13 02:51:39 marka Exp $ */ +/* $Id: os.c,v 1.63 2004/01/07 05:48:15 marka Exp $ */ #include #include @@ -598,3 +598,10 @@ ns_os_shutdownmsg(char *command, isc_buffer_t *text) { if (n < isc_buffer_availablelength(text)) isc_buffer_add(text, n); } + +void +ns_os_tzset(void) { +#ifdef HAVE_TZSET + tzset(); +#endif +} diff --git a/bin/named/win32/include/named/os.h b/bin/named/win32/include/named/os.h index 7c8d407d4e0..e0799a2616f 100644 --- a/bin/named/win32/include/named/os.h +++ b/bin/named/win32/include/named/os.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: os.h,v 1.6 2002/05/03 05:28:29 marka Exp $ */ +/* $Id: os.h,v 1.7 2004/01/07 05:48:15 marka Exp $ */ #ifndef NS_OS_H #define NS_OS_H 1 @@ -52,4 +52,7 @@ ns_os_gethostname(char *buf, size_t len); void ns_os_shutdownmsg(char *command, isc_buffer_t *text); +void +ns_os_tzset(void); + #endif /* NS_OS_H */ diff --git a/bin/named/win32/os.c b/bin/named/win32/os.c index 9ffcf70fdd0..5fab422cd90 100644 --- a/bin/named/win32/os.c +++ b/bin/named/win32/os.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: os.c,v 1.17 2002/08/03 01:31:48 mayer Exp $ */ +/* $Id: os.c,v 1.18 2004/01/07 05:48:15 marka Exp $ */ #include #include @@ -266,3 +266,10 @@ ns_os_shutdownmsg(char *command, isc_buffer_t *text) { UNUSED(command); UNUSED(text); } + +void +ns_os_tzset(void) { +#ifdef HAVE_TZSET + tzset(); +#endif +} diff --git a/config.h.in b/config.h.in index 8a5186183b7..cef9bb41444 100644 --- a/config.h.in +++ b/config.h.in @@ -16,7 +16,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: config.h.in,v 1.55 2003/07/25 05:10:21 marka Exp $ */ +/* $Id: config.h.in,v 1.56 2004/01/07 05:48:14 marka Exp $ */ /*** *** This file is not to be included by any public header files, because @@ -70,6 +70,9 @@ /* define if chroot() is available */ #undef HAVE_CHROOT +/* define if tzset() is available */ +#undef HAVE_TZSET + /* define if struct addrinfo exists */ #undef HAVE_ADDRINFO diff --git a/configure.in b/configure.in index 425af8a8e01..6085c10cdc9 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.349 $) +AC_REVISION($Revision: 1.350 $) AC_INIT(lib/dns/name.c) AC_PREREQ(2.13) @@ -1674,6 +1674,11 @@ case "$enable_linux_caps" in esac AC_CHECK_HEADERS(sys/prctl.h) +# +# Time Zone Stuff +# +AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET)) + # # BSD/OS, and perhaps some others, don't define rlim_t. #