public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: - permit unexpanded macros when parsing spec (#547997)
@ 2026-11-23  9:26 Panu Matilainen
  0 siblings, 0 replies; only message in thread
From: Panu Matilainen @ 2026-11-23  9:26 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 6dc5ba3bbe408f8e216a0d3b1e322a10884b7ba1
Author : Panu Matilainen <pmatilai@fedoraproject.org>
Date   : 2009-12-17T06:54:51+00:00
Stats  : +49/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/6dc5ba3bbe408f8e216a0d3b1e322a10884b7ba1?branch=pmatilai-v6

Log:
- permit unexpanded macros when parsing spec (#547997)

---
diff --git a/rpm-4.7.90-spec-allow-unexpanded-macros.patch b/rpm-4.7.90-spec-allow-unexpanded-macros.patch
new file mode 100644
index 0000000..3fa4bd3
--- /dev/null
+++ b/rpm-4.7.90-spec-allow-unexpanded-macros.patch
@@ -0,0 +1,43 @@
+commit 507f21f6bb4bf7029a0bca255cfe4aae3361f358
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Thu Dec 17 08:43:31 2009 +0200
+
+    Permit unexpanded macros to slip through spec tag sanity checks (RhBug:547997)
+    - For now, let %{} characters through our valid character set checks
+      on specs. This isn't right really, but unexpanded, unrelated macros
+      in spec can now cause failure to parse out buildrequires which would
+      allow those macros to be expanded. This needs a better fix.
+
+diff --git a/build/parsePreamble.c b/build/parsePreamble.c
+index 82744fd..b5f1780 100644
+--- a/build/parsePreamble.c
++++ b/build/parsePreamble.c
+@@ -517,13 +517,13 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
+     switch (tag) {
+     case RPMTAG_NAME:
+ 	SINGLE_TOKEN_ONLY;
+-	if (rpmCharCheck(spec, field, strlen(field), ".-_+") != RPMRC_OK) return RPMRC_FAIL;
++	if (rpmCharCheck(spec, field, strlen(field), ".-_+%{}") != RPMRC_OK) return RPMRC_FAIL;
+ 	headerPutString(pkg->header, tag, field);
+ 	break;
+     case RPMTAG_VERSION:
+     case RPMTAG_RELEASE:
+ 	SINGLE_TOKEN_ONLY;
+-	if (rpmCharCheck(spec, field, strlen(field), "._+") != RPMRC_OK) return RPMRC_FAIL;
++	if (rpmCharCheck(spec, field, strlen(field), "._+%{}") != RPMRC_OK) return RPMRC_FAIL;
+ 	headerPutString(pkg->header, tag, field);
+ 	break;
+     case RPMTAG_URL:
+diff --git a/build/parseReqs.c b/build/parseReqs.c
+index 1a657a6..d12aca3 100644
+--- a/build/parseReqs.c
++++ b/build/parseReqs.c
+@@ -168,7 +168,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN,
+ 	    }
+ 	    EVR = xmalloc((ve-v) + 1);
+ 	    rstrlcpy(EVR, v, (ve-v) + 1);
+-	    if (rpmCharCheck(spec, EVR, ve-v, ".-_+:")) goto exit;
++	    if (rpmCharCheck(spec, EVR, ve-v, ".-_+:%{}")) goto exit;
+ 	    re = ve;	/* ==> next token after EVR string starts here */
+ 	} else
+ 	    EVR = NULL;

diff --git a/rpm.spec b/rpm.spec
index b20313a..4c6d0ab 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -21,7 +21,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: 0.%{snapver}.3
+Release: 0.%{snapver}.4
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@@ -39,6 +39,7 @@ Patch3: rpm-4.7.90-fedora-specspo.patch
 # Patches already in upstream
 Patch200: rpm-4.7.90-python-bytecompile.patch
 Patch201: rpm-4.7.90-python-refcounts.patch
+Patch202: rpm-4.7.90-spec-allow-unexpanded-macros.patch
 
 # These are not yet upstream
 Patch301: rpm-4.6.0-niagara.patch
@@ -185,6 +186,7 @@ packages on a system.
 
 %patch200 -p1 -b .python-bytecompile
 %patch201 -p1 -b .python-refcounts
+%patch202 -p1 -b .spec-unexpanded-macros
 
 %patch301 -p1 -b .niagara
 %patch302 -p1 -b .geode
@@ -399,6 +401,9 @@ exit 0
 %doc doc/librpm/html/*
 
 %changelog
+* Thu Dec 17 2009 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-0.beta1.4
+- permit unexpanded macros when parsing spec (#547997)
+
 * Wed Dec 09 2009 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-0.beta1.3
 - fix a bunch of python refcount-errors causing major memory leaks
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  9:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  9:26 [rpms/rpm] pmatilai-v6: - permit unexpanded macros when parsing spec (#547997) Panu Matilainen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox