From db43c3571deaa0a6b6694279cfef74beac0f4f4a Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Wed, 4 Aug 2021 16:21:33 +0100
Subject: [PATCH] pv_wrap_append_preload: Remove a Flatpak/non-Flatpak branch

In reality, we have a FlatpakExports if and only if we are not creating
a Flatpak subsandbox. If a caller somehow passes in a FlatpakExports
while creating a subsandbox, it's harmless to tell it what to export.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 pressure-vessel/wrap-setup.c | 33 +++++++--------------------------
 1 file changed, 7 insertions(+), 26 deletions(-)

diff --git a/pressure-vessel/wrap-setup.c b/pressure-vessel/wrap-setup.c
index 2c004701c..9a72623cd 100644
--- a/pressure-vessel/wrap-setup.c
+++ b/pressure-vessel/wrap-setup.c
@@ -438,30 +438,11 @@ pv_wrap_append_preload (GPtrArray *argv,
       return;
     }
 
-  /* A subsandbox will just have the same LD_PRELOAD as the
-   * Flatpak itself, except that we have to redirect /usr and /app
-   * into /run/parent. */
-  if (flags & PV_APPEND_PRELOAD_FLAGS_FLATPAK_SUBSANDBOX)
-    {
-      /* No FlatpakExports here: any file not in /usr or /app that
-       * is visible to our "parent" Flatpak app is also visible
-       * to us. */
-      append_preload_internal (argv,
-                               option,
-                               preload,
-                               env,
-                               flags,
-                               runtime,
-                               NULL);
-    }
-  else
-    {
-      append_preload_internal (argv,
-                               option,
-                               preload,
-                               env,
-                               flags,
-                               runtime,
-                               exports);
-    }
+  append_preload_internal (argv,
+                           option,
+                           preload,
+                           env,
+                           flags,
+                           runtime,
+                           exports);
 }
-- 
GitLab