|
@@ -409,6 +409,7 @@ static config_var_t option_vars_[] = {
|
|
|
OBSOLETE("PredictedPortsRelevanceTime"),
|
|
|
OBSOLETE("WarnUnsafeSocks"),
|
|
|
VAR("NodeFamily", LINELIST, NodeFamilies, NULL),
|
|
|
+ V(NoExec, BOOL, "0"),
|
|
|
V(NumCPUs, UINT, "0"),
|
|
|
V(NumDirectoryGuards, UINT, "0"),
|
|
|
V(NumEntryGuards, UINT, "0"),
|
|
@@ -1595,6 +1596,10 @@ options_act(const or_options_t *old_options)
|
|
|
const int transition_affects_guards =
|
|
|
old_options && options_transition_affects_guards(old_options, options);
|
|
|
|
|
|
+ if (options->NoExec || options->Sandbox) {
|
|
|
+ tor_disable_spawning_background_processes();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
{
|
|
|
|
|
@@ -3570,6 +3575,10 @@ options_validate(or_options_t *old_options, or_options_t *options,
|
|
|
REJECT("PortForwarding is not compatible with Sandbox; at most one can "
|
|
|
"be set");
|
|
|
}
|
|
|
+ if (options->PortForwarding && options->NoExec) {
|
|
|
+ COMPLAIN("Both PortForwarding and NoExec are set; PortForwarding will "
|
|
|
+ "be ignored.");
|
|
|
+ }
|
|
|
|
|
|
if (ensure_bandwidth_cap(&options->BandwidthRate,
|
|
|
"BandwidthRate", msg) < 0)
|
|
@@ -4447,6 +4456,12 @@ options_transition_allowed(const or_options_t *old,
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
+ if (old->NoExec && !new_val->NoExec) {
|
|
|
+ *msg = tor_strdup("While Tor is running, disabling "
|
|
|
+ "NoExec is not allowed.");
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
if (sandbox_is_active()) {
|
|
|
#define SB_NOCHANGE_STR(opt) \
|
|
|
do { \
|
|
@@ -5726,6 +5741,15 @@ parse_transport_line(const or_options_t *options,
|
|
|
goto err;
|
|
|
}
|
|
|
|
|
|
+ if (is_managed && options->NoExec) {
|
|
|
+ log_warn(LD_CONFIG,
|
|
|
+ "Managed proxies are not compatible with NoExec mode; ignoring."
|
|
|
+ "(%sTransportPlugin line was %s)",
|
|
|
+ server ? "Server" : "Client", escaped(line));
|
|
|
+ r = 0;
|
|
|
+ goto done;
|
|
|
+ }
|
|
|
+
|
|
|
if (is_managed) {
|
|
|
|
|
|
|