From 9247a50625d63ab9f245bd5b1a70fbed89b1f0df Mon Sep 17 00:00:00 2001 From: Xuchun Shang Date: Thu, 13 Apr 2023 15:07:29 +0800 Subject: [PATCH] Update the spec Signed-off-by: Xuchun Shang --- patch.spec | 83 ++++++++++++++++++++++++------------------------------ 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/patch.spec b/patch.spec index e99fce9..0a2465e 100644 --- a/patch.spec +++ b/patch.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 3 %global gnulib_ver 20180203 Summary: Utility for modifying/upgrading files @@ -15,7 +15,6 @@ patch1: patch-2.7.6-test-suite-compatibility-fixes.patch Patch2: patch-2.7.6-fix-korn-shell-incompatibility.patch Patch3: patch-2.7.6-fix-segfault-with-mangled-rename-patch.patch Patch4: patch-2.7.6-allow-input-files-to-be-missing-for-ed-style-patches.patch -# fix Malicious patch files cause ed to execute arbitrary commands Patch5: patch-CVE-2018-1000156.patch Patch6: patch-2.7.6-CVE-2019-13638-invoked-ed-directly-instead-of-using-the-shell.patch Patch7: patch-2.7.6-switch-from-fork-execlp-to-execute.patch @@ -31,34 +30,51 @@ Patch16: patch-2.7.6-improve_support_for_memory_leak_detection.patch patch17: patch-2.7.6-skip-ed-test-when-the-ed-utility-is-not-installed.patch Patch18: patch-2.7.6-abort_when_cleaning_up_fails.patch Patch19: patch-2.7.6-crash-RLIMIT_NOFILE.patch -# fix OS shell command injection when processing crafted patch files Patch20: patch-2.7.6-CVE-2019-13636-symlinks.patch Patch21: patch-2.7.6-avoid-invalid-memory-access-in-context-format-diffs.patch -# fix heap-based buffer overflow Patch22: patch-2.7.6-CVE-2018-17942.patch Patch23: patch-2.7.6-failed_assertion.patch Patch100: patch-selinux.patch -BuildRequires: make -BuildRequires: gcc -BuildRequires: libselinux-devel -BuildRequires: libattr-devel BuildRequires: ed -BuildRequires: autoconf automake +BuildRequires: libattr-devel +BuildRequires: libselinux-devel +BuildRequires: make gcc autoconf automake Requires: ed Provides: bundled(gnulib) = %{gnulib_ver} %description -The patch program applies diff files to originals. The diff command -is used to compare an original to a changed file. Diff lists the -changes made to the file. A person who has the original file can then -use the patch command with the diff file to add the changes to their -original file (patching the file). - -Patch should be installed because it is a common way of upgrading -applications. +Patch is a common Linux utility used for creating, modifying and applying patches +to source code. It is used to update, fix or improve software applications and +operating systems. This tool compares two files and generates a patch file +containing the differences between them. This patch file can be used to apply +the same changes to other files or directories. + +Patch operates on files using a diff file format that contains a set of +instructions for changing one file to another. The diff format denotes the +additions and deletions in a file using a plus sign (+) or a minus sign (-) +respectively. + +When using patch, the user first creates a patch file using the diff utility, +which generates a patch file containing the differences between two files. The +patch file can then be applied to the original file, which will update it based +on the changes defined in the patch file. + +Patch can be used to apply multiple patches to one or more files, as it can +process an entire directory of files at once. It also supports recursive +directory processing, which can save time when updating large software projects. + +One of the benefits of using patch is that it creates a log of changes with the +original file, allowing users to track changes and their authors. This feature +is particularly useful for software development teams who need to track changes +made to their applications. + +In summary, patch is a Linux tool used for creating, modifying, and applying +patches to source code. It can be used for updating, fixing or improving software +applications and operating systems, and it is often used by software development +teams to track changes made to their projects. %package doc Summary: Documentation files for %{name} @@ -69,35 +85,7 @@ BuildArch: noarch The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q -%patch0 -p1 -b .avoid-set_file_attributes-sign-conversion-warnings -%patch1 -p1 -b .test-suite-compatibility-fixes -%patch2 -p1 -b .fix-korn-shell-incompatibility -%patch3 -p1 -b .fix-segfault-with-mangled-rename-patch -%patch4 -p1 -b .allow-input-files-to-be-missing-for-ed-style-patches -# Malicious patch files cause ed to execute arbitrary commands -%patch5 -p1 -b .CVE-2018-1000156 -%patch6 -p1 -b .CVE-2019-13638-invoked-ed-directly-instead-of-using-the-shell -%patch7 -p1 -b .switch-from-fork-execlp-to-execute -%patch8 -p1 -b .cleanups-in-do_ed_script -%patch9 -p1 -b .avoid-warnings-gcc8 -%patch10 -p1 -b .check-of-return-value-of-fwrite -%patch11 -p1 -b .fix-ed-style-test-failure -%patch12 -p1 -b .dont-leak-temporary-file-on-failed-ed-style-patch -%patch13 -p1 -b .dont-leak-temporary-file-on-failed-multi-file-ed-style-patch -%patch14 -p1 -b .make-debug-output-more-useful -%patch15 -p1 -b .CVE-2018-6952-fix-swapping-fake-lines-in-pch_swap -%patch16 -p1 -b .improve_support_for_memory_leak_detection -%patch17 -p1 -b .skip-ed-test-when-the-ed-utility-is-not-installed -%patch18 -p1 -b .abort_when_cleaning_up_fails -%patch19 -p1 -b .crash-RLIMIT_NOFILE -%patch20 -p1 -b .CVE-2019-13636-symlinks -%patch21 -p1 -b .avoid-invalid-memory-access-in-context-format-diffs -# gnulib: heap-based buffer overflow -%patch22 -p1 -b .CVE-2018-17942-gnulib_buffer_overflow -%patch23 -p1 -b .failed_assertion -# SELinux support. -%patch100 -p1 -b .selinux +%autosetup -p1 %build CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" @@ -124,6 +112,9 @@ make check %doc NEWS README %changelog +* Thu Apr 13 2023 Xuchun Shang - 2.7.6-3 +- Optimize the spec + * Mon Feb 06 2023 Feng Su - 2.7.6-2 - add doc sub package - add abi/api files -- Gitee