Commit 568a4e0a authored by Roger Dingledine's avatar Roger Dingledine
Browse files

warn and fail if server chose a nickname with illegal characters


svn:r1318
parent 4f0bad28
...@@ -568,9 +568,15 @@ int getconfig(int argc, char **argv, or_options_t *options) { ...@@ -568,9 +568,15 @@ int getconfig(int argc, char **argv, or_options_t *options) {
result = -1; result = -1;
} }
if(options->ORPort && options->Nickname == NULL) { if (options->ORPort) {
log_fn(LOG_WARN,"Nickname required if ORPort is set, but not found."); if (options->Nickname == NULL) {
result = -1; 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 */ if(options->ORPort) { /* get an IP for ourselves */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment