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..6d95400 --- /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 c83f6eb..1cd119f 100755 +--- a/rpmrebuild_buildroot.sh ++++ b/rpmrebuild_buildroot.sh +@@ -74,6 +74,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.23.0 + diff --git a/rpmrebuild.spec b/rpmrebuild.spec index ea2c822..ef469fb 100644 --- a/rpmrebuild.spec +++ b/rpmrebuild.spec @@ -1,12 +1,13 @@ Name: rpmrebuild Version: 2.15 -Release: 2 +Release: 3 Summary: A tool to build a rpm file from the rpm database License: GPLv2+ URL: http://rpmrebuild.sourceforge.net Source0: https://downloads.sourceforge.net/rpmrebuild/%{name}-%{version}.tar.gz Patch9000: bugfix-reset-defattr-when-users-want-to-keep-files-permissi.patch +Patch9001: fix-k-may-not-keep-uid-or-gid.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -58,6 +59,12 @@ rm -rf $RPM_BUILD_ROOT%{_mandir}/fr_FR.UTF-8/man1/ %{_mandir}/fr/man1/*.gz %changelog +* Tue Oct 18 2022 dongyuzhen - 2.15-3 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:change the uid and gid of directories newly created when run with --change-files + * Mon Mar 28 2022 yuanxin - 2.15-2 - Type:bugfix - ID:NA