mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 05:03:43 +01:00
warn and fail if server chose a nickname with illegal characters
svn:r1318
This commit is contained in:
parent
4f0bad280d
commit
568a4e0a04
@ -568,9 +568,15 @@ int getconfig(int argc, char **argv, or_options_t *options) {
|
||||
result = -1;
|
||||
}
|
||||
|
||||
if(options->ORPort && options->Nickname == NULL) {
|
||||
log_fn(LOG_WARN,"Nickname required if ORPort is set, but not found.");
|
||||
result = -1;
|
||||
if (options->ORPort) {
|
||||
if (options->Nickname == NULL) {
|
||||
log_fn(LOG_WARN,"Nickname required if ORPort is set, but not found.");
|
||||
result = -1;
|
||||
} else if (strspn(options->Nickname, LEGAL_NICKNAME_CHARACTERS) !=
|
||||
strlen(options->Nickname)) {
|
||||
log_fn(LOG_WARN, "Nickname '%s' contains illegal characters.", options->Nickname);
|
||||
result = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if(options->ORPort) { /* get an IP for ourselves */
|
||||
|
Loading…
Reference in New Issue
Block a user