summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo/files
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-03 17:27:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-07 11:18:35 +0100
commit3006bbe7768e4efe33d3d2d3f5786a561ecbe96f (patch)
tree723124863c32a1f504d6f1cb4cb37d1631b6c140 /meta/recipes-devtools/pseudo/files
parente1e481f3608c05ab14c61bf45cd0837d7287b6a5 (diff)
downloadopenembedded-core-contrib-3006bbe7768e4efe33d3d2d3f5786a561ecbe96f.tar.gz
pseudo: Add pathfix patch
Add a path to fix up handling of dirfd being passed as a full file and with path="". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/pseudo/files')
-rw-r--r--meta/recipes-devtools/pseudo/files/pathfix.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/pathfix.patch b/meta/recipes-devtools/pseudo/files/pathfix.patch
new file mode 100644
index 0000000000..b3e63fa28f
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/pathfix.patch
@@ -0,0 +1,25 @@
+We're seeing systems in the wild (e.g. ubuntu 20.04) which call
+with a dirfd set to the full filename and path set to "". Since
+this seems to be expected to work, handle it accordingly.
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Upstream-Status: Pending
+
+Index: git/pseudo_client.c
+===================================================================
+--- git.orig/pseudo_client.c
++++ git/pseudo_client.c
+@@ -1549,8 +1549,12 @@ base_path(int dirfd, const char *path, i
+
+ if (!path)
+ return NULL;
+- if (!*path)
++
++ if (!*path) {
++ if (dirfd != -1 && dirfd != AT_FDCWD)
++ return fd_path(dirfd);
+ return "";
++ }
+
+ if (path[0] != '/') {
+ if (dirfd != -1 && dirfd != AT_FDCWD) {