| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: server.c,v 1.5 2019/04/28 00:01:13 christos Exp $ */ | | 1 | /* $NetBSD: server.c,v 1.6 2019/05/02 14:57:01 taca Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (C) Internet Systems Consortium, Inc. ("ISC") | | 4 | * Copyright (C) Internet Systems Consortium, Inc. ("ISC") |
5 | * | | 5 | * |
6 | * This Source Code Form is subject to the terms of the Mozilla Public | | 6 | * This Source Code Form is subject to the terms of the Mozilla Public |
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | | 7 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | | 8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
9 | * | | 9 | * |
10 | * See the COPYRIGHT file distributed with this work for additional | | 10 | * See the COPYRIGHT file distributed with this work for additional |
11 | * information regarding copyright ownership. | | 11 | * information regarding copyright ownership. |
12 | */ | | 12 | */ |
13 | | | 13 | |
14 | /*! \file */ | | 14 | /*! \file */ |
| @@ -6456,33 +6456,35 @@ directory_callback(const char *clausenam | | | @@ -6456,33 +6456,35 @@ directory_callback(const char *clausenam |
6456 | UNUSED(arg); | | 6456 | UNUSED(arg); |
6457 | UNUSED(clausename); | | 6457 | UNUSED(clausename); |
6458 | | | 6458 | |
6459 | /* | | 6459 | /* |
6460 | * Change directory. | | 6460 | * Change directory. |
6461 | */ | | 6461 | */ |
6462 | directory = cfg_obj_asstring(obj); | | 6462 | directory = cfg_obj_asstring(obj); |
6463 | | | 6463 | |
6464 | if (! isc_file_ischdiridempotent(directory)) | | 6464 | if (! isc_file_ischdiridempotent(directory)) |
6465 | cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING, | | 6465 | cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING, |
6466 | "option 'directory' contains relative path '%s'", | | 6466 | "option 'directory' contains relative path '%s'", |
6467 | directory); | | 6467 | directory); |
6468 | | | 6468 | |
| | | 6469 | #if 0 |
6469 | if (!isc_file_isdirwritable(directory)) { | | 6470 | if (!isc_file_isdirwritable(directory)) { |
6470 | isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, | | 6471 | isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, |
6471 | NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, | | 6472 | NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, |
6472 | "directory '%s' is not writable", | | 6473 | "directory '%s' is not writable", |
6473 | directory); | | 6474 | directory); |
6474 | return (ISC_R_NOPERM); | | 6475 | return (ISC_R_NOPERM); |
6475 | } | | 6476 | } |
| | | 6477 | #endif |
6476 | | | 6478 | |
6477 | result = isc_dir_chdir(directory); | | 6479 | result = isc_dir_chdir(directory); |
6478 | if (result != ISC_R_SUCCESS) { | | 6480 | if (result != ISC_R_SUCCESS) { |
6479 | cfg_obj_log(obj, named_g_lctx, ISC_LOG_ERROR, | | 6481 | cfg_obj_log(obj, named_g_lctx, ISC_LOG_ERROR, |
6480 | "change directory to '%s' failed: %s", | | 6482 | "change directory to '%s' failed: %s", |
6481 | directory, isc_result_totext(result)); | | 6483 | directory, isc_result_totext(result)); |
6482 | return (result); | | 6484 | return (result); |
6483 | } | | 6485 | } |
6484 | | | 6486 | |
6485 | return (ISC_R_SUCCESS); | | 6487 | return (ISC_R_SUCCESS); |
6486 | } | | 6488 | } |
6487 | | | 6489 | |
6488 | static isc_result_t | | 6490 | static isc_result_t |