diff --git a/0001-fix-inplace-selinux-error.patch b/0001-fix-inplace-selinux-error.patch deleted file mode 100644 index 423f9ba97ee504a84662bc5eb77251c62c5a146f..0000000000000000000000000000000000000000 --- a/0001-fix-inplace-selinux-error.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 026bf901ac6976d2afe970741ed9042544e21090 Mon Sep 17 00:00:00 2001 -From: mahailiang -Date: Tue, 2 Feb 2021 20:16:15 +0800 -Subject: [PATCH] fix inplace-selinux error - ---- - sed/sed.c | 18 ++++++++++++++++++ - testsuite/inplace-selinux.sh | 5 +++++ - 2 files changed, 23 insertions(+) - -diff --git a/sed/sed.c b/sed/sed.c -index e5910cf..a47b7f9 100644 ---- a/sed/sed.c -+++ b/sed/sed.c -@@ -28,6 +28,7 @@ - #include "getopt.h" - #include "progname.h" - #include "version.h" -+#include - - #include "version-etc.h" - -@@ -124,6 +125,22 @@ General help using GNU software: .\n")); - fprintf(out, _("E-mail bug reports to: <%s>.\n"), PACKAGE_BUGREPORT); - } - -+static void -+selinux_support (void) -+{ -+ putchar ('\n'); -+#if HAVE_SELINUX_SELINUX_H -+ puts (_("This sed program was built with SELinux support.")); -+ if (is_selinux_enabled()) -+ puts (_("SELinux is enabled on this system.")); -+ else -+ puts (_("SELinux is disabled on this system.")); -+#else -+ puts (_("This sed program was built without SELinux support.")); -+#endif -+ putchar ('\n'); -+} -+ - _Noreturn static void - usage(int status) - { -@@ -370,6 +387,7 @@ main (int argc, char **argv) - case 'v': - version_etc(stdout, program_name, PACKAGE_NAME, Version, - AUTHORS, (char *) NULL); -+ selinux_support (); - contact(false); - ck_fclose (NULL); - exit (EXIT_SUCCESS); -diff --git a/testsuite/inplace-selinux.sh b/testsuite/inplace-selinux.sh -index 47383a9..06e7f8d 100755 ---- a/testsuite/inplace-selinux.sh -+++ b/testsuite/inplace-selinux.sh -@@ -18,6 +18,11 @@ - print_ver_ sed - require_selinux_ - -+sed --version | grep -q "with SELinux" \ -+ || skip_ "sed built without SELinux support" -+sed --version | grep -q "^SELinux is enabled" \ -+ || skip_ "sed reports SELinux is disabled on this system" -+ - fail=0 - - touch a || framework_failure_ --- -2.18.2 - diff --git a/download b/download new file mode 100644 index 0000000000000000000000000000000000000000..f47d75ad7e5f6e6a76f66e0252ac0b6126c7290e --- /dev/null +++ b/download @@ -0,0 +1 @@ +ade8f8c2c548bf41f74db2dcfc37e4e3 sed-4.5.tar.xz diff --git a/sed-4.5.tar.xz b/sed-4.5.tar.xz deleted file mode 100644 index 5487913a537cc89dbbaefa2ed91758de675df9f4..0000000000000000000000000000000000000000 Binary files a/sed-4.5.tar.xz and /dev/null differ diff --git a/sed-selinux-testsuite.patch b/sed-selinux-testsuite.patch new file mode 100644 index 0000000000000000000000000000000000000000..f8e8bb107d133f81eb247372a019dd5eba2febce --- /dev/null +++ b/sed-selinux-testsuite.patch @@ -0,0 +1,12 @@ +--- a/sed-4.5/testsuite/inplace-selinux.sh 2018-03-31 06:33:01.000000000 +0200 ++++ b/sed-4.5/testsuite/inplace-selinux.sh 2021-10-05 17:10:32.259956822 +0200 +@@ -24,6 +24,9 @@ + chcon -u system_u a || skip_ "chcon doesn't work" + chcon -u user_u a || skip_ "chcon doesn't work" + ++cp --preserve=context ./a ./b 2>&1 | grep "cannot preserve security context" >/dev/null && skip_ "cannot preserve security context without an SELinux-enabled kernel" ++ ++ + # Create the first file and symlink pointing at it. + echo "Hello World" > inplace-selinux-file || framework_failure_ + ln -s ./inplace-selinux-file inplace-selinux-link || framework_failure_ diff --git a/sed-selinux.patch b/sed-selinux.patch deleted file mode 100644 index 2dca5ab1734d6ec59dcdbd0c11356e8fc77381c2..0000000000000000000000000000000000000000 --- a/sed-selinux.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/NEWS b/NEWS -index e9335f0..e762b2d 100644 ---- a/NEWS -+++ b/NEWS -@@ -1,4 +1,9 @@ GNU sed NEWS -*- outline -*- - GNU sed NEWS -*- outline -*- -+ -+ sed -i now creates selinux context based on the context of the symlink -+ instead of the symlink target. [Bug present since at least sed-4.2] -+ sed -i --follow-symlinks remains unchanged. -+ - - * Noteworthy changes in release 4.4 (2017-02-03) [stable] - -diff --git a/sed/execute.c b/sed/execute.c -index 1843392..453886e 100644 ---- a/sed/execute.c -+++ b/sed/execute.c -@@ -607,7 +607,7 @@ open_next_file(const char *name, struct input *input) - if (is_selinux_enabled () > 0) - { - security_context_t con; -- if (getfilecon (input->in_file_name, &con) != -1) -+ if (lgetfilecon (input->in_file_name, &con) != -1) - { - /* Save and restore the old context for the sake of w and W - commands. */ -2.9.5 - diff --git a/sed.spec b/sed.spec index d499150026988af63c86341847ee22e0281dbde9..d014c6e19c0238c09d99b53ec8ce9c58c94ead8b 100644 --- a/sed.spec +++ b/sed.spec @@ -1,23 +1,17 @@ # -*- coding: utf-8 -*- -%define anolis_release .0.1 Summary: A GNU stream text editor Name: sed Version: 4.5 -Release: 2%{anolis_release}%{?dist} +Release: 5%{?dist} License: GPLv3+ Group: Applications/Text URL: http://sed.sourceforge.net/ Source0: ftp://ftp.gnu.org/pub/gnu/sed/sed-%{version}.tar.xz Source1: http://sed.sourceforge.net/sedfaq.txt Patch0: sed-4.2.2-binary_copy_args.patch -Patch1: sed-selinux.patch Patch2: sed-fuse.patch - -# Add by Anolis -Patch1000: 0001-fix-inplace-selinux-error.patch -# End - +Patch3: sed-selinux-testsuite.patch BuildRequires: glibc-devel, libselinux-devel, libacl-devel, automake, autoconf BuildRequires: perl-Getopt-Long Requires(post): /sbin/install-info @@ -38,9 +32,8 @@ specified in a script file or from the command line. %prep %setup -q %patch0 -p1 -b .copy -#%patch1 -p1 -b .selinux %patch2 -p1 -%patch1000 -p1 +%patch3 -p2 %build %configure --without-included-regex @@ -80,9 +73,17 @@ fi %{_mandir}/man*/* %changelog -* Sat Jun 19 2021 Mahailiang - 4.5-2.0.1 -- fix testsuite/inplace-selinux.sh check error -- Sync from https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35997 +* Tue Oct 05 2021 Jakub Martisko - 4.5-5 +- Minor cleanup - remove unused patch from the spec file too (related to 4.5-3) +- Resolves: rhbz#1869253 + +* Tue Oct 05 2021 Jakub Martisko - 4.5-4 +- Skip selinux test when selinux is not working +- Resolves: rhbz#1905777 + +* Tue Oct 05 2021 Jakub Martisko - 4.5-3 +- Minor cleanup - remove unused patch from the git +- Resolves: rhbz#1869253 * Mon May 18 2020 Jakub Martisko - 4.5-2 - fix "in-place edits on FUSE filesystems create files with all-zero mode bits"