mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-09-20 21:16:22 +02:00
When we get a bad nickname, explain what a good one is.
Closes #18300; patch from "icanhasaccount".
This commit is contained in:
parent
e703484722
commit
7532cd439b
3
changes/bug18300
Normal file
3
changes/bug18300
Normal file
@ -0,0 +1,3 @@
|
||||
o Minor features (logging):
|
||||
- Provide a more useful warning message when configured with an
|
||||
invalid Nickname. Closes ticket 18300; patch from "icanhasaccount".
|
@ -98,6 +98,8 @@
|
||||
# OutboundBindAddress 10.0.0.5
|
||||
|
||||
## A handle for your relay, so people don't have to refer to it by key.
|
||||
## Nicknames must be between 1 and 19 characters inclusive, and must
|
||||
## contain only the characters [a-zA-Z0-9].
|
||||
#Nickname ididnteditheconfig
|
||||
|
||||
## Define these to limit how much relayed traffic you will allow. Your
|
||||
|
@ -98,6 +98,8 @@
|
||||
# OutboundBindAddress 10.0.0.5
|
||||
|
||||
## A handle for your relay, so people don't have to refer to it by key.
|
||||
## Nicknames must be between 1 and 19 characters inclusive, and must
|
||||
## contain only the characters [a-zA-Z0-9].
|
||||
#Nickname ididnteditheconfig
|
||||
|
||||
## Define these to limit how much relayed traffic you will allow. Your
|
||||
|
@ -2796,7 +2796,8 @@ options_validate(or_options_t *old_options, or_options_t *options,
|
||||
} else {
|
||||
if (!is_legal_nickname(options->Nickname)) {
|
||||
tor_asprintf(msg,
|
||||
"Nickname '%s' is wrong length or contains illegal characters.",
|
||||
"Nickname '%s', nicknames must be between 1 and 19 characters "
|
||||
"inclusive, and must contain only the characters [a-zA-Z0-9].",
|
||||
options->Nickname);
|
||||
return -1;
|
||||
}
|
||||
|
@ -513,8 +513,9 @@ test_options_validate__nickname(void *ignored)
|
||||
ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
|
||||
tt_int_op(ret, OP_EQ, -1);
|
||||
tt_str_op(msg, OP_EQ,
|
||||
"Nickname 'ThisNickNameIsABitTooLong' is wrong length or"
|
||||
" contains illegal characters.");
|
||||
"Nickname 'ThisNickNameIsABitTooLong', nicknames must be between "
|
||||
"1 and 19 characters inclusive, and must contain only the "
|
||||
"characters [a-zA-Z0-9].");
|
||||
tor_free(msg);
|
||||
|
||||
free_options_test_data(tdata);
|
||||
|
Loading…
Reference in New Issue
Block a user