mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 13:43:47 +01:00
disallow changing from ORPort==0 to ORPort>0 on hup
svn:r1172
This commit is contained in:
parent
928db6dadc
commit
c058f87513
@ -400,6 +400,7 @@ int getconfig(int argc, char **argv, or_options_t *options) {
|
|||||||
static int backup_argc;
|
static int backup_argc;
|
||||||
char *previous_pidfile = NULL;
|
char *previous_pidfile = NULL;
|
||||||
int previous_runasdaemon = 0;
|
int previous_runasdaemon = 0;
|
||||||
|
int previous_orport = -1;
|
||||||
int using_default_torrc;
|
int using_default_torrc;
|
||||||
|
|
||||||
if(first_load) { /* first time we're called. save commandline args */
|
if(first_load) { /* first time we're called. save commandline args */
|
||||||
@ -414,6 +415,7 @@ int getconfig(int argc, char **argv, or_options_t *options) {
|
|||||||
if(options->PidFile)
|
if(options->PidFile)
|
||||||
previous_pidfile = tor_strdup(options->PidFile);
|
previous_pidfile = tor_strdup(options->PidFile);
|
||||||
previous_runasdaemon = options->RunAsDaemon;
|
previous_runasdaemon = options->RunAsDaemon;
|
||||||
|
previous_orport = options->ORPort;
|
||||||
free_options(options);
|
free_options(options);
|
||||||
}
|
}
|
||||||
init_options(options);
|
init_options(options);
|
||||||
@ -476,6 +478,11 @@ int getconfig(int argc, char **argv, or_options_t *options) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(previous_orport == 0 && options->ORPort > 0) {
|
||||||
|
log_fn(LOG_WARN,"During reload, change from ORPort=0 to =%d not allowed. Failing.",options->ORPort);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if(options->LogLevel) {
|
if(options->LogLevel) {
|
||||||
if(!strcmp(options->LogLevel,"err"))
|
if(!strcmp(options->LogLevel,"err"))
|
||||||
options->loglevel = LOG_ERR;
|
options->loglevel = LOG_ERR;
|
||||||
|
Loading…
Reference in New Issue
Block a user