From 8607ee7ad0b3520bbd129159b4dd442997f35e98 Mon Sep 17 00:00:00 2001
From: Steveice10 <1269164+Steveice10@users.noreply.github.com>
Date: Fri, 6 Oct 2023 19:32:56 -0700
Subject: [PATCH] flatpak-run: Unset VK_DRIVER_FILES and VK_ICD_FILENAMES
These environment variables inform the Vulkan loader on where to find driver files.
Since they typically point to locations on the host filesystem, any application that
attempts to load Vulkan within the flatpak sandbox would break with these set.
(cherry picked from commit b8d8d80c611c4e50946ca0e31332843b496ed57e)
---
common/flatpak-run.c | 2 ++
doc/flatpak-run.xml | 2 ++
2 files changed, 4 insertions(+)
diff --git a/common/flatpak-run.c b/common/flatpak-run.c
index 8fa8c0e0..6f54a9d0 100644
--- a/common/flatpak-run.c
+++ b/common/flatpak-run.c
@@ -1900,6 +1900,8 @@ static const ExportData default_exports[] = {
{"XKB_CONFIG_ROOT", NULL},
{"GIO_EXTRA_MODULES", NULL},
{"GDK_BACKEND", NULL},
+ {"VK_DRIVER_FILES", NULL},
+ {"VK_ICD_FILENAMES", NULL},
};
static const ExportData no_ld_so_cache_exports[] = {
diff --git a/doc/flatpak-run.xml b/doc/flatpak-run.xml
index 80e1fe03..f5bfdb2b 100644
--- a/doc/flatpak-run.xml
+++ b/doc/flatpak-run.xml
@@ -104,6 +104,8 @@
XKB_CONFIG_ROOT
GIO_EXTRA_MODULES
GDK_BACKEND
+ VK_DRIVER_FILES
+ VK_ICD_FILENAMES
Also several environment variables with the prefix "GST_" that are used by gstreamer