aboutsummaryrefslogtreecommitdiff
path: root/community/bubblewrap/patches
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2022-08-26 23:57:14 +0300
committerCem Keylan <cem@ckyln.com>2022-08-26 23:57:14 +0300
commitc2f9c714a12949a4d2995fbc59eb6e8ce83818bd (patch)
treed18f7dd34719ba3bc55daa8dbcdd6622efbe9d52 /community/bubblewrap/patches
parent47f5c0593c43eb3d25512a0fb90d16711bdbc106 (diff)
downloadrepository-c2f9c714a12949a4d2995fbc59eb6e8ce83818bd.tar.gz
bubblewrap: add new package at 0.6.2
Diffstat (limited to 'community/bubblewrap/patches')
-rw-r--r--community/bubblewrap/patches/realpath-workaround.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/community/bubblewrap/patches/realpath-workaround.patch b/community/bubblewrap/patches/realpath-workaround.patch
new file mode 100644
index 00000000..41c624f8
--- /dev/null
+++ b/community/bubblewrap/patches/realpath-workaround.patch
@@ -0,0 +1,45 @@
+diff --git a/bind-mount.c b/bind-mount.c
+index 877b095..a4185fd 100644
+--- a/bind-mount.c
++++ b/bind-mount.c
+@@ -24,6 +24,28 @@
+ #include "utils.h"
+ #include "bind-mount.h"
+
++#ifndef __GLIBC__
++static char *
++normpath(char *path)
++{
++ char *seg = NULL, *p = NULL;
++
++ for (p = path, seg = NULL; *p; p++) {
++ if (strncmp(p, "/../", 4) == 0 || strncmp(p, "/..", 4) == 0) {
++ memmove(seg ? seg : p, p+3, strlen(p+3) + 1);
++ return normpath(path);
++ } else if (strncmp(p, "/./", 3) == 0 || strncmp(p, "/.", 3) == 0) {
++ memmove(p, p+2, strlen(p+2) + 1);
++ } else if (strncmp(p, "//", 2) == 0 || strncmp(p, "/", 2) == 0) {
++ memmove(p, p+1, strlen(p+1) + 1);
++ }
++ if (*p == '/')
++ seg = p;
++ }
++ return path;
++}
++#endif
++
+ static char *
+ skip_token (char *line, bool eat_whitespace)
+ {
+@@ -402,7 +424,11 @@ 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)
++#ifdef __GLIBC__
+ return BIND_MOUNT_ERROR_REALPATH_DEST;
++#else
++ resolved_dest = normpath(strdup(dest));
++#endif
+
+ dest_fd = open (resolved_dest, O_PATH | O_CLOEXEC);
+ if (dest_fd < 0)