2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 07:35:26 +00:00

923. [bug] Multiline TSIG secrets (and other multiline strings)

were not accepted in named.conf. [RT #1469]
This commit is contained in:
Andreas Gustafsson
2001-07-06 20:34:12 +00:00
parent ad493ef9dd
commit 96ed624253
4 changed files with 19 additions and 10 deletions

View File

@@ -1,4 +1,10 @@
923. [bug] Multiline TSIG secrets (and other multiline strings)
were not accepted in named.conf. [RT #1469]
922. [func] Added two new lwres_getrrsetbyname() result codes,
ERR_NONAME and ERR_NODATA.
921. [bug] lwres returned an incorrect error code if it received 921. [bug] lwres returned an incorrect error code if it received
a truncated message. a truncated message.

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: lex.h,v 1.25 2001/01/09 21:57:04 bwelling Exp $ */ /* $Id: lex.h,v 1.26 2001/07/06 20:34:11 gson Exp $ */
#ifndef ISC_LEX_H #ifndef ISC_LEX_H
#define ISC_LEX_H 1 #define ISC_LEX_H 1
@@ -87,7 +87,7 @@ ISC_LANG_BEGINDECLS
#define ISC_LEXOPT_CNUMBER 0x80 /* Regognise octal and hex */ #define ISC_LEXOPT_CNUMBER 0x80 /* Regognise octal and hex */
#define ISC_LEXOPT_ESCAPE 0x100 /* Recognize escapes. */ #define ISC_LEXOPT_ESCAPE 0x100 /* Recognize escapes. */
#define ISC_LEXOPT_QSTRINGMULTILINE 0x200 /* Allow multiline "" strings */
/* /*
* Various commenting styles, which may be changed at any time with * Various commenting styles, which may be changed at any time with

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: lex.c,v 1.64 2001/07/04 00:34:44 bwelling Exp $ */ /* $Id: lex.c,v 1.65 2001/07/06 20:34:09 gson Exp $ */
#include <config.h> #include <config.h>
@@ -721,7 +721,8 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
done = ISC_TRUE; done = ISC_TRUE;
} }
} else { } else {
if (c == '\n' && !escaped) { if (c == '\n' && !escaped &&
(options & ISC_LEXOPT_QSTRINGMULTILINE) == 0) {
pushback(source, c); pushback(source, c);
return (ISC_R_UNBALANCEDQUOTES); return (ISC_R_UNBALANCEDQUOTES);
} }

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: parser.c,v 1.61 2001/07/03 17:12:19 gson Exp $ */ /* $Id: parser.c,v 1.62 2001/07/06 20:34:12 gson Exp $ */
#include <config.h> #include <config.h>
@@ -40,6 +40,8 @@
#define CAT CFG_LOGCATEGORY_CONFIG #define CAT CFG_LOGCATEGORY_CONFIG
#define MOD CFG_LOGMODULE_PARSER #define MOD CFG_LOGMODULE_PARSER
#define QSTRING (ISC_LEXOPT_QSTRING | ISC_LEXOPT_QSTRINGMULTILINE)
/* /*
* Pass one of these flags to parser_error() to include the * Pass one of these flags to parser_error() to include the
* token text in log message. * token text in log message.
@@ -1767,7 +1769,7 @@ parse_qstring(cfg_parser_t *pctx, cfg_type_t *type, cfg_obj_t **ret) {
isc_result_t result; isc_result_t result;
UNUSED(type); UNUSED(type);
CHECK(cfg_gettoken(pctx, ISC_LEXOPT_QSTRING)); CHECK(cfg_gettoken(pctx, QSTRING));
if (pctx->token.type != isc_tokentype_qstring) { if (pctx->token.type != isc_tokentype_qstring) {
parser_error(pctx, LOG_NEAR, "expected quoted string"); parser_error(pctx, LOG_NEAR, "expected quoted string");
return (ISC_R_UNEXPECTEDTOKEN); return (ISC_R_UNEXPECTEDTOKEN);
@@ -2570,7 +2572,7 @@ parse_token(cfg_parser_t *pctx, cfg_type_t *type, cfg_obj_t **ret) {
UNUSED(type); UNUSED(type);
CHECK(create_cfgobj(pctx, &cfg_type_token, &obj)); CHECK(create_cfgobj(pctx, &cfg_type_token, &obj));
CHECK(cfg_gettoken(pctx, ISC_LEXOPT_QSTRING)); CHECK(cfg_gettoken(pctx, QSTRING));
if (pctx->token.type == isc_tokentype_eof) { if (pctx->token.type == isc_tokentype_eof) {
cfg_ungettoken(pctx); cfg_ungettoken(pctx);
result = ISC_R_EOF; result = ISC_R_EOF;
@@ -3014,7 +3016,7 @@ parse_addrmatchelt(cfg_parser_t *pctx, cfg_type_t *type, cfg_obj_t **ret) {
isc_result_t result; isc_result_t result;
UNUSED(type); UNUSED(type);
CHECK(cfg_peektoken(pctx, ISC_LEXOPT_QSTRING)); CHECK(cfg_peektoken(pctx, QSTRING));
if (pctx->token.type == isc_tokentype_string || if (pctx->token.type == isc_tokentype_string ||
pctx->token.type == isc_tokentype_qstring) { pctx->token.type == isc_tokentype_qstring) {
@@ -3230,7 +3232,7 @@ parse_optional_facility(cfg_parser_t *pctx, cfg_type_t *type, cfg_obj_t **ret)
isc_result_t result; isc_result_t result;
UNUSED(type); UNUSED(type);
CHECK(cfg_peektoken(pctx, ISC_LEXOPT_QSTRING)); CHECK(cfg_peektoken(pctx, QSTRING));
if (pctx->token.type == isc_tokentype_string || if (pctx->token.type == isc_tokentype_string ||
pctx->token.type == isc_tokentype_qstring) { pctx->token.type == isc_tokentype_qstring) {
CHECK(parse(pctx, &cfg_type_astring, ret)); CHECK(parse(pctx, &cfg_type_astring, ret));
@@ -3549,7 +3551,7 @@ static isc_result_t
cfg_getstringtoken(cfg_parser_t *pctx) { cfg_getstringtoken(cfg_parser_t *pctx) {
isc_result_t result; isc_result_t result;
result = cfg_gettoken(pctx, ISC_LEXOPT_QSTRING); result = cfg_gettoken(pctx, QSTRING);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (result); return (result);