Skip to content

Commit

Permalink
Enable xattr and acl support in coreutils. (#10101)
Browse files Browse the repository at this point in the history
Currently, coreutils does not have xattr and acl support enabled. This means that commands like `cp --preserve=xattr` will fail. This is annoying when trying to preserve filecaps and SELinux labels. This change fixes this.
  • Loading branch information
cwize1 authored Aug 13, 2024
1 parent 1c06c17 commit 911793f
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 15 deletions.
9 changes: 6 additions & 3 deletions SPECS/coreutils/coreutils.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Summary: Basic system utilities
Name: coreutils
Version: 9.4
Release: 5%{?dist}
Release: 6%{?dist}
License: GPLv3
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand All @@ -13,6 +13,8 @@ Source1: serial-console.sh
Patch0: coreutils-9.4-i18n-1.patch
Patch1: coreutils-9.4-uname-1.patch
Patch2: CVE-2024-0684.patch
BuildRequires: libacl-devel
BuildRequires: libattr-devel
BuildRequires: libselinux-devel
BuildRequires: libselinux-utils
Requires: gmp
Expand Down Expand Up @@ -71,8 +73,6 @@ sed -i 's/PET/-05/g' tests/misc/date-debug.sh
sed -i 's/2>err\/merge-/2>\&1 > err\/merge-/g' tests/misc/sort-merge-fdlimit.sh
sed -i 's/)\" = \"10x0/| head -n 1)\" = \"10x0/g' tests/split/r-chunk.sh
sed -i '/mb.sh/d' Makefile
# remove capability test which incorrectly determines xattr support and then fails
sed -i '/tests\/cp\/capability.sh/d' Makefile
LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 make -k check

%post -p /sbin/ldconfig
Expand All @@ -92,6 +92,9 @@ LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 make -k check
%defattr(-,root,root)

%changelog
* Thu Aug 8 2024 Chris Gunn <[email protected]> - 9.4-6
- Enable xattr and acl support.

* Thu Aug 1 2024 Riken Maharjan <[email protected]> - 9.4-5
- Remove unecessary Requires on libselinux imported from Fedora 40 (License: MIT)
- libselinux causes dependency cycle.
Expand Down
7 changes: 5 additions & 2 deletions toolkit/resources/manifests/package/pkggen_core_aarch64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ ncurses-libs-6.4-2.azl3.aarch64.rpm
ncurses-term-6.4-2.azl3.aarch64.rpm
readline-8.2-1.azl3.aarch64.rpm
readline-devel-8.2-1.azl3.aarch64.rpm
coreutils-9.4-5.azl3.aarch64.rpm
coreutils-lang-9.4-5.azl3.aarch64.rpm
libattr-2.5.2-1.azl3.aarch64.rpm
attr-2.5.2-1.azl3.aarch64.rpm
libacl-2.3.1-2.azl3.aarch64.rpm
coreutils-9.4-6.azl3.aarch64.rpm
coreutils-lang-9.4-6.azl3.aarch64.rpm
bash-5.2.15-2.azl3.aarch64.rpm
bash-devel-5.2.15-2.azl3.aarch64.rpm
bash-lang-5.2.15-2.azl3.aarch64.rpm
Expand Down
7 changes: 5 additions & 2 deletions toolkit/resources/manifests/package/pkggen_core_x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ ncurses-libs-6.4-2.azl3.x86_64.rpm
ncurses-term-6.4-2.azl3.x86_64.rpm
readline-8.2-1.azl3.x86_64.rpm
readline-devel-8.2-1.azl3.x86_64.rpm
coreutils-9.4-5.azl3.x86_64.rpm
coreutils-lang-9.4-5.azl3.x86_64.rpm
libattr-2.5.2-1.azl3.x86_64.rpm
attr-2.5.2-1.azl3.x86_64.rpm
libacl-2.3.1-2.azl3.x86_64.rpm
coreutils-9.4-6.azl3.x86_64.rpm
coreutils-lang-9.4-6.azl3.x86_64.rpm
bash-5.2.15-2.azl3.x86_64.rpm
bash-devel-5.2.15-2.azl3.x86_64.rpm
bash-lang-5.2.15-2.azl3.x86_64.rpm
Expand Down
14 changes: 11 additions & 3 deletions toolkit/resources/manifests/package/toolchain_aarch64.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
acl-2.3.1-2.azl3.aarch64.rpm
acl-debuginfo-2.3.1-2.azl3.aarch64.rpm
asciidoc-10.2.0-2.azl3.noarch.rpm
attr-2.5.2-1.azl3.aarch64.rpm
attr-debuginfo-2.5.2-1.azl3.aarch64.rpm
audit-3.1.2-1.azl3.aarch64.rpm
audit-debuginfo-3.1.2-1.azl3.aarch64.rpm
audit-devel-3.1.2-1.azl3.aarch64.rpm
Expand Down Expand Up @@ -47,9 +51,9 @@ chkconfig-debuginfo-1.25-1.azl3.aarch64.rpm
chkconfig-lang-1.25-1.azl3.aarch64.rpm
cmake-3.29.6-1.azl3.aarch64.rpm
cmake-debuginfo-3.29.6-1.azl3.aarch64.rpm
coreutils-9.4-5.azl3.aarch64.rpm
coreutils-debuginfo-9.4-5.azl3.aarch64.rpm
coreutils-lang-9.4-5.azl3.aarch64.rpm
coreutils-9.4-6.azl3.aarch64.rpm
coreutils-debuginfo-9.4-6.azl3.aarch64.rpm
coreutils-lang-9.4-6.azl3.aarch64.rpm
cpio-2.14-1.azl3.aarch64.rpm
cpio-debuginfo-2.14-1.azl3.aarch64.rpm
cpio-lang-2.14-1.azl3.aarch64.rpm
Expand Down Expand Up @@ -160,12 +164,16 @@ krb5-1.21.3-1.azl3.aarch64.rpm
krb5-debuginfo-1.21.3-1.azl3.aarch64.rpm
krb5-devel-1.21.3-1.azl3.aarch64.rpm
krb5-lang-1.21.3-1.azl3.aarch64.rpm
libacl-2.3.1-2.azl3.aarch64.rpm
libacl-devel-2.3.1-2.azl3.aarch64.rpm
libarchive-3.7.1-2.azl3.aarch64.rpm
libarchive-debuginfo-3.7.1-2.azl3.aarch64.rpm
libarchive-devel-3.7.1-2.azl3.aarch64.rpm
libassuan-2.5.6-1.azl3.aarch64.rpm
libassuan-debuginfo-2.5.6-1.azl3.aarch64.rpm
libassuan-devel-2.5.6-1.azl3.aarch64.rpm
libattr-2.5.2-1.azl3.aarch64.rpm
libattr-devel-2.5.2-1.azl3.aarch64.rpm
libbacktrace-static-13.2.0-7.azl3.aarch64.rpm
libcap-2.69-1.azl3.aarch64.rpm
libcap-debuginfo-2.69-1.azl3.aarch64.rpm
Expand Down
14 changes: 11 additions & 3 deletions toolkit/resources/manifests/package/toolchain_x86_64.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
acl-2.3.1-2.azl3.x86_64.rpm
acl-debuginfo-2.3.1-2.azl3.x86_64.rpm
asciidoc-10.2.0-2.azl3.noarch.rpm
attr-2.5.2-1.azl3.x86_64.rpm
attr-debuginfo-2.5.2-1.azl3.x86_64.rpm
audit-3.1.2-1.azl3.x86_64.rpm
audit-debuginfo-3.1.2-1.azl3.x86_64.rpm
audit-devel-3.1.2-1.azl3.x86_64.rpm
Expand Down Expand Up @@ -48,9 +52,9 @@ chkconfig-debuginfo-1.25-1.azl3.x86_64.rpm
chkconfig-lang-1.25-1.azl3.x86_64.rpm
cmake-3.29.6-1.azl3.x86_64.rpm
cmake-debuginfo-3.29.6-1.azl3.x86_64.rpm
coreutils-9.4-5.azl3.x86_64.rpm
coreutils-debuginfo-9.4-5.azl3.x86_64.rpm
coreutils-lang-9.4-5.azl3.x86_64.rpm
coreutils-9.4-6.azl3.x86_64.rpm
coreutils-debuginfo-9.4-6.azl3.x86_64.rpm
coreutils-lang-9.4-6.azl3.x86_64.rpm
cpio-2.14-1.azl3.x86_64.rpm
cpio-debuginfo-2.14-1.azl3.x86_64.rpm
cpio-lang-2.14-1.azl3.x86_64.rpm
Expand Down Expand Up @@ -166,12 +170,16 @@ krb5-1.21.3-1.azl3.x86_64.rpm
krb5-debuginfo-1.21.3-1.azl3.x86_64.rpm
krb5-devel-1.21.3-1.azl3.x86_64.rpm
krb5-lang-1.21.3-1.azl3.x86_64.rpm
libacl-2.3.1-2.azl3.x86_64.rpm
libacl-devel-2.3.1-2.azl3.x86_64.rpm
libarchive-3.7.1-2.azl3.x86_64.rpm
libarchive-debuginfo-3.7.1-2.azl3.x86_64.rpm
libarchive-devel-3.7.1-2.azl3.x86_64.rpm
libassuan-2.5.6-1.azl3.x86_64.rpm
libassuan-debuginfo-2.5.6-1.azl3.x86_64.rpm
libassuan-devel-2.5.6-1.azl3.x86_64.rpm
libattr-2.5.2-1.azl3.x86_64.rpm
libattr-devel-2.5.2-1.azl3.x86_64.rpm
libbacktrace-static-13.2.0-7.azl3.x86_64.rpm
libcap-2.69-1.azl3.x86_64.rpm
libcap-debuginfo-2.69-1.azl3.x86_64.rpm
Expand Down
11 changes: 9 additions & 2 deletions toolkit/scripts/toolchain/build_official_toolchain_rpms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,15 @@ chroot_and_install_rpms libselinux
# PCRE2 needs to be installed (above) for grep to build with perl regexp support
build_rpm_in_chroot_no_install grep

# coreutils and findutils require libselinux
# for SELinux support.
# attr requires gettext, libtool
build_rpm_in_chroot_no_install attr

# acl requires libattr
chroot_and_install_rpms libattr
build_rpm_in_chroot_no_install acl

# coreutils and findutils require libselinux, libacl, libattr
chroot_and_install_rpms libacl
build_rpm_in_chroot_no_install coreutils
build_rpm_in_chroot_no_install findutils

Expand Down

0 comments on commit 911793f

Please sign in to comment.