[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] disallow changing from ORPort==0 to ORPort>0 on hup



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	config.c 
Log Message:
disallow changing from ORPort==0 to ORPort>0 on hup


Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- config.c	28 Feb 2004 07:01:22 -0000	1.86
+++ config.c	28 Feb 2004 23:30:41 -0000	1.87
@@ -400,6 +400,7 @@
   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 @@
     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 @@
     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;