diff options
author | Roger Dingledine <arma@torproject.org> | 2004-02-28 23:30:41 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-02-28 23:30:41 +0000 |
commit | c058f875131fd68ae5c3f548a35b0dec85eebad7 (patch) | |
tree | 43a42eb880757fe23e6bd96874154159f5d54e7e /src | |
parent | 928db6dadc7609213247f1fd6a39884e7b66eaa1 (diff) | |
download | tor-c058f875131fd68ae5c3f548a35b0dec85eebad7.tar tor-c058f875131fd68ae5c3f548a35b0dec85eebad7.tar.gz |
disallow changing from ORPort==0 to ORPort>0 on hup
svn:r1172
Diffstat (limited to 'src')
-rw-r--r-- | src/or/config.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index f540b1e55..86836a411 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -400,6 +400,7 @@ int getconfig(int argc, char **argv, or_options_t *options) { static int backup_argc; char *previous_pidfile = NULL; int previous_runasdaemon = 0; + int previous_orport = -1; int using_default_torrc; 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) previous_pidfile = tor_strdup(options->PidFile); previous_runasdaemon = options->RunAsDaemon; + previous_orport = options->ORPort; free_options(options); } init_options(options); @@ -476,6 +478,11 @@ int getconfig(int argc, char **argv, or_options_t *options) { 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(!strcmp(options->LogLevel,"err")) options->loglevel = LOG_ERR; |