Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
f4d9f465
Commit
f4d9f465
authored
Jul 11, 2000
by
James Brister
Browse files
327. [bug] rndc.conf parser wasn't correctly recognising an IP
address where a host specification was required.
parent
838f13fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
f4d9f465
327. [bug] rndc.conf parser wasn't correctly recognising an IP
address where a host specification was required.
326. [func] 'keys' in an 'inet' control statement is now
required and must have at least one item in it.
...
...
lib/dns/config/confndc.c
View file @
f4d9f465
...
...
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: confndc.c,v 1.2
0
2000/07/1
0 11:27:11 tale
Exp $ */
/* $Id: confndc.c,v 1.2
1
2000/07/1
1 20:13:09 brister
Exp $ */
/*
** options {
...
...
@@ -144,51 +144,39 @@ static struct keywordtoken misc_tokens[] = {
static
isc_result_t
parse_file
(
ndcpcontext
*
pctx
,
dns_c_ndcctx_t
**
context
);
static
isc_result_t
parse_file
(
ndcpcontext
*
pctx
,
dns_c_ndcctx_t
**
context
);
static
isc_result_t
parse_statement
(
ndcpcontext
*
pctx
);
static
isc_result_t
parse_options
(
ndcpcontext
*
pctx
,
dns_c_ndcopts_t
**
opts
);
static
isc_result_t
parse_serverstmt
(
ndcpcontext
*
pctx
,
dns_c_ndcserver_t
**
server
);
static
isc_result_t
parse_keystmt
(
ndcpcontext
*
pctx
,
dns_c_kdeflist_t
*
keys
);
static
isc_result_t
parse_statement
(
ndcpcontext
*
pctx
);
static
isc_result_t
parse_options
(
ndcpcontext
*
pctx
,
dns_c_ndcopts_t
**
opts
);
static
isc_result_t
parse_serverstmt
(
ndcpcontext
*
pctx
,
dns_c_ndcserver_t
**
server
);
static
isc_result_t
parse_keystmt
(
ndcpcontext
*
pctx
,
dns_c_kdeflist_t
*
keys
);
static
const
char
*
keyword2str
(
isc_int32_t
val
);
static
isc_boolean_t
eat
(
ndcpcontext
*
pctx
,
isc_uint32_t
token
);
static
isc_boolean_t
eat_eos
(
ndcpcontext
*
pctx
);
static
isc_boolean_t
eat_lbrace
(
ndcpcontext
*
pctx
);
static
isc_boolean_t
eat_rbrace
(
ndcpcontext
*
pctx
);
static
const
char
*
keyword2str
(
isc_int32_t
val
);
static
isc_boolean_t
eat
(
ndcpcontext
*
pctx
,
isc_uint32_t
token
);
static
isc_boolean_t
eat_eos
(
ndcpcontext
*
pctx
);
static
isc_boolean_t
eat_lbrace
(
ndcpcontext
*
pctx
);
static
isc_boolean_t
eat_rbrace
(
ndcpcontext
*
pctx
);
static
isc_boolean_t
looking_at
(
ndcpcontext
*
pctx
,
isc_uint32_t
token
);
static
isc_boolean_t
looking_at_anystring
(
ndcpcontext
*
pctx
);
static
isc_boolean_t
looking_at
(
ndcpcontext
*
pctx
,
isc_uint32_t
token
);
static
isc_boolean_t
looking_at_anystring
(
ndcpcontext
*
pctx
);
static
isc_
result_t
parser_setup
(
ndcpcontext
*
pctx
,
isc_mem_t
*
mem
,
const
char
*
filename
);
static
void
parser_complain
(
isc_boolean_t
is_warning
,
isc_boolean_t
print_last_token
,
ndcpcontext
*
pctx
,
const
char
*
format
,
va_list
args
);
static
void
parser_error
(
ndcpcontext
*
pctx
,
isc_boolean_t
lasttoken
,
const
char
*
fmt
,
...);
static
void
parser_warn
(
ndcpcontext
*
pctx
,
isc_boolean_t
lasttoken
,
const
char
*
fmt
,
...
);
static
isc_boolean_t
is_ip6addr
(
const
char
*
string
,
struct
in6_addr
*
addr
);
static
isc_boolean_t
is_ip4addr
(
const
char
*
string
,
struct
in_addr
*
addr
);
static
isc_
result_t
getnexttoken
(
ndcpcontext
*
pctx
);
static
void
syntax_error
(
ndcpcontext
*
pctx
,
isc_uint32_t
keyword
);
static
isc_
boolean_t
looking_at_stringoripaddr
(
ndcpcontext
*
pctx
);
static
isc_result_t
parser_setup
(
ndcpcontext
*
pctx
,
isc_mem_t
*
mem
,
const
char
*
filename
);
static
void
parser_complain
(
isc_boolean_t
is_warning
,
isc_boolean_t
print_
last
_
token
,
ndcpcontext
*
pctx
,
const
char
*
format
,
va_list
args
);
static
void
parser_error
(
ndcpcontext
*
pctx
,
isc_boolean_t
lasttoken
,
const
char
*
fmt
,
...
);
static
void
parser_warn
(
ndcpcontext
*
pctx
,
isc_boolean_t
lasttoken
,
const
char
*
fmt
,
...
);
static
isc_
boolean_t
is_ip6addr
(
const
char
*
string
,
struct
in6_addr
*
addr
);
static
isc_boolean_t
is_ip4addr
(
const
char
*
string
,
struct
in_addr
*
addr
);
static
isc_result_t
getnexttoken
(
ndcpcontext
*
pctx
);
static
void
syntax_error
(
ndcpcontext
*
pctx
,
isc_uint32_t
keyword
);
/* *********************************************************************** */
...
...
@@ -950,7 +938,7 @@ parse_options(ndcpcontext *pctx, dns_c_ndcopts_t **opts) {
switch
(
option
)
{
case
L_DEFAULT_SERVER
:
if
(
!
looking_at_
any
string
(
pctx
))
if
(
!
looking_at_string
oripaddr
(
pctx
))
return
(
result
);
result
=
dns_c_ndcopts_setdefserver
(
newopts
,
...
...
@@ -1067,7 +1055,7 @@ parse_serverstmt(ndcpcontext *pctx, dns_c_ndcserver_t **server) {
break
;
case
L_HOST
:
if
(
!
looking_at_
any
string
(
pctx
))
{
if
(
!
looking_at_string
oripaddr
(
pctx
))
{
result
=
ISC_R_FAILURE
;
goto
done
;
}
...
...
@@ -1347,6 +1335,20 @@ looking_at_anystring(ndcpcontext *pctx) {
return
(
ISC_TRUE
);
}
static
isc_boolean_t
looking_at_stringoripaddr
(
ndcpcontext
*
pctx
)
{
if
(
pctx
->
currtok
!=
L_STRING
&&
pctx
->
currtok
!=
L_QSTRING
&&
pctx
->
currtok
!=
L_IP4ADDR
&&
pctx
->
currtok
!=
L_IP6ADDR
)
{
parser_error
(
pctx
,
ISC_TRUE
,
"expected a hostname or an ip address"
);
return
(
ISC_FALSE
);
}
return
(
ISC_TRUE
);
}
static
isc_boolean_t
eat_lbrace
(
ndcpcontext
*
pctx
)
{
return
(
eat
(
pctx
,
L_LBRACE
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment