Opened 6 months ago

Last modified 4 weeks ago

#28538 needs_review defect

[regression] torsocks uses linux-specific tsocks_libc_accept4 on FreeBSD

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

Description

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);
        ^~~~~~~~~~~~~~~~~~~
        tsocks_libc_accept
./torsocks.h:411:8: note: 'tsocks_libc_accept' declared here
extern TSOCKS_LIBC_DECL(accept, LIBC_ACCEPT_RET_TYPE, LIBC_ACCEPT_SIG)
       ^
./torsocks.h:34:9: note: expanded from macro 'TSOCKS_LIBC_DECL'
        type (*tsocks_libc_##name)(sig);
               ^
<scratch space>:55:1: note: expanded from here
tsocks_libc_accept
^
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) {
                                                                         ^~~~~~~~~~~~~~~~~~~
                                                                         tsocks_libc_accept

Child Tickets

Attachments (1)

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

Download all attachments as: .zip

Change History (7)

comment:1 Changed 6 months 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:
https://gitweb.torproject.org/user/dgoulet/torsocks.git/log/?h=ticket28538_01

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

comment:2 Changed 5 months ago by onirony

Status: needs_informationneeds_review

I do use OS X and that patch works fine!

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

comment:3 Changed 4 months ago by ak

ping.

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

comment:4 Changed 4 months ago by ak

Priority: MediumHigh

Changed 5 weeks ago by iology

Maybe a better fix

comment:5 Changed 5 weeks 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 4 weeks ago by nickm

Reviewer: dgoulet

Setting dgoulet as reviewer, in case he has time.

Note: See TracTickets for help on using tickets.