summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMart Raudsepp <leio@gentoo.org>2018-12-13 20:29:05 +0200
committerBastien Nocera <hadess@hadess.net>2019-01-30 11:33:01 +0100
commit77d37aa98ce1f069669ad4f9f925563de94afe06 (patch)
tree57db33f84b276868a21b4e66604e01c58f1a29ea
parent986c0ed9b7b7fb780e0629d002373b4945dfb187 (diff)
downloadgnome-desktop-77d37aa98ce1f069669ad4f9f925563de94afe06.tar.gz
thumbnail: bind mount /etc/ld.so.cache to the sandbox
This is especially important for libstdc++ on distributions that don't have it directly in a libdir and the runtime linker doesn't look where needed without /etc/ld.so.cache (e.g. if libstdc++ is in a GCC per-version subdirectory handled via /etc/ld.so.conf.d/). If /etc/ld.so.cache is not available, the runtime linker will look only at a set of predetermined paths - as seen with LD_DEBUG=libs added to the bwrap call with "--setenv LD_DEBUG libs": find library=libstdc++.so.6 [0]; searching search cache=/etc/ld.so.cache search path=/lib64:/usr/lib64 (system search path) trying file=/lib64/libstdc++.so.6 trying file=/usr/lib64/libstdc++.so.6 followed by: /usr/bin/totem-video-thumbnailer: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory If /etc/ld.so.cache is available, it will use that for the paths: find library=libstdc++.so.6 [0]; searching search cache=/etc/ld.so.cache trying file=/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/libstdc++.so.6 By bind mounting just that file out of /etc, we get it to work on such a system. Closes: #81
-rw-r--r--libgnome-desktop/gnome-desktop-thumbnail-script.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libgnome-desktop/gnome-desktop-thumbnail-script.c b/libgnome-desktop/gnome-desktop-thumbnail-script.c
index 107feb2d..52576638 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail-script.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail-script.c
@@ -538,6 +538,7 @@ add_bwrap (GPtrArray *array,
add_args (array,
"bwrap",
"--ro-bind", "/usr", "/usr",
+ "--ro-bind", "/etc/ld.so.cache", "/etc/ld.so.cache",
NULL);
/* These directories might be symlinks into /usr/... */