[Pkg-privacy-maintainers] Bug#902792: torsocks: does not support and fails catastrophically with muliarch
Helmut Grohne
helmut at subdivi.de
Fri Mar 7 06:57:19 GMT 2025
On Fri, Mar 07, 2025 at 12:48:43AM +0100, Hefee wrote:
> I still don't understand, how this can work. BUt maybe torsocks shell was changed in meanwhile... I now more or less understand the fakeroot approch and will go that path.
I don't think it answere how it can work. It is more like a constraint
on the solution space. Whatever the solution looks like, the package
containing libtorsocks.so must be marked M-A:same or it is not a
solution. You are right in saying that just attaching M-A:same is not
right, so some pieces are missing here.
> Well as libtorsocks is a internal library, that does not even ship a abi numer ( only .so) I think this should been kept in a own directory.
In principle, you are right about this.
> The way I see now to get torsocks script ready is:
> * change LD_PRELOAD="libtorsocks.so" within torsocks script
> * ship a ld.so.conf.d snippet (named torsocks-<tripplet>.conf) within libtorsocks:any
Once you ship this snippet, your private directory no longer is private
at all. It ends up on the default library search path used by all
programs. That kinda is the choice here. If we want to specify
LD_PRELOAD without a full path (and we have to if we want to support
multiple architectures), libtorsocks.so must reside on the search path.
Once we opt into that compromise, is there actually much downside in
installing it to /usr/lib/<triplet> directly?
> * mark torsocks as Arch:all and M-A:foreign
I hope this implies splitting libtorsocks.so into a libtorsocks M-A:same
package.
> => I tested this on my own laptop and it works ;)
>
> fakeroot does not make it easy to spot onto relevant parts, as it is obvious not 100% multi-arch ready. fakeroot ships a amd64 path within the shell script. In the concequence $ABSLIB at least not work for multi-arch. but this ABSPATH is not used by default..., because USEABSLIBPATH == 0.
>
> /usr/bin/fakeroot:amd64
>
> #l37
> FAKEROOT_LIB=libfakeroot-sysv.so
> PATHS=/usr/lib/x86_64-linux-gnu/libfakeroot:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
>
> #l1113
> for dir in `echo $PATHS | sed 's/:/ /g'`
> do
> if test -r "$dir/$FAKEROOT_LIB"
> then
> libfound=yes
> ABSLIB="$dir/$FAKEROOT_LIB"
> fi
> done
I agree that fakeroot is more complex than it needs to be here and
expect that you can write the torsocks wrapper without mentioning any
architectures such that you should be able to turn torsocks M-A:same
directly and having /usr/bin/torsocks shared between the instances.
Helmut
More information about the Pkg-privacy-maintainers
mailing list