From b8f476de79cd3411606d045a3e6659b018564885 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Aug 20 2020 22:18:47 +0000 Subject: Support building glibc in a mock chroot using older systemd-nspawn (#1869030). Resolves: #1869030 --- diff --git a/glibc-rhbz1869030-faccessat2-eperm.patch b/glibc-rhbz1869030-faccessat2-eperm.patch new file mode 100644 index 0000000..c389d12 --- /dev/null +++ b/glibc-rhbz1869030-faccessat2-eperm.patch @@ -0,0 +1,25 @@ +With older systemd-nspawn the faccessat2 syscall was denied but +instead of returning ENOSYS it returned EPERM. This has since +been corrected in upstream systemd-nsapwn, but with older builders +that may have older nspawn the Fedora Rawhide glibc should fall +back to faccessat when it sees ENOSYS *or* EPERM. This is a +Fedora Rawhide-only patch that should be removed before the next +release. + +diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c +index 56cb6dcc8b4d58d3..5de75032bbc93a2c 100644 +--- a/sysdeps/unix/sysv/linux/faccessat.c ++++ b/sysdeps/unix/sysv/linux/faccessat.c +@@ -34,7 +34,11 @@ faccessat (int fd, const char *file, int mode, int flag) + #if __ASSUME_FACCESSAT2 + return ret; + #else +- if (ret == 0 || errno != ENOSYS) ++ /* Fedora-specific workaround: ++ As a workround for a broken systemd-nspawn that returns ++ EPERM when a syscall is not allowed instead of ENOSYS ++ we must check for EPERM here and fall back to faccessat. */ ++ if (ret == 0 || !(errno == ENOSYS || errno == EPERM)) + return ret; + + if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS)) diff --git a/glibc.spec b/glibc.spec index 086ff6d..970365f 100644 --- a/glibc.spec +++ b/glibc.spec @@ -96,7 +96,7 @@ Summary: The GNU libc libraries Name: glibc Version: %{glibcversion} -Release: 3%{?dist} +Release: 4%{?dist} # In general, GPLv2+ is used by programs, LGPLv2+ is used for # libraries. @@ -169,6 +169,7 @@ Patch23: glibc-python3.patch Patch29: glibc-fedora-nsswitch.patch Patch30: glibc-deprecated-selinux-makedb.patch Patch31: glibc-deprecated-selinux-nscd.patch +Patch32: glibc-rhbz1869030-faccessat2-eperm.patch ############################################################################## # Continued list of core "glibc" package information: @@ -2019,6 +2020,9 @@ fi %files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared %changelog +* Thu Aug 20 2020 Carlos O'Donell - 2.32.9000-4 +- Support building glibc in a mock chroot using older systemd-nspawn (#1869030). + * Tue Aug 18 2020 Carlos O'Donell - 2.32.9000-3 - Suggest installing minimal localization e.g. C, POSIX, C.UTF-8.