Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mike Perry
Tor
Commits
20f802ea
Commit
20f802ea
authored
Dec 15, 2017
by
Nick Mathewson
👁
Browse files
Add an option to disable signal handler installation.
Closes ticket 24588.
parent
fdd57348
Changes
4
Hide whitespace changes
Inline
Side-by-side
changes/ticket24588
0 → 100644
View file @
20f802ea
o Minor features (embedding, mobile):
- Applications that want to embed Tor can now tell Tor not to register
any of its own POSIX signal handlers, using the __DisableSignalHandlers
option. This option is not meant for general use. Closes ticket 24588.
src/or/config.c
View file @
20f802ea
...
...
@@ -564,6 +564,7 @@ static config_var_t option_vars_[] = {
VAR
(
"__ReloadTorrcOnSIGHUP"
,
BOOL
,
ReloadTorrcOnSIGHUP
,
"1"
),
VAR
(
"__AllDirActionsPrivate"
,
BOOL
,
AllDirActionsPrivate
,
"0"
),
VAR
(
"__DisablePredictedCircuits"
,
BOOL
,
DisablePredictedCircuits
,
"0"
),
VAR
(
"__DisableSignalHandlers"
,
BOOL
,
DisableSignalHandlers
,
"0"
),
VAR
(
"__LeaveStreamsUnattached"
,
BOOL
,
LeaveStreamsUnattached
,
"0"
),
VAR
(
"__HashedControlSessionPassword"
,
LINELIST
,
HashedControlSessionPassword
,
NULL
),
...
...
@@ -4652,6 +4653,12 @@ options_transition_allowed(const or_options_t *old,
return
-
1
;
}
if
(
old
->
DisableSignalHandlers
!=
new_val
->
DisableSignalHandlers
)
{
*
msg
=
tor_strdup
(
"While Tor is running, changing DisableSignalHandlers "
"is not allowed."
);
return
-
1
;
}
if
(
strcmp
(
old
->
DataDirectory
,
new_val
->
DataDirectory
)
!=
0
)
{
tor_asprintf
(
msg
,
"While Tor is running, changing DataDirectory "
...
...
src/or/main.c
View file @
20f802ea
...
...
@@ -3057,8 +3057,10 @@ void
handle_signals
(
void
)
{
int
i
;
const
int
enabled
=
!
get_options
()
->
DisableSignalHandlers
;
for
(
i
=
0
;
signal_handlers
[
i
].
signal_value
>=
0
;
++
i
)
{
if
(
signal_handlers
[
i
].
try_to_register
)
{
if
(
enabled
&&
signal_handlers
[
i
].
try_to_register
)
{
signal_handlers
[
i
].
signal_event
=
tor_evsignal_new
(
tor_libevent_get_base
(),
signal_handlers
[
i
].
signal_value
,
...
...
src/or/or.h
View file @
20f802ea
...
...
@@ -4651,6 +4651,11 @@ typedef struct {
/** List of files that were opened by %include in torrc and torrc-defaults */
smartlist_t
*
FilesOpenedByIncludes
;
/** If true, Tor shouldn't install any posix signal handlers, since it is
* running embedded inside another process.
*/
int
DisableSignalHandlers
;
}
or_options_t
;
#define LOG_PROTOCOL_WARN (get_protocol_warning_severity_level())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment