Opened 6 years ago

Closed 6 years ago

#9030 closed defect (fixed)

tor-fw-helper confused exit code

Reported by: arlolra Owned by:
Priority: Medium Milestone: Tor: 0.2.5.x-final
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

On success, it's returning the number of initialized backends. That doesn't seem right.

Child Tickets

Attachments (1)

0001-Fix-tor-fw-helper-exit-code.patch (711 bytes) - added by arlolra 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by arlolra

comment:1 Changed 6 years ago by arma

Status: newneeds_review

comment:2 Changed 6 years ago by nickm

Seems fine by me as long as we aren't assuming this behavior. I've looked at the code in src/common/util.c's tor_check_port_forwarding, and the

      /* TODO: Do something with the process return value */

line seems to confirm that we aren't requiring the current silly behavior. Have you tested this, though?

comment:3 Changed 6 years ago by nickm

Milestone: Tor: 0.2.5.x-final

comment:4 Changed 6 years ago by arlolra

For testing, I compiled with --enable-upnp. Ran make test and got 150 tests ok. (1 skipped).

Then tried tor-fw-helper -p :8000,

tor-fw-helper: UPnP GetValidIGD returned: 1 (SUCCESS)
tor-fw-helper: 1 NAT traversal helper(s) loaded
tor-fw-helper tcp-forward 8000 8000 SUCCESS miniupnp`

Which added 8000 from my port mappings.

Then configured torrc with,

PortForwarding 1
PortForwardingHelper tor-fw-helper
ORPort 9001

Tor ran without error and 9001 was mapped.

comment:5 Changed 6 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Thanks! I've added a changes file and a reference to the bug number, and committed it as 6fc3997307b1a2729dcc651102e79b195698b6af

Note: See TracTickets for help on using tickets.