mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Stop DataDirectory from changing; also stop using new as an identifier?
svn:r2717
This commit is contained in:
parent
90b47172bd
commit
929b172955
@ -1180,27 +1180,35 @@ options_validate(or_options_t *options)
|
|||||||
|
|
||||||
/** Check if any of the previous options have changed but aren't allowed to. */
|
/** Check if any of the previous options have changed but aren't allowed to. */
|
||||||
static int
|
static int
|
||||||
options_transition_allowed(or_options_t *old, or_options_t *new) {
|
options_transition_allowed(or_options_t *old, or_options_t *new_val) {
|
||||||
|
|
||||||
if(!old)
|
if(!old)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (old->PidFile &&
|
if (old->PidFile &&
|
||||||
(!new->PidFile || strcmp(old->PidFile,new->PidFile))) {
|
(!new_val->PidFile || strcmp(old->PidFile,new_val->PidFile))) {
|
||||||
log_fn(LOG_WARN,"PidFile is not allowed to change. Failing.");
|
log_fn(LOG_WARN,"PidFile is not allowed to change. Failing.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old->RunAsDaemon && !new->RunAsDaemon) {
|
if (old->RunAsDaemon && !new_val->RunAsDaemon) {
|
||||||
log_fn(LOG_WARN,"During reload, change from RunAsDaemon=1 to =0 not allowed. Failing.");
|
log_fn(LOG_WARN,"During reload, change from RunAsDaemon=1 to =0 not allowed. Failing.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old->ORPort != new->ORPort) {
|
if (old->ORPort != new_val->ORPort) {
|
||||||
log_fn(LOG_WARN,"During reload, changing ORPort is not allowed. Failing.");
|
log_fn(LOG_WARN,"During reload, changing ORPort is not allowed. Failing.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((old->DataDirectory &&
|
||||||
|
(!new_val->DataDirectory ||
|
||||||
|
strcmp(old->DataDirectory,new_val->DataDirectory)!=0)) ||
|
||||||
|
(!old->DataDirectory && new_val->DataDirectory)) {
|
||||||
|
log_fn(LOG_WARN,"During reload, changing DataDirectory is not allowed. Failing.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user