mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-21 14:17:27 -04:00
998. [func] named-checkzone now has arguements to specify the
chroot directory (-t) and working directory (-w).
[RT #1755]
This commit is contained in:
parent
4fb42a8382
commit
43efd9fa56
3 changed files with 67 additions and 3 deletions
4
CHANGES
4
CHANGES
|
|
@ -1,3 +1,7 @@
|
|||
998. [func] named-checkzone now has arguements to specify the
|
||||
chroot directory (-t) and working directory (-w).
|
||||
[RT #1755]
|
||||
|
||||
997. [func] Add support for RSA-SHA1 keys (RFC3110).
|
||||
|
||||
996. [func] Issue warning if the configuration filename contains
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: named-checkzone.c,v 1.14 2001/09/03 08:21:44 marka Exp $ */
|
||||
/* $Id: named-checkzone.c,v 1.15 2001/09/15 02:05:34 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include <isc/app.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/dir.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/socket.h>
|
||||
|
|
@ -78,26 +79,60 @@ main(int argc, char **argv) {
|
|||
isc_result_t result;
|
||||
char classname_in[] = "IN";
|
||||
char *classname = classname_in;
|
||||
const char *workdir = NULL;
|
||||
|
||||
while ((c = isc_commandline_parse(argc, argv, "c:dqsv")) != EOF) {
|
||||
while ((c = isc_commandline_parse(argc, argv, "c:dqist:vw:")) != EOF) {
|
||||
switch (c) {
|
||||
case 'c':
|
||||
classname = isc_commandline_argument;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
debug++;
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
quiet++;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
result = isc_dir_chroot(isc_commandline_argument);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "isc_dir_chroot: %s: %s\n",
|
||||
isc_commandline_argument,
|
||||
isc_result_totext(result));
|
||||
exit(1);
|
||||
}
|
||||
result = isc_dir_chdir("/");
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "isc_dir_chdir: %s\n",
|
||||
isc_result_totext(result));
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
printf(VERSION "\n");
|
||||
exit(0);
|
||||
|
||||
case 'w':
|
||||
workdir = isc_commandline_argument;
|
||||
break;
|
||||
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
if (workdir != NULL) {
|
||||
result = isc_dir_chdir(workdir);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "isc_dir_chdir: %s: %s\n",
|
||||
workdir, isc_result_totext(result));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (isc_commandline_index + 2 > argc)
|
||||
usage();
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: named-checkzone.docbook,v 1.3 2001/06/29 01:05:00 gson Exp $ -->
|
||||
<!-- $Id: named-checkzone.docbook,v 1.4 2001/09/15 02:05:35 marka Exp $ -->
|
||||
|
||||
<refentry>
|
||||
<refentryinfo>
|
||||
|
|
@ -41,6 +41,8 @@
|
|||
<arg><option>-q</option></arg>
|
||||
<arg><option>-v</option></arg>
|
||||
<arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
|
||||
<arg><option>-t <replaceable class="parameter">directory</replaceable></option></arg>
|
||||
<arg><option>-w <replaceable class="parameter">directory</replaceable></option></arg>
|
||||
<arg choice="req">zonename</arg>
|
||||
<arg choice="req">filename</arg>
|
||||
</cmdsynopsis>
|
||||
|
|
@ -98,6 +100,29 @@
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-t <replaceable class="parameter">directory</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
chroot to <filename>directory</filename> so that include
|
||||
directives in the configuration file are processed as if
|
||||
run by a similarly chrooted named.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-w <replaceable class="parameter">directory</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
chdir to <filename>directory</filename> so that relative
|
||||
filenames in master file $INCLUDE directives work. This
|
||||
is similar to the directory clause in
|
||||
<filename>named.conf</filename>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>zonename</term>
|
||||
<listitem>
|
||||
|
|
|
|||
Loading…
Reference in a new issue