Skip to content
Snippets Groups Projects
Commit 6adf4352 authored by Simon McVittie's avatar Simon McVittie
Browse files

pv-wrap: Hoist ld.so.blockedlist adjustment out of loop


We only need to do this once, and it's harmless to do this even if
libshared-library-guard isn't even in use, so we might as well move
it out of the loops.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 0ceb65ec
No related branches found
No related tags found
1 merge request!347Further preparation for !337
Pipeline #16411 passed
...@@ -2091,6 +2091,23 @@ main (int argc, ...@@ -2091,6 +2091,23 @@ main (int argc,
FLATPAK_FILESYSTEM_MODE_READ_WRITE, FLATPAK_FILESYSTEM_MODE_READ_WRITE,
"/tmp"); "/tmp");
if (flatpak_subsandbox != NULL)
{
/* We special case libshared-library-guard because usually
* its blockedlist file is located in `/app` and we need
* to change that to the `/run/parent` counterpart */
const gchar *blockedlist = "/app/etc/freedesktop-sdk.ld.so.blockedlist";
if (g_file_test (blockedlist, G_FILE_TEST_EXISTS))
{
g_autofree gchar *adjusted_blockedlist = NULL;
adjusted_blockedlist = g_build_filename ("/run/parent",
blockedlist, NULL);
pv_environ_setenv (container_env, "SHARED_LIBRARY_GUARD_CONFIG",
adjusted_blockedlist);
}
}
adverb_preload_argv = g_ptr_array_new_with_free_func (g_free); adverb_preload_argv = g_ptr_array_new_with_free_func (g_free);
/* We need the LD_PRELOADs from Steam visible at the paths that were /* We need the LD_PRELOADs from Steam visible at the paths that were
...@@ -2153,22 +2170,6 @@ main (int argc, ...@@ -2153,22 +2170,6 @@ main (int argc,
g_strdup_printf ("%s=%s", g_strdup_printf ("%s=%s",
option, option,
adjusted_path)); adjusted_path));
if (g_str_has_suffix (preload, "/libshared-library-guard.so"))
{
/* We special case libshared-library-guard because usually
* its blockedlist file is located in `/app` and we need
* to change that to the `/run/parent` counterpart */
const gchar *blockedlist = "/app/etc/freedesktop-sdk.ld.so.blockedlist";
if (g_file_test (blockedlist, G_FILE_TEST_EXISTS))
{
g_autofree gchar *adjusted_blockedlist = NULL;
adjusted_blockedlist = g_build_filename ("/run/parent",
blockedlist, NULL);
pv_environ_setenv (container_env, "SHARED_LIBRARY_GUARD_CONFIG",
adjusted_blockedlist);
}
}
} }
else else
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment