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

bwrap: Cope with /dev/shm being a symlink to /run/shm


This can be the case on older sysvinit- or Upstart-based Debian-derived
distributions, such as Ubuntu 14.04 (with the default Upstart init
system) and Debian 9 (with the non-default sysvinit init system).

Under systemd or the versions of sysvinit in Debian >= 10, /dev/shm is
a real tmpfs and /run/shm is a symlink to /dev/shm.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 6f728031
No related branches found
No related tags found
1 merge request!325Fix interop with older Upstart- and sysvinit-based OSs
Pipeline #14356 passed
......@@ -350,11 +350,31 @@ pv_bwrap_copy_tree (FlatpakBwrap *bwrap,
void
pv_bwrap_add_api_filesystems (FlatpakBwrap *bwrap)
{
g_autofree char *link = NULL;
flatpak_bwrap_add_args (bwrap,
"--dev-bind", "/dev", "/dev",
"--proc", "/proc",
"--ro-bind", "/sys", "/sys",
NULL);
link = glnx_readlinkat_malloc (AT_FDCWD, "/dev/shm", NULL, NULL);
if (g_strcmp0 (link, "/run/shm") == 0)
{
if (g_file_test ("/run/shm", G_FILE_TEST_IS_DIR))
flatpak_bwrap_add_args (bwrap,
"--bind", "/run/shm", "/run/shm",
NULL);
else
flatpak_bwrap_add_args (bwrap,
"--dir", "/run/shm",
NULL);
}
else if (link != NULL)
{
g_warning ("Unexpected /dev/shm symlink %s", link);
}
}
FlatpakBwrap *
......
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