From 3006bbe7768e4efe33d3d2d3f5786a561ecbe96f Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 3 Oct 2020 17:27:10 +0100 Subject: 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 --- meta/recipes-devtools/pseudo/files/pathfix.patch | 25 ++++++++++++++++++++++++ meta/recipes-devtools/pseudo/pseudo_git.bb | 1 + 2 files changed, 26 insertions(+) create mode 100644 meta/recipes-devtools/pseudo/files/pathfix.patch 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 +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) { diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb index c5040f5f7f..bc20a2f134 100644 --- a/meta/recipes-devtools/pseudo/pseudo_git.bb +++ b/meta/recipes-devtools/pseudo/pseudo_git.bb @@ -8,6 +8,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo;branch=oe-core \ file://track_link_fds.patch \ file://xattr_fix.patch \ file://mayunlink.patch \ + file://pathfix.patch \ file://fallback-passwd \ file://fallback-group \ " -- cgit 1.2.3-korg