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

runtime: Really use the realpath() of the host ld.so


flatpak_canonicalize_filename() only does a syntactic normalization,
eliminating ./ and similar constructs; it does not resolve symbolic
links. We need to use the realpath() of the 64-bit dynamic linker,
because otherwise, when we start replacing the dynamic linker in the
container with a symlink into /run/host, the host system might have
a symlink /lib64/ld-linux-x86-64.so.2 pointing outside /lib64,
for example to /lib/ld-linux-x86-64-2.30.so.
Then we'd get:

    runtime's ld-linux-x86-64.so.2 ->
    /run/host/lib64/ld-linux-x86-64.so.2 ->
    /lib/ld-linux-x86-64-2.30.so ->
    does not necessarily exist inside container

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 6fdde58f
No related branches found
No related tags found
No related merge requests found
......@@ -1478,7 +1478,13 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self,
g_debug ("Making host ld.so visible in container");
ld_so_in_host = flatpak_canonicalize_filename (arch->ld_so);
ld_so_in_host = realpath (arch->ld_so, NULL);
if (ld_so_in_host == NULL)
return glnx_throw_errno_prefix (error,
"Unable to determine host path to %s",
arch->ld_so);
g_debug ("Host path: %s -> %s", arch->ld_so, ld_so_in_host);
g_debug ("Container path: %s -> %s", arch->ld_so, ld_so_in_runtime);
flatpak_bwrap_add_args (bwrap,
......
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