Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 456924

Summary: net-proxy/tsocks-1.8_beta5-r6 fails to properly support strict multilib
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Andrew Savchenko <bircoph>
Status: RESOLVED FIXED    
Severity: normal CC: bircoph
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-02-12 12:47:33 UTC
The package installs its libraries to $(get_libdir) but looks for them in /lib. This fails on a system where host libdir != 'lib' (e.g. the 'proper' multilib).

$ tsocks mosh 127.0.0.1
ERROR: ld.so: object '/lib/libtsocks.so' from LD_PRELOAD cannot be preloaded: ignored.

$ qlist tsocks | grep lib
/lib64/libtsocks.so.1
/lib64/libtsocks.so
/lib64/libtsocks.so.1.8
Comment 1 Marien Zwart (RETIRED) gentoo-dev 2013-09-02 11:33:43 UTC
I suspect the right thing for tsocks to do is to omit the path completely from LD_PRELOAD. 

It's currently setting LD_PRELOAD=/lib/libtsocks.so. My ld.so(8) says the usual search rules are used for LD_PRELOAD, which means a name with a "/" in it is treated as a path, but one without is looked up in ld.so.cache and friends, and sure enough LD_PRELOAD=libtsocks.so.1 seems to load it. 

The advantage (I haven't tested this bit) is it has a chance to work on a multilib system: if you install a 32-bit and 64-bit libtsocks.so.1 in their respective libdirs LD_PRELOAD=libtsocks.so.1 *should* do the right thing whether the binary invoked is 32-bit or 64-bit.
Comment 2 Yixun Lan archtester gentoo-dev 2013-09-02 15:05:03 UTC
(In reply to Marien Zwart from comment #1)
> I suspect the right thing for tsocks to do is to omit the path completely
> from LD_PRELOAD. 
correct

> 
> It's currently setting LD_PRELOAD=/lib/libtsocks.so. My ld.so(8) says the
> usual search rules are used for LD_PRELOAD, which means a name with a "/" in
> it is treated as a path, but one without is looked up in ld.so.cache and
> friends, and sure enough LD_PRELOAD=libtsocks.so.1 seems to load it. 
correct, I've tested this, it just works

> 
> The advantage (I haven't tested this bit) is it has a chance to work on a
> multilib system: if you install a 32-bit and 64-bit libtsocks.so.1 in their
> respective libdirs LD_PRELOAD=libtsocks.so.1 *should* do the right thing
> whether the binary invoked is 32-bit or 64-bit.

haven't tested this, but probably you are right here.
Comment 3 Andrew Savchenko gentoo-dev 2015-01-09 17:02:12 UTC
Fixed in tsocks-1.8_beta5-r7 (at least works for me on both ~amd64 and ~x86).