Here is written that curlftpfs
is terribly slow because of bug in newest libcurl3-gnutls
. Downgrading is not recommended due to large reverse dependencies that this package has (can be verified via apt-cache showpkg libcurl3-gnutls:amd64
or apt-cache rdepends libcurl3-gnutls:amd64
). So I've decided to downgrade it different way. I've checked available versions in repository:
$ apt-cache policy libcurl3-gnutls:amd64
libcurl3-gnutls:
Installed: 7.43.0-1ubuntu2.1
Candidate: 7.43.0-1ubuntu2.1
Version table:
*** 7.43.0-1ubuntu2.1 0
500 http://sk.archive.ubuntu.com/ubuntu/ wily-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ wily-security/main amd64 Packages
100 /var/lib/dpkg/status
7.43.0-1ubuntu2 0
500 http://sk.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
Then I've downloaded and extracted older version than installed one:
$ apt-get install -d libcurl3-gnutls=7.43.0-1ubuntu2
$ sudo mv /var/cache/apt/archives/libcurl3-gnutls_7.43.0-1ubuntu2_amd64.deb .
$ dpkg -x libcurl3-gnutls_7.43.0-1ubuntu2_amd64.deb extracted_deb
Then I've backed up original binary and searched for some common name in shared libraries:
$ cp $(which curlftpfs) .
$ ldd ./curlftpfs | grep curl
libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007fcac4443000)
$ readelf -d ./curlftpfs | grep -i curl
0x0000000000000001 (NEEDED) Shared library: [libcurl-gnutls.so.4]
Following step was just the proof that linked file belongs exactly to libcurl3-gnutls
package and that curlftpfs
depends on libcurl3-gnutls
:
$ dpkg -S /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
libcurl3-gnutls:amd64: /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
$ apt-cache depends curlftpfs
curlftpfs
Depends: libc6
Depends: libcurl3-gnutls
Depends: libfuse2
Depends: libglib2.0-0
Depends: fuse
Conflicts: curlftpfs:i386
Also the content of extracted and installed libcurl3-gnutls
package seems exactly the same:
$ dpkg -L libcurl3-gnutls:amd64 | sort
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.3.0
/usr/share
/usr/share/doc
/usr/share/doc/libcurl3-gnutls
/usr/share/doc/libcurl3-gnutls/changelog.Debian.gz
/usr/share/doc/libcurl3-gnutls/copyright
/usr/share/doc/libcurl3-gnutls/NEWS.Debian.gz
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libcurl3-gnutls
$ find extracted_deb/ | sort
extracted/
extracted/usr
extracted/usr/lib
extracted/usr/lib/x86_64-linux-gnu
extracted/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
extracted/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
extracted/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.3.0
extracted/usr/share
extracted/usr/share/doc
extracted/usr/share/doc/libcurl3-gnutls
extracted/usr/share/doc/libcurl3-gnutls/changelog.Debian.gz
extracted/usr/share/doc/libcurl3-gnutls/copyright
extracted/usr/share/doc/libcurl3-gnutls/NEWS.Debian.gz
extracted/usr/share/lintian
extracted/usr/share/lintian/overrides
extracted/usr/share/lintian/overrides/libcurl3-gnutls
My question is how can I rewrite the path that is contained in ldd
output and point it to file that I've extracted? I've read about rpath
and patchelf
and chrpath
here and here but I guess this is not my case because following commands returns nothing useful:
$ readelf -d ./curlftpfs | grep -i rpath
$
$ chrpath -l ./curlftpfs
./curlftpfs: no rpath or runpath tag found.
$
$ patchelf --print-rpath ./curlftpfs
$
So it seems that rpath
is not used. I've also read about $LD_LIBRARY_PRELOAD
but I guess that it will change path for all shared libraries for given binary not just one particular (in my case /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
) so I would need to have whole tree of libraries. There is also solutions which suggest changing loader (in my example /lib64/ld-linux-x86-64.so.2
I guess):
$ patchelf --print-interpreter ./curlftpfs
/lib64/ld-linux-x86-64.so.2
$
$ ldd ./curlftpfs | grep ld-linux
/lib64/ld-linux-x86-64.so.2 (0x0000564966b64000)
$
$ ls -laL /lib/x86_64-linux-gnu/ld-2.21.so
-rwxr-xr-x 1 root root 154376 Mar 26 2015 /lib/x86_64-linux-gnu/ld-2.21.so
but to be honest I didn't get the point of this. Can you please assists?