aboutsummaryrefslogtreecommitdiffstats
path: root/main/bubblewrap/realpath-workaround.patch
blob: 6f1e3b54b040f8fe218333d35709079daad0be03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Musl realpath() implementation currently depends on /proc which is
not available when setting up pivot root. For the time being just
fallback to given path if realpath() fails. If there was symlinks
that would have required normalizing the following parse_mountinfo()
will fail.

diff --git a/bind-mount.c b/bind-mount.c
index 7d3543f..c33b701 100644
--- a/bind-mount.c
+++ b/bind-mount.c
@@ -397,7 +397,7 @@ bind_mount (int           proc_fd,
      path, so to find it in the mount table we need to do that too. */
   resolved_dest = realpath (dest, NULL);
   if (resolved_dest == NULL)
-    return 2;
+    resolved_dest = strdup (dest);
 
   mount_tab = parse_mountinfo (proc_fd, resolved_dest);
   if (mount_tab[0].mountpoint == NULL)