Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Core
Tor
Commits
a7ec493d
Commit
a7ec493d
authored
Jul 12, 2018
by
Nick Mathewson
🎨
Browse files
Merge remote-tracking branch 'imnotbad/bug26663'
parents
66074ad1
abeb07a1
Changes
4
Hide whitespace changes
Inline
Side-by-side
changes/ticket26663
0 → 100644
View file @
a7ec493d
o Minor features(config):
- Parsing of "auto" keyword in torrc is now case insensitive.
Fixes bug 26663; bugfix on 0.3.5.0-alpha
src/app/config/config.c
View file @
a7ec493d
...
...
@@ -7001,7 +7001,7 @@ parse_port_config(smartlist_t *out,
port
=
0
;
else
port
=
1
;
}
else
if
(
!
strcmp
(
addrport
,
"auto"
))
{
}
else
if
(
!
strc
asec
mp
(
addrport
,
"auto"
))
{
port
=
CFG_AUTO_PORT
;
int
af
=
tor_addr_parse
(
&
addr
,
defaultaddr
);
tor_assert
(
af
>=
0
);
...
...
src/app/config/confparse.c
View file @
a7ec493d
...
...
@@ -267,7 +267,7 @@ config_assign_value(const config_format_t *fmt, void *options,
break
;
case
CONFIG_TYPE_AUTOBOOL
:
if
(
!
strcmp
(
c
->
value
,
"auto"
))
if
(
!
strc
asec
mp
(
c
->
value
,
"auto"
))
*
(
int
*
)
lvalue
=
-
1
;
else
if
(
!
strcmp
(
c
->
value
,
"0"
))
*
(
int
*
)
lvalue
=
0
;
...
...
src/test/test_config.c
View file @
a7ec493d
...
...
@@ -4637,6 +4637,20 @@ test_config_parse_port_config__ports__ports_given(void *data)
tor_addr_parse
(
&
addr
,
"127.0.0.46"
);
tt_assert
(
tor_addr_eq
(
&
port_cfg
->
addr
,
&
addr
))
// Test success with a port of auto in mixed case
config_free_lines
(
config_port_valid
);
config_port_valid
=
NULL
;
SMARTLIST_FOREACH
(
slout
,
port_cfg_t
*
,
pf
,
port_cfg_free
(
pf
));
smartlist_clear
(
slout
);
config_port_valid
=
mock_config_line
(
"DNSPort"
,
"AuTo"
);
ret
=
parse_port_config
(
slout
,
config_port_valid
,
"DNS"
,
0
,
"127.0.0.46"
,
0
,
0
);
tt_int_op
(
ret
,
OP_EQ
,
0
);
tt_int_op
(
smartlist_len
(
slout
),
OP_EQ
,
1
);
port_cfg
=
(
port_cfg_t
*
)
smartlist_get
(
slout
,
0
);
tt_int_op
(
port_cfg
->
port
,
OP_EQ
,
CFG_AUTO_PORT
);
tor_addr_parse
(
&
addr
,
"127.0.0.46"
);
tt_assert
(
tor_addr_eq
(
&
port_cfg
->
addr
,
&
addr
))
// Test success with parsing both an address and an auto port
config_free_lines
(
config_port_valid
);
config_port_valid
=
NULL
;
SMARTLIST_FOREACH
(
slout
,
port_cfg_t
*
,
pf
,
port_cfg_free
(
pf
));
...
...
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