From 7bad94e8c299e135d50e3482789faea5a218ff52 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Mon, 2 Aug 2021 19:22:11 +0100
Subject: [PATCH] runtime: Take ldd, etc. from provider if we are using its
 glibc

Resolves: T29581
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 pressure-vessel/runtime.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/pressure-vessel/runtime.c b/pressure-vessel/runtime.c
index 9361709bc..2f528fa5d 100644
--- a/pressure-vessel/runtime.c
+++ b/pressure-vessel/runtime.c
@@ -4338,9 +4338,25 @@ pv_runtime_finish_libc_family (PvRuntime *self,
     enum { OPTIONAL, IMPORTANT, ESSENTIAL } priority;
   } glibc_executables[] =
   {
+    /* This is basically the libc-bin Debian package, which is
+     * marked Essential. At least ldd can fail to work if it is too
+     * dissimilar to the libc.so.6 in use. */
+    { "catchsegv" },
+    { "getconf" },
+    { "getent" },
+    { "iconv" },
     { "ldconfig", .priority = ESSENTIAL, .target_path = "/sbin/ldconfig" },
+    { "ldd", .priority = IMPORTANT },
     { "locale", .priority = IMPORTANT },
     { "localedef", .priority = IMPORTANT },
+    { "pldd" },
+    { "tzselect" },
+    { "zdump" },
+    /* We probably don't need developer tools gencat, rpcgen, memusage,
+     * memusagestat, mtrace, sotruss, sprof from libc-dev-bin, libc-devtools
+     * (and some have non-trivial dependencies). */
+    /* We probably don't need sysadmin tools /usr/sbin/iconvconfig,
+     * /usr/sbin/zic from libc-bin. */
   };
 
   g_return_val_if_fail (self->provider != NULL, FALSE);
-- 
GitLab