0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. From 95508f06f13604ed96f28d18eb1670ea1ed02063 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Sat, 6 Mar 2021 14:48:56 -0800
  4. Subject: [PATCH] nativesdk-glibc: Fall back to faccessat on faccess2 returns
  5. EPERM
  6. Fedora-specific workaround for systemd-nspawn
  7. Upstream-Status: Inappropriate [Distro Specific]
  8. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  9. ---
  10. sysdeps/unix/sysv/linux/faccessat.c | 6 +++++-
  11. 1 file changed, 5 insertions(+), 1 deletion(-)
  12. diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c
  13. index 1378bb2db8..19f2044172 100644
  14. --- a/sysdeps/unix/sysv/linux/faccessat.c
  15. +++ b/sysdeps/unix/sysv/linux/faccessat.c
  16. @@ -30,7 +30,11 @@ __faccessat (int fd, const char *file, int mode, int flag)
  17. #if __ASSUME_FACCESSAT2
  18. return ret;
  19. #else
  20. - if (ret == 0 || errno != ENOSYS)
  21. + /* Fedora-specific workaround:
  22. + As a workround for a broken systemd-nspawn that returns
  23. + EPERM when a syscall is not allowed instead of ENOSYS
  24. + we must check for EPERM here and fall back to faccessat. */
  25. + if (ret == 0 || !(errno == ENOSYS || errno == EPERM))
  26. return ret;
  27. if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS))