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

wrap: Don't try to mount logical current working directory


This works poorly if the path to the current working directory involves
symlinks, for example /home/.steam/root, and they resolve differently
in bwrap's temporary environment (where the old and new root
directories are temporarily mounted on /oldroot and /newroot).

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 142e4129
No related branches found
No related tags found
No related merge requests found
......@@ -1914,28 +1914,7 @@ main (int argc,
g_debug ("Making home directory available...");
if (pv_is_same_file (home, cwd_l))
{
g_debug ("Not making logical working directory \"%s\" available to "
"container because it is the home directory",
cwd_l);
}
else
{
flatpak_bwrap_add_args (bwrap,
"--bind", cwd_l, cwd_l,
NULL);
}
flatpak_bwrap_add_args (bwrap,
"--chdir", cwd_l,
NULL);
if (strcmp (cwd_p, cwd_l) == 0)
{
g_debug ("Physical and logical working directory coincide");
}
else if (pv_is_same_file (home, cwd_p))
if (pv_is_same_file (home, cwd_p))
{
g_debug ("Not making physical working directory \"%s\" available to "
"container because it is the home directory",
......@@ -1943,13 +1922,16 @@ main (int argc,
}
else
{
/* Mount it in case the symlink resolution works out differently
* inside the container */
flatpak_bwrap_add_args (bwrap,
"--bind", cwd_p, cwd_p,
NULL);
}
flatpak_bwrap_add_args (bwrap,
"--chdir", cwd_p,
"--unsetenv", "PWD",
NULL);
if (strstr (bwrap_help, "unshare-uts") != NULL)
{
g_debug ("Setting hostname...");
......
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