From 70e6e124e10886207ac4bc697b9cf77af7014050 Mon Sep 17 00:00:00 2001 From: xujing Date: Tue, 8 Nov 2022 11:02:06 +0800 Subject: [PATCH] rpmrebuild: fix --cap-from-fs does not work (cherry picked from commit df35c822ceaaf45da939d30a197564d16530c48a) --- fix-cap-from-fs-does-not-work.patch | 38 +++++++++++++++++++++++++++++ rpmrebuild.spec | 9 ++++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 fix-cap-from-fs-does-not-work.patch diff --git a/fix-cap-from-fs-does-not-work.patch b/fix-cap-from-fs-does-not-work.patch new file mode 100644 index 0000000..e1c8f92 --- /dev/null +++ b/fix-cap-from-fs-does-not-work.patch @@ -0,0 +1,38 @@ +From d0df2f1aef9784e09467a8b513fa14135a6d3928 Mon Sep 17 00:00:00 2001 +From: xujing +Date: Tue, 8 Nov 2022 10:51:34 +0800 +Subject: [PATCH] fix --cap-from-fs does not work + +--- + rpmrebuild_files.sh | 2 +- + rpmrebuild_parser.src | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/rpmrebuild_files.sh b/rpmrebuild_files.sh +index 1afc484..fb40709 100755 +--- a/rpmrebuild_files.sh ++++ b/rpmrebuild_files.sh +@@ -193,7 +193,7 @@ while :; do + + # %caps handling + if [ "X$RPMREBUILD_CAP_FROM_FS" = "Xyes" ]; then +- file_cap=$( getcap "$file" | cut -f2 -d= ) ++ file_cap=$( getcap "$file" | cut -f2 -d' ' ) + else + # get capability from rpm query + [ "X$file_cap" = "X(none)" ] && file_cap="" +diff --git a/rpmrebuild_parser.src b/rpmrebuild_parser.src +index 2f400ac..cbdb516 100755 +--- a/rpmrebuild_parser.src ++++ b/rpmrebuild_parser.src +@@ -1235,6 +1235,7 @@ function CommandLineParsing + + export RPMREBUILD_COMMENT_MISSING="no" + export RPMREBUILD_PUG_FROM_FS="no" ++ export RPMREBUILD_CAP_FROM_FS="no" + export RPMREBUILD_WARNING="no" + + PAQUET="" +-- +2.27.0 + diff --git a/rpmrebuild.spec b/rpmrebuild.spec index 00b5638..0e47c6f 100644 --- a/rpmrebuild.spec +++ b/rpmrebuild.spec @@ -1,6 +1,6 @@ Name: rpmrebuild Version: 2.16 -Release: 5 +Release: 6 Summary: A tool to build a rpm file from the rpm database License: GPLv2+ URL: http://rpmrebuild.sourceforge.net @@ -10,6 +10,7 @@ Patch9000: bugfix-reset-defattr-when-users-want-to-keep-files-permissi.patc Patch9001: openEuler-fix-the-CreateBuildRoot-error-when-using-rpmrebuild-command.patch Patch9002: fix-k-may-not-keep-uid-or-gid.patch Patch9003: fix-spelling-errors-that-could-mislead-users.patch +Patch9004: fix-cap-from-fs-does-not-work.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -61,6 +62,12 @@ rm -rf $RPM_BUILD_ROOT%{_mandir}/fr_FR.UTF-8/man1/ %{_mandir}/fr/man1/*.gz %changelog +* Tue Nov 8 2022 xujing - 2.16-6 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix --cap-from-fs does not work + * Tue Nov 8 2022 xujing - 2.16-5 - Type:bugfix - CVE:NA