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

wrap: bind_usr: Create /lib etc. as a symlink if required


If we are using a "merged-/usr" sysroot as our runtime, and we
bind-mount a /lib symlink (which is really /usr/lib) on /lib, it
changes the meaning of relative symlinks and breaks our ability to
override ld.so correctly.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent feca5d9b
No related branches found
No related tags found
No related merge requests found
...@@ -260,16 +260,24 @@ bind_usr (FlatpakBwrap *bwrap, ...@@ -260,16 +260,24 @@ bind_usr (FlatpakBwrap *bwrap,
"--symlink", target, dest, "--symlink", target, dest,
NULL); NULL);
} }
/* TODO: else if it's a symlink, create the same symlink in the
* container? */
else else
{ {
g_autofree gchar *path = g_build_filename (host_path, g_autofree gchar *path = g_build_filename (host_path,
member, NULL); member, NULL);
g_autofree gchar *target = glnx_readlinkat_malloc (-1, path, NULL, NULL);
flatpak_bwrap_add_args (bwrap, if (target != NULL)
"--ro-bind", path, dest, {
NULL); flatpak_bwrap_add_args (bwrap,
"--symlink", target, dest,
NULL);
}
else
{
flatpak_bwrap_add_args (bwrap,
"--ro-bind", path, dest,
NULL);
}
} }
g_clear_pointer (&dest, g_free); g_clear_pointer (&dest, g_free);
......
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