Commit 0d5d8e2b authored by James Brister's avatar James Brister
Browse files

259. [func] New random-device and random-seed-file statements

                        for global options block of named.conf. Both accept
                        a single string argument.
parent 3d2332d6
259. [func] New random-device and random-seed-file statements
for global options block of named.conf. Both accept
a single string argument.
258. [bug] Fixed printing of lwres_addr_t.address field.
257. [bug] The server detached the last zone manager reference
......
......@@ -16,6 +16,8 @@
options {
version "my version string";
random-device "/dev/random";
random-seed-file "/random/seed/file";
directory "/tmp";
port 666;
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: confctx.c,v 1.68 2000/06/09 22:13:20 brister Exp $ */
/* $Id: confctx.c,v 1.69 2000/06/15 23:38:12 brister Exp $ */
#include <config.h>
......@@ -921,6 +921,8 @@ dns_c_ctx_optionsprint(FILE *fp, int indent, dns_c_options_t *options)
PRINT_CHAR_P(stats_filename, "statistics-file");
PRINT_CHAR_P(memstats_filename, "memstatistics-file");
PRINT_CHAR_P(named_xfer, "named-xfer");
PRINT_CHAR_P(random_device, "random-device");
PRINT_CHAR_P(random_seed_file, "random-seed-file");
PRINT_INTEGER(port, "port");
......@@ -1413,6 +1415,8 @@ dns_c_ctx_optionsnew(isc_mem_t *mem, dns_c_options_t **options)
opts->stats_filename = NULL;
opts->memstats_filename = NULL;
opts->named_xfer = NULL;
opts->random_device = NULL;
opts->random_seed_file = NULL;
opts->port = NULL;
......@@ -1546,6 +1550,8 @@ dns_c_ctx_optionsdelete(dns_c_options_t **opts)
FREESTRING(stats_filename);
FREESTRING(memstats_filename);
FREESTRING(named_xfer);
FREESTRING(random_device);
FREESTRING(random_seed_file);
FREEFIELD(expert_mode);
......@@ -1703,6 +1709,16 @@ GETSTRING(namedxfer, named_xfer)
UNSETSTRING(namedxfer, named_xfer)
SETSTRING(randomdevice, random_device)
GETSTRING(randomdevice, random_device)
UNSETSTRING(randomdevice, random_device)
SETSTRING(randomseedfile, random_seed_file)
GETSTRING(randomseedfile, random_seed_file)
UNSETSTRING(randomseedfile, random_seed_file)
GETBYTYPE(in_port_t, port, port)
SETBYTYPE(in_port_t, port, port)
UNSETBYTYPE(in_port_t, port, port)
......
......@@ -16,7 +16,7 @@
* SOFTWARE.
*/
/* $Id: confparser.y,v 1.96 2000/06/09 22:13:21 brister Exp $ */
/* $Id: confparser.y,v 1.97 2000/06/15 23:38:14 brister Exp $ */
#include <config.h>
......@@ -321,6 +321,8 @@ static isc_boolean_t int_too_big(isc_uint32_t base, isc_uint32_t mult);
%token L_OPTIONS
%token L_ORDER
%token L_OWNER
%token L_RANDOM_DEVICE
%token L_RANDOM_SEED_FILE
%token L_PERM
%token L_PIDFILE
%token L_PORT
......@@ -583,6 +585,38 @@ option: /* Empty */
isc_mem_free(memctx, $2);
}
| L_RANDOM_DEVICE L_QSTRING
{
tmpres = dns_c_ctx_setrandomdevice(currcfg, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine random-device");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"error setting random-device: %s: %s",
isc_result_totext(tmpres), $2);
YYABORT;
}
isc_mem_free(memctx, $2);
}
| L_RANDOM_SEED_FILE L_QSTRING
{
tmpres = dns_c_ctx_setrandomseedfile(currcfg, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine random-seed-file");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"error setting random-seed-file: %s: %s",
isc_result_totext(tmpres), $2);
YYABORT;
}
isc_mem_free(memctx, $2);
}
| L_TKEY_DOMAIN L_QSTRING
{
tmpres = dns_c_ctx_settkeydomain(currcfg, $2);
......@@ -5128,6 +5162,8 @@ static struct token keyword_tokens [] = {
{ "pubkey", L_PUBKEY },
{ "query-source", L_QUERY_SOURCE },
{ "query-source-v6", L_QUERY_SOURCE_V6 },
{ "random-device", L_RANDOM_DEVICE },
{ "random-seed-file", L_RANDOM_SEED_FILE },
{ "request-ixfr", L_REQUEST_IXFR },
{ "rfc2308-type1", L_RFC2308_TYPE1 },
{ "rrset-order", L_RRSET_ORDER },
......
......@@ -115,6 +115,8 @@ struct dns_c_options {
char *stats_filename;
char *memstats_filename;
char *named_xfer;
char *random_device;
char *random_seed_file;
in_port_t *port;
......@@ -312,6 +314,16 @@ isc_result_t dns_c_ctx_getnamedxfer(dns_c_ctx_t *ctx, char **retval);
isc_result_t dns_c_ctx_unsetnamedxfer(dns_c_ctx_t *ctx);
isc_result_t dns_c_ctx_setrandomdevice(dns_c_ctx_t *ctx, const char *newval);
isc_result_t dns_c_ctx_getrandomdevice(dns_c_ctx_t *ctx, char **retval);
isc_result_t dns_c_ctx_unsetrandomdevice(dns_c_ctx_t *ctx);
isc_result_t dns_c_ctx_setrandomseedfile(dns_c_ctx_t *ctx, const char *newval);
isc_result_t dns_c_ctx_getrandomseedfile(dns_c_ctx_t *ctx, char **retval);
isc_result_t dns_c_ctx_unsetrandomseedfile(dns_c_ctx_t *ctx);
isc_result_t dns_c_ctx_setport(dns_c_ctx_t *cfg, in_port_t newval);
isc_result_t dns_c_ctx_getport(dns_c_ctx_t *cfg, in_port_t *retval);
isc_result_t dns_c_ctx_unsetport(dns_c_ctx_t *cfg);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment