Skip to content
Snippets Groups Projects
Commit 8d596901 authored by Ludovico de Nittis's avatar Ludovico de Nittis
Browse files

runtime: Search gconv in the correct dir when it starts with /app


When we search for gconv in the provider, if the directory we derived
from libc starts with "/app/", we should not prepend "/usr/" because we
don't expect to have "/usr/app/" in the provider.

Without this patch, pressure-vessel in a Flatpak container fails to load
i386 gconv with the following message:
"We were expecting the gconv modules directory in the provider to be
located in "/app/lib/i386-linux-gnu/gconv", but instead it is missing"

Fixes: T27437

Signed-off-by: default avatarLudovico de Nittis <ludovico.denittis@collabora.com>
parent 85790746
No related branches found
No related tags found
1 merge request!287runtime: Search gconv in the correct dir when it starts with /app
Pipeline #11460 passed
......@@ -3620,7 +3620,12 @@ pv_runtime_collect_libc_family (PvRuntime *self,
if (g_str_has_prefix (dir, "/usr/"))
memmove (dir, dir + strlen ("/usr"), strlen (dir) - strlen ("/usr") + 1);
gconv_dir_in_provider = g_build_filename ("/usr", dir, "gconv", NULL);
/* If it starts with "/app/" we don't prepend "/usr/" because we don't
* expect "/usr/app/" to be available */
if (g_str_has_prefix (dir, "/app/"))
gconv_dir_in_provider = g_build_filename (dir, "gconv", NULL);
else
gconv_dir_in_provider = g_build_filename ("/usr", dir, "gconv", NULL);
if (_srt_file_test_in_sysroot (self->provider_in_current_namespace,
-1,
......@@ -3652,7 +3657,10 @@ pv_runtime_collect_libc_family (PvRuntime *self,
}
g_clear_pointer (&gconv_dir_in_provider, g_free);
gconv_dir_in_provider = g_build_filename ("/usr", dir, "gconv", NULL);
if (g_str_has_prefix (dir, "/app/"))
gconv_dir_in_provider = g_build_filename (dir, "gconv", NULL);
else
gconv_dir_in_provider = g_build_filename ("/usr", dir, "gconv", NULL);
if (_srt_file_test_in_sysroot (self->provider_in_current_namespace,
-1,
......
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