diff --git a/CHANGES b/CHANGES index f820160cc7..7f28c3d9dc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +3058. [bug] Cause named to terminate at startup or rndc reconfig/ + reload to fail, if a log file specified in the conf + file isn't a plain file. [RT #22771] + 3057. [bug] "rndc secroots" would abort after the first error and so could miss some views. [RT #23488] diff --git a/bin/named/logconf.c b/bin/named/logconf.c index e32496507e..b08a345680 100644 --- a/bin/named/logconf.c +++ b/bin/named/logconf.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: logconf.c,v 1.42 2007/06/19 23:46:59 tbox Exp $ */ +/* $Id: logconf.c,v 1.42.816.1 2011/03/04 14:10:12 smann Exp $ */ /*! \file */ @@ -221,24 +221,36 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *lctx) { FILE *fp; /* - * Test that the file can be opened, since isc_log_open() - * can't effectively report failures when called in - * isc_log_doit(). - */ - result = isc_stdio_open(dest.file.name, "a", &fp); - if (result != ISC_R_SUCCESS) - isc_log_write(ns_g_lctx, CFG_LOGCATEGORY_CONFIG, - NS_LOGMODULE_SERVER, ISC_LOG_ERROR, - "logging channel '%s' file '%s': %s", - channelname, dest.file.name, - isc_result_totext(result)); - else - (void)isc_stdio_close(fp); - - /* - * Allow named to continue by returning success. - */ - result = ISC_R_SUCCESS; + * Test to make sure that file is a plain file. + * Fix defect #22771 + */ + result = isc_file_isplainfile(dest.file.name); + if (result == ISC_R_SUCCESS || + result == ISC_R_FILENOTFOUND) { + /* + * Test that the file can be opened, since + * isc_log_open() can't effectively report + * failures when called in + * isc_log_doit(). + */ + result = isc_stdio_open(dest.file.name, "a", &fp); + if (result != ISC_R_SUCCESS) { + syslog(LOG_ERR, + "isc_stdio_open '%s' failed: %s", + dest.file.name, + isc_result_totext(result)); + fprintf(stderr, + "isc_stdio_open '%s' failed: %s", + dest.file.name, + isc_result_totext(result)); + } else + (void)isc_stdio_close(fp); + } else { + syslog(LOG_ERR, "isc_file_isplainfile '%s' failed: %s", + dest.file.name, isc_result_totext(result)); + fprintf(stderr, "isc_file_isplainfile '%s' failed: %s", + dest.file.name, isc_result_totext(result)); + } } return (result); diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in index 90f1c131a5..b9d0a182f7 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in @@ -15,7 +15,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: conf.sh.in,v 1.59.8.3 2011/03/02 04:47:11 marka Exp $ +# $Id: conf.sh.in,v 1.59.8.4 2011/03/04 14:10:13 smann Exp $ # # Common configuration data for system tests, to be sourced into @@ -54,9 +54,9 @@ JOURNALPRINT=$TOP/bin/tools/named-journalprint # v6synth SUBDIRS="acl allow_query addzone autosign cacheclean checkconf checknames checkzone database dlv dlvauto @DLZ_SYSTEM_TEST@ dlzexternal dns64 - dnssec forward glue gost ixfr limits lwresd masterfile masterformat - metadata notify nsupdate pending pkcs11 resolver rpz rrsetorder - sortlist smartsign staticstub stub tkey tsig tsiggss + dnssec forward glue gost ixfr limits logfileconfig lwresd masterfile + masterformat metadata notify nsupdate pending pkcs11 resolver rpz + rrsetorder sortlist smartsign staticstub stub tkey tsig tsiggss unknown upforwd views xfer xferquota zonechecks" # PERL will be an empty string if no perl interpreter was found. diff --git a/bin/tests/system/start.pl b/bin/tests/system/start.pl index 75b03d994a..00c1cbb1cf 100644 --- a/bin/tests/system/start.pl +++ b/bin/tests/system/start.pl @@ -15,7 +15,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: start.pl,v 1.16 2010/09/15 12:07:55 marka Exp $ +# $Id: start.pl,v 1.16.54.1 2011/03/04 14:10:13 smann Exp $ # Framework for starting test servers. # Based on the type of server specified, check for port availability, remove @@ -33,6 +33,8 @@ use Getopt::Long; # test - name of the test directory # server - name of the server directory # options - alternate options for the server +# NOTE: options must be specified with '-- "