diff --git a/CHANGES b/CHANGES index d3a6d501c0..d41fbf6da7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +2292. [bug] Log if the working directory is not writable. + [RT #17312] + +2291. [bug] PR_SET_DUMPABLE may be set too late. Also report + failure to set PR_SET_DUMPABLE. [RT #17312] + 2290. [bug] Let AD in the query signal that the client wants AD set in the response. [RT #17301] diff --git a/bin/named/server.c b/bin/named/server.c index ce7376a581..7e33347bcc 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -15,11 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.339.2.15.2.75 2007/08/28 07:19:08 tbox Exp $ */ +/* $Id: server.c,v 1.339.2.15.2.76 2008/01/09 04:52:48 marka Exp $ */ #include #include +#include #include #include @@ -2210,6 +2211,15 @@ load_configuration(const char *filename, ns_server_t *server, } CHECK(result); + /* + * Check that the working directory is writable. + */ + if (access(".", W_OK) != 0) { + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_ERROR, + "the working directory is not writable"); + } + /* * Check the validity of the configuration. */ diff --git a/bin/named/unix/os.c b/bin/named/unix/os.c index 3cff7b8909..54d0346f73 100644 --- a/bin/named/unix/os.c +++ b/bin/named/unix/os.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: os.c,v 1.46.2.4.8.27 2007/08/28 07:19:08 tbox Exp $ */ +/* $Id: os.c,v 1.46.2.4.8.28 2008/01/09 04:52:48 marka Exp $ */ #include #include @@ -494,15 +494,19 @@ ns_os_changeuser(void) { ns_main_earlyfatal("setuid(): %s", strbuf); } -#if defined(HAVE_LINUX_CAPABILITY_H) && !defined(HAVE_LINUXTHREADS) - linux_minprivs(); -#endif #if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_DUMPABLE) /* * Restore the ability of named to drop core after the setuid() * call has disabled it. */ - prctl(PR_SET_DUMPABLE,1,0,0,0); + if (prctl(PR_SET_DUMPABLE,1,0,0,0) < 0) { + isc__strerror(errno, strbuf, sizeof(strbuf)); + ns_main_earlywarning("prctl(PR_SET_DUMPABLE) failed: %s", + strbuf); + } +#endif +#if defined(HAVE_LINUX_CAPABILITY_H) && !defined(HAVE_LINUXTHREADS) + linux_minprivs(); #endif }