[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #18686 [Tor]: tor port forwarding claims to kill long-dead forwarder
#18686: tor port forwarding claims to kill long-dead forwarder
------------------------+------------------------------------
Reporter: chadmiller | Owner: nickm
Type: defect | Status: needs_review
Priority: Medium | Milestone: Tor: 0.2.8.x-final
Component: Tor | Version: Tor: 0.2.7.6
Severity: Major | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
------------------------+------------------------------------
Comment (by dgoulet):
Replying to [comment:3 nickm]:
> Would this patch be sufficient?
>
> {{{
> diff --git a/src/common/util.c b/src/common/util.c
> index 2351faf5036e44..b932d7310f97de 100644
> --- a/src/common/util.c
> +++ b/src/common/util.c
> @@ -3949,7 +3949,7 @@ tor_terminate_process(process_handle_t
*process_handle)
> }
> #endif
>
> - return -1;
> + return 0; /* We decided not to kill the process, so report success.
*/
> }
>
> /** Return the Process ID of <b>process_handle</b>. */
> }}}
I'm not entirely sure here. Returning 0 indicate that a termination signal
has been sent to the process. It's what the caller should expect because
kill(2) returns 0 on success with "at least one signal was sent"
guarantee.
It would indeed fix the issue I believe but it just seems wrong and might
be error prone in the future. Lucky for us, there is only one callsite for
`tor_terminate_process` so what about it returns 1 indicating that nothing
was done. 0 would be the success and -1 a syscall error?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/18686#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs