new file mode 100644
@@ -0,0 +1,24 @@
+Description: fix chownat/chmodat when pathname is empty
+ this forwards all supported flags to fstatat,
+ instead of masking them out and causing errors.
+
+--- a/libfakeroot.c
++++ b/libfakeroot.c
+@@ -886,7 +886,7 @@
+ /* If AT_SYMLINK_NOFOLLOW is set in the fchownat call it should
+ be when we stat it. */
+ INT_STRUCT_STAT st;
+- r=INT_NEXT_FSTATAT(dir_fd, path, &st, (flags & AT_SYMLINK_NOFOLLOW));
++ r=INT_NEXT_FSTATAT(dir_fd, path, &st, (flags & (AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH | AT_NO_AUTOMOUNT)));
+
+ if(r)
+ return(r);
+@@ -1023,7 +1023,7 @@
+
+ /* If AT_SYMLINK_NOFOLLOW is set in the fchownat call it should
+ be when we stat it. */
+- r=INT_NEXT_FSTATAT(dir_fd, path, &st, flags & AT_SYMLINK_NOFOLLOW);
++ r=INT_NEXT_FSTATAT(dir_fd, path, &st, flags & (AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH | AT_NO_AUTOMOUNT));
+
+ if(r)
+ return(r);
fakeroot does mask out necessary flags, instead pass through the flags that are supported by fstatat Upstream BR: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959876 Signed-off-by: Norbert Lange <nolange79@gmail.com> --- package/fakeroot/0003_fix_fchownat.patch | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 package/fakeroot/0003_fix_fchownat.patch