[gnome-desktop/gnome-3-30] thumbnail: bind mount /etc/ld.so.cache to the sandbox



commit 77d37aa98ce1f069669ad4f9f925563de94afe06
Author: Mart Raudsepp <leio gentoo org>
Date:   Thu Dec 13 20:29:05 2018 +0200

    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

 libgnome-desktop/gnome-desktop-thumbnail-script.c | 1 +
 1 file changed, 1 insertion(+)
---
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/... */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]