Skip to content
Snippets Groups Projects

pressure-vessel: Remap preloadable modules better

Merged Simon McVittie requested to merge wip/t29490 into master
4 files
+ 15
18
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 8
18
@@ -44,6 +44,7 @@
#include "bwrap-lock.h"
#include "flatpak-utils-base-private.h"
#include "launcher.h"
#include "supported-architectures.h"
#include "utils.h"
#include "wrap-interactive.h"
@@ -65,18 +66,6 @@ static gboolean opt_wait = FALSE;
static gboolean opt_write = FALSE;
static GPid child_pid;
typedef struct
{
const gchar *abi;
const gchar *directory_name;
} AbiTuplesDetails;
static AbiTuplesDetails abi_tuples_details[] =
{
{ SRT_ABI_I386, "ubuntu12_32" },
{ SRT_ABI_X86_64, "ubuntu12_64" },
};
typedef struct
{
int original_stdout_fd;
@@ -487,12 +476,12 @@ generate_lib_temp_dirs (LibTempDirs *lib_temp_dirs,
lib_temp_dirs->abi_paths = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
for (abi = 0; abi < G_N_ELEMENTS (abi_tuples_details); abi++)
for (abi = 0; abi < PV_N_SUPPORTED_ARCHITECTURES; abi++)
{
g_autofree gchar *libdl_platform = NULL;
g_autofree gchar *abi_path = NULL;
libdl_platform = srt_system_info_dup_libdl_platform (info,
abi_tuples_details[abi].abi,
pv_multiarch_details[abi].tuple,
error);
if (!libdl_platform)
return glnx_prefix_error (error,
@@ -504,7 +493,7 @@ generate_lib_temp_dirs (LibTempDirs *lib_temp_dirs,
return glnx_throw_errno_prefix (error, "Unable to create \"%s\"", abi_path);
g_hash_table_insert (lib_temp_dirs->abi_paths,
g_strdup (abi_tuples_details[abi].abi),
g_strdup (pv_multiarch_details[abi].tuple),
g_steal_pointer (&abi_path));
}
@@ -994,14 +983,15 @@ main (int argc,
{
g_autofree gchar *link = NULL;
for (gsize abi = 0; abi < G_N_ELEMENTS (abi_tuples_details); abi++)
for (gsize abi = 0; abi < PV_N_SUPPORTED_ARCHITECTURES; abi++)
{
g_autofree gchar *expected_suffix = g_strdup_printf ("/%s/gameoverlayrenderer.so",
abi_tuples_details[abi].directory_name);
pv_multiarch_details[abi].gameoverlayrenderer_dir);
if (g_str_has_suffix (preload, expected_suffix))
{
link = g_build_filename (g_hash_table_lookup (lib_temp_dirs->abi_paths,
abi_tuples_details[abi].abi),
pv_multiarch_details[abi].tuple),
"gameoverlayrenderer.so", NULL);
break;
}
Loading