Opened 2 years ago

Last modified 8 months ago

#28538 new defect

[regression] torsocks uses linux-specific tsocks_libc_accept4 on FreeBSD

Reported by: yurivict271 Owned by:
Priority: High Milestone:
Component: Core Tor/Torsocks Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: dgoulet Sponsor:


See src/lib/torsocks.c.

Version 2.3.0

torsocks.c:237:2: error: use of undeclared identifier 'tsocks_libc_accept4'; did you mean 'tsocks_libc_accept'?
        tsocks_libc_accept4 = dlsym(libc_ptr, LIBC_ACCEPT4_NAME_STR);
./torsocks.h:411:8: note: 'tsocks_libc_accept' declared here
./torsocks.h:34:9: note: expanded from macro 'TSOCKS_LIBC_DECL'
        type (*tsocks_libc_##name)(sig);
<scratch space>:55:1: note: expanded from here
torsocks.c:237:40: error: use of undeclared identifier 'LIBC_ACCEPT4_NAME_STR'
        tsocks_libc_accept4 = dlsym(libc_ptr, LIBC_ACCEPT4_NAME_STR);
torsocks.c:239:53: error: use of undeclared identifier 'tsocks_libc_accept4'; did you mean 'tsocks_libc_accept'?
                        !tsocks_libc_syscall || !tsocks_libc_execve || ! tsocks_libc_accept4) {

Child Tickets

Attachments (1)

0001-Fix-macros-for-accept4-2.patch (1.8 KB) - added by iology 18 months ago.
Maybe a better fix

Download all attachments as: .zip

Change History (9)

comment:1 Changed 2 years ago by dgoulet

Status: newneeds_information
Version: Tor: unspecified

Aarrg... yeah accept4() is defined only for Linux...

I believe only OS X doesn't have it so can you test this branch to at least see if FreeBSD works:

I'll try to find someone with OS X to test it. Thanks!

comment:2 Changed 22 months ago by onirony

Status: needs_informationneeds_review

I do use OS X and that patch works fine!

Last edited 22 months ago by onirony (previous) (diff)

comment:3 Changed 21 months ago by ak


There is still no working release of torsocks 2.3 on OS X

comment:4 Changed 21 months ago by ak

Priority: MediumHigh

Changed 18 months ago by iology

Maybe a better fix

comment:5 Changed 18 months ago by iology

I just uploaded my patch. This ticket said FreeBSD didn't have accept4(2) and I was running torsocks on MacOS 10.11.6, so I went conservative and only kept accept4 on linux.

comment:6 Changed 18 months ago by nickm

Reviewer: dgoulet

Setting dgoulet as reviewer, in case he has time.

comment:7 Changed 17 months ago by gaba

Owner: dgoulet deleted
Status: needs_reviewassigned

removing dgoulet from ownership in torsocks component

comment:8 Changed 8 months ago by teor

Status: assignednew

Change tickets that are assigned to nobody to "new".

Note: See TracTickets for help on using tickets.