[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Stop DataDirectory from changing; also stop using new as an...
- To: or-cvs@freehaven.net
- Subject: [or-cvs] Stop DataDirectory from changing; also stop using new as an...
- From: nickm@seul.org (Nick Mathewson)
- Date: Mon, 8 Nov 2004 23:46:27 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Mon, 08 Nov 2004 23:46:43 -0500
- Reply-to: or-dev@freehaven.net
- Sender: owner-or-cvs@freehaven.net
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv28183/src/or
Modified Files:
config.c
Log Message:
Stop DataDirectory from changing; also stop using new as an identifier?
Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -d -r1.218 -r1.219
--- config.c 9 Nov 2004 04:28:17 -0000 1.218
+++ config.c 9 Nov 2004 04:46:24 -0000 1.219
@@ -1180,27 +1180,35 @@
/** Check if any of the previous options have changed but aren't allowed to. */
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)
return 0;
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.");
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.");
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.");
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;
}