diff --git a/fix-k-may-not-keep-uid-or-gid.patch b/fix-k-may-not-keep-uid-or-gid.patch new file mode 100644 index 0000000..6b095dd --- /dev/null +++ b/fix-k-may-not-keep-uid-or-gid.patch @@ -0,0 +1,29 @@ +From 7f15e07b7a94765459d51dfa315562187cc14161 Mon Sep 17 00:00:00 2001 +From: xujing +Date: Fri, 30 Sep 2022 09:19:10 +0800 +Subject: [PATCH] fix -k may not keep uid or gid + +when rpmrebuild run with -k and --change-files, some files may not keep uid or +gid. when use --change-files, remrebuild will mkdir a tmp dir and copy files to +tmp dir, and when use -k, files will be installed by %attr(-,-,-), which will +inherit permissions of tmp dir. However, --change-files only set permission. +--- + rpmrebuild_buildroot.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/rpmrebuild_buildroot.sh b/rpmrebuild_buildroot.sh +index 4af3c0a..4014ff8 100755 +--- a/rpmrebuild_buildroot.sh ++++ b/rpmrebuild_buildroot.sh +@@ -75,6 +75,8 @@ while :; do + file_perm="${file_perm#${not_perm}}" + Mkdir_p "$BuildRoot/$file" || Critical "$MY_BASENAME Mkdir_p $BuildRoot/$file" + chmod "$file_perm" "$BuildRoot/$file" || Critical "$MY_BASENAME chmod $file_perm $BuildRoot/$file" ++ chown "$file_user" "$BuildRoot/$file" || Critical "$MY_BASENAME chown $file_user $BuildRoot/$file" ++ chgrp "$file_group" "$BuildRoot/$file" || Critical "$MY_BASENAME chgrp $file_group $BuildRoot/$file" + ;; + + *) +-- +2.33.0 + diff --git a/rpmrebuild.spec b/rpmrebuild.spec index 5944016..951f659 100644 --- a/rpmrebuild.spec +++ b/rpmrebuild.spec @@ -1,6 +1,6 @@ Name: rpmrebuild Version: 2.16 -Release: 3 +Release: 4 Summary: A tool to build a rpm file from the rpm database License: GPLv2+ URL: http://rpmrebuild.sourceforge.net @@ -8,6 +8,7 @@ Source0: https://downloads.sourceforge.net/rpmrebuild/%{name}-%{version}. Patch9000: bugfix-reset-defattr-when-users-want-to-keep-files-permissi.patch Patch9001: openEuler-fix-the-CreateBuildRoot-error-when-using-rpmrebuild-command.patch +Patch9002: fix-k-may-not-keep-uid-or-gid.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -59,6 +60,12 @@ rm -rf $RPM_BUILD_ROOT%{_mandir}/fr_FR.UTF-8/man1/ %{_mandir}/fr/man1/*.gz %changelog +* Tue Oct 18 2022 dongyuzhen - 2.16-4 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:change the uid and gid of directories newly created when run with --change-files + * Tue Jun 28 2022 dongyuzhen - 2.16-3 - Type:bugfix - CVE:NA