aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorRobert Ransom <rransom.8774@gmail.com>2011-05-15 08:23:04 -0700
committerRobert Ransom <rransom.8774@gmail.com>2011-05-20 08:25:42 -0700
commit4b266c6e72254d848b2ca4f594c0b41770104d81 (patch)
tree80da149fd30030dbfbb449076d6ec0c5ab6dd133 /src/or/config.c
parentc714a098ea96fcd452a223ce7bbc6bfa2a6f0d02 (diff)
downloadtor-4b266c6e72254d848b2ca4f594c0b41770104d81.tar
tor-4b266c6e72254d848b2ca4f594c0b41770104d81.tar.gz
Implement __OwningControllerProcess option
Implements part of feature 3049.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 34208e85b..b2bc9f3e9 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -38,6 +38,8 @@
#include <shlobj.h>
#endif
+#include "procmon.h"
+
/** Enumeration of types which option values can take */
typedef enum config_type_t {
CONFIG_TYPE_STRING = 0, /**< An arbitrary string. */
@@ -393,6 +395,7 @@ static config_var_t _option_vars[] = {
VAR("__LeaveStreamsUnattached",BOOL, LeaveStreamsUnattached, "0"),
VAR("__HashedControlSessionPassword", LINELIST, HashedControlSessionPassword,
NULL),
+ VAR("__OwningControllerProcess",STRING,OwningControllerProcess, NULL),
V(MinUptimeHidServDirectoryV2, INTERVAL, "24 hours"),
V(_UsingTestNetworkDefaults, BOOL, "0"),
@@ -1229,6 +1232,11 @@ options_act(or_options_t *old_options)
return -1;
}
+ if (monitor_owning_controller_process(options->OwningControllerProcess)) {
+ log_warn(LD_CONFIG, "Error monitoring owning controller process");
+ return -1;
+ }
+
/* reload keys as needed for rendezvous services. */
if (rend_service_load_keys()<0) {
log_warn(LD_GENERAL,"Error loading rendezvous service keys");
@@ -3446,6 +3454,16 @@ options_validate(or_options_t *old_options, or_options_t *options,
}
}
+ if (options->OwningControllerProcess) {
+ const char *validate_pspec_msg = NULL;
+ if (tor_validate_process_specifier(options->OwningControllerProcess,
+ &validate_pspec_msg)) {
+ tor_asprintf(msg, "Bad OwningControllerProcess: %s",
+ validate_pspec_msg);
+ return -1;
+ }
+ }
+
if (options->ControlListenAddress) {
int all_are_local = 1;
config_line_t *ln;