代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/rpm 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 63e3061fa2471c663bed43d02f97c80953dfc9f7 Mon Sep 17 00:00:00 2001
From: Michal Domonkos <mdomonko@redhat.com>
Date: Wed, 23 Oct 2024 15:45:07 +0200
Subject: [PATCH] Require macro filenames to end in alphanum char
Conflict:modify macro.c instead of macro.cc; use AT_{CHECK,CLEANUP}
instead of RPMTEST_{CHECK,CLEANUP} because adafe8d04724b is not merged;
use "/usr/lib/rpm" instead of $RPM_CONFIGDIR_PATH because f134eb1 and
1592f16 are not merged; "mkdir -p $RPMTEST/usr/lib/rpm/macros.d/" to
ensure directory exist.
Reference:https://github.com/rpm-software-management/rpm/commit/63e3061fa2471c663bed43d02f97c80953dfc9f7
Make sure (text editor) backup files, such as those with the tilde (~)
at the end, aren't processed by our macrofiles globs. These can appear
while editing a macro file in place and may result in confusing behavior
where an old version of a macro overrides the one being written, like
seen in the ticket #3373.
Rather than enumerating any specific suffixes, just mandate that macro
files end with alphanumerics. That's more of a name sanity check than
anything but fits the bill here.
Co-authored-by: Peter Oliver <git@mavit.org.uk>
---
rpmio/macro.c | 4 +++-
tests/rpmmacro.at | 18 ++++++++++++++++++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 1a9f2f63a..11668b7ee 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -1981,9 +1981,11 @@ rpmInitMacros(rpmMacroContext mc, const char * macrofiles)
/* Read macros from each file. */
for (path = files; *path; path++) {
+ size_t len = strlen(*path);
if (rpmFileHasSuffix(*path, ".rpmnew") ||
rpmFileHasSuffix(*path, ".rpmsave") ||
- rpmFileHasSuffix(*path, ".rpmorig")) {
+ rpmFileHasSuffix(*path, ".rpmorig") ||
+ (len > 0 && !risalnum((*path)[len - 1]))) {
continue;
}
(void) loadMacroFile(mc, *path);
diff --git a/tests/rpmmacro.at b/tests/rpmmacro.at
index 50096fd5d..968d48ee7 100644
--- a/tests/rpmmacro.at
+++ b/tests/rpmmacro.at
@@ -2,6 +2,24 @@
#
AT_BANNER([RPM macros])
+# ------------------------------
+AT_SETUP([macro path: skip editor backups])
+AT_KEYWORDS([macros])
+RPMTEST_SETUP
+AT_CHECK([
+mkdir -p $RPMTEST/usr/lib/rpm/macros.d/
+echo '%this that' > $RPMTEST/usr/lib/rpm/macros.d/macros.this
+runroot rpm --eval '%{this}'
+mv $RPMTEST/usr/lib/rpm/macros.d/macros.this{,~}
+runroot rpm --eval '%{this}'
+],
+[0],
+[that
+%{this}
+],
+[])
+AT_CLEANUP
+
# ------------------------------
AT_SETUP([simple rpm --eval])
AT_KEYWORDS([macros])
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。