[gnome-desktop/wip/smcv/alternatives-issue92] thumbnail: Mount /etc/alternatives if it exists




commit df477a3d6c1b86f1913e6dbf3fcb587114d11606
Author: Simon McVittie <smcv debian org>
Date:   Tue Aug 11 11:45:10 2020 +0100

    thumbnail: Mount /etc/alternatives if it exists
    
    On distributions that use dpkg's update-alternatives(8), Red Hat's
    reimplementation or some other fork or reimplementation of the same
    concept, /etc/alternatives is conceptually a configuration layer over
    part of /usr. On those distributions, we cannot rely on /usr to be
    self-contained, but the combination of /usr and /etc/alternatives
    probably *is* self-contained.
    
    Resolves: https://gitlab.gnome.org/GNOME/gnome-desktop/-/issues/92
    Bug-Debian: https://bugs.debian.org/943434
    Signed-off-by: Simon McVittie <smcv debian org>

 libgnome-desktop/gnome-desktop-thumbnail-script.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/libgnome-desktop/gnome-desktop-thumbnail-script.c 
b/libgnome-desktop/gnome-desktop-thumbnail-script.c
index 6ffbe6d1f..5a72e8b12 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail-script.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail-script.c
@@ -556,6 +556,18 @@ add_bwrap (GPtrArray   *array,
   if (!g_str_has_prefix (FONTCONFIG_CACHE_PATH, "/usr/"))
     add_args (array, "--ro-bind-try", FONTCONFIG_CACHE_PATH, FONTCONFIG_CACHE_PATH, NULL);
 
+  /*
+   * Used in various distributions. On those distributions, /usr is not
+   * complete without it: some files in /usr might be a symbolic link
+   * like /usr/bin/composite -> /etc/alternatives/composite ->
+   * /usr/bin/composite-im6.q16.
+   *
+   * https://manpages.debian.org/stable/dpkg/update-alternatives.1.en.html
+   * https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/
+   * https://en.opensuse.org/openSUSE:Packaging_Multiple_Version_guidelines
+   */
+  add_args (array, "--ro-bind-try", "/etc/alternatives", "/etc/alternatives", NULL);
+
   add_args (array,
            "--proc", "/proc",
            "--dev", "/dev",


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