Skip to content
Snippets Groups Projects
Commit e06c5173 authored by Jan Hák's avatar Jan Hák Committed by Daniel Salzman
Browse files

kzonecheck: allows '-' as substitution for '/dev/stdin'

relates #727
parent f536dcf0
No related branches found
No related tags found
No related merge requests found
Pipeline #80010 passed
......@@ -41,6 +41,13 @@ DNS server.
.sp
Please, refer to the \fBsemantic\-checks\fP configuration option in
\fBknot.conf(5)\fP for the full list of available semantic checks.
.SS Parameters
.INDENT 0.0
.TP
\fIfilename\fP
Path to the zone file to be checked. For reading from \fBstdin\fP use \fB/dev/stdin\fP
or just \fB\-\fP\&.
.UNINDENT
.SS Options
.INDENT 0.0
.TP
......
......@@ -18,6 +18,13 @@ DNS server.
Please, refer to the ``semantic-checks`` configuration option in
:manpage:`knot.conf(5)` for the full list of available semantic checks.
Parameters
..........
*filename*
Path to the zone file to be checked. For reading from **stdin** use **/dev/stdin**
or just **-**.
Options
.......
......
/* Copyright (C) 2020 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2021 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -28,6 +28,9 @@
#define PROGRAM_NAME "kzonecheck"
#define STDIN_SUBST "-"
#define STDIN_REPL "/dev/stdin"
static void print_help(void)
{
printf("Usage: %s [parameters] <filename>\n"
......@@ -120,6 +123,9 @@ int main(int argc, char *argv[])
}
char *filename = argv[optind];
if (strncmp(filename, STDIN_SUBST, sizeof(STDIN_SUBST)) == 0) {
filename = STDIN_REPL;
}
char *zonename;
if (origin == NULL) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment