aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/config.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 7434dfd2f..799eb9796 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -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 */