pseudo: Add pathfix patch

Add a path to fix up handling of dirfd being passed as a full file
and with path="".

(From OE-Core rev: 3006bbe7768e4efe33d3d2d3f5786a561ecbe96f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2020-10-03 17:27:10 +01:00
parent bd34ad3c2a
commit ed9789d54d
2 changed files with 26 additions and 0 deletions

View File

@ -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) {

View File

@ -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 \
"