mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
hey, we have a function for that
svn:r4781
This commit is contained in:
parent
3728011f36
commit
79e3f5600a
@ -1533,18 +1533,8 @@ options_validate(or_options_t *options)
|
||||
log_fn(LOG_NOTICE, "Choosing default nickname %s", options->Nickname);
|
||||
}
|
||||
} 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 (strlen(options->Nickname) == 0) {
|
||||
log_fn(LOG_WARN, "Nickname must have at least one character");
|
||||
result = -1;
|
||||
}
|
||||
if (strlen(options->Nickname) > MAX_NICKNAME_LEN) {
|
||||
log_fn(LOG_WARN, "Nickname '%s' has more than %d characters.",
|
||||
options->Nickname, MAX_NICKNAME_LEN);
|
||||
if (!is_legal_nickname(options->Nickname)) {
|
||||
log_fn(LOG_WARN, "Nickname '%s' is wrong length or contains illegal characters.", options->Nickname);
|
||||
result = -1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user