commit cd606d5ad36136cb7e66ac462ea945ceb3a9a7f7 Merge: e79d74072 f1bf9bf81 Author: Nick Mathewson nickm@torproject.org Date: Wed Nov 1 13:28:31 2017 -0400
Merge remote-tracking branch 'public/owning_control_fd'
changes/ticket23900 | 7 +++++++ src/common/compat.c | 20 ++++++++++++++------ src/common/compat.h | 1 + src/or/config.c | 25 +++++++++++++++++++++++++ src/or/connection.c | 8 +++++--- src/or/connection.h | 3 ++- src/or/control.c | 43 +++++++++++++++++++++++++++++++++++++++++++ src/or/control.h | 4 ++++ src/or/or.h | 2 ++ 9 files changed, 103 insertions(+), 10 deletions(-)
diff --cc src/or/config.c index c4d2062c8,acc31c011..b09603f5c --- a/src/or/config.c +++ b/src/or/config.c @@@ -1770,9 -1729,26 +1771,27 @@@ options_act(const or_options_t *old_opt log_warn(LD_BUG, "Previously validated client authorization for " "hidden services could not be added!"); return -1; + // LCOV_EXCL_STOP }
+ if (running_tor && !old_options && options->OwningControllerFD != -1) { + #ifdef _WIN32 + log_warn(LD_CONFIG, "OwningControllerFD is not supported on Windows. " + "If you neeed it, tell the Tor developers."); + return -1; + #else + const unsigned ctrl_flags = + CC_LOCAL_FD_IS_OWNER | + CC_LOCAL_FD_IS_AUTHENTICATED; + tor_socket_t ctrl_sock = (tor_socket_t)options->OwningControllerFD; + if (control_connection_add_local_fd(ctrl_sock, ctrl_flags) < 0) { + log_warn(LD_CONFIG, "Could not add local controller connection with " + "given FD."); + return -1; + } + #endif + } + /* Load state */ if (! or_state_loaded() && running_tor) { if (or_state_load())
tor-commits@lists.torproject.org