6dc5ba - permit unexpanded macros when parsing spec (#547997)

Authored and Committed by Panu Matilainen 15 years ago
    - permit unexpanded macros when parsing spec (#547997)
    
        
rpm-4.7.90-spec-allow-unexpanded-macros.patch ADDED
@@ -0,0 +1,43 @@
1
+ commit 507f21f6bb4bf7029a0bca255cfe4aae3361f358
2
+ Author: Panu Matilainen <pmatilai@redhat.com>
3
+ Date: Thu Dec 17 08:43:31 2009 +0200
4
+
5
+ Permit unexpanded macros to slip through spec tag sanity checks (RhBug:547997)
6
+ - For now, let %{} characters through our valid character set checks
7
+ on specs. This isn't right really, but unexpanded, unrelated macros
8
+ in spec can now cause failure to parse out buildrequires which would
9
+ allow those macros to be expanded. This needs a better fix.
10
+
11
+ diff --git a/build/parsePreamble.c b/build/parsePreamble.c
12
+ index 82744fd..b5f1780 100644
13
+ --- a/build/parsePreamble.c
14
+ +++ b/build/parsePreamble.c
15
+ @@ -517,13 +517,13 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
16
+ switch (tag) {
17
+ case RPMTAG_NAME:
18
+ SINGLE_TOKEN_ONLY;
19
+ - if (rpmCharCheck(spec, field, strlen(field), ".-_+") != RPMRC_OK) return RPMRC_FAIL;
20
+ + if (rpmCharCheck(spec, field, strlen(field), ".-_+%{}") != RPMRC_OK) return RPMRC_FAIL;
21
+ headerPutString(pkg->header, tag, field);
22
+ break;
23
+ case RPMTAG_VERSION:
24
+ case RPMTAG_RELEASE:
25
+ SINGLE_TOKEN_ONLY;
26
+ - if (rpmCharCheck(spec, field, strlen(field), "._+") != RPMRC_OK) return RPMRC_FAIL;
27
+ + if (rpmCharCheck(spec, field, strlen(field), "._+%{}") != RPMRC_OK) return RPMRC_FAIL;
28
+ headerPutString(pkg->header, tag, field);
29
+ break;
30
+ case RPMTAG_URL:
31
+ diff --git a/build/parseReqs.c b/build/parseReqs.c
32
+ index 1a657a6..d12aca3 100644
33
+ --- a/build/parseReqs.c
34
+ +++ b/build/parseReqs.c
35
+ @@ -168,7 +168,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN,
36
+ }
37
+ EVR = xmalloc((ve-v) + 1);
38
+ rstrlcpy(EVR, v, (ve-v) + 1);
39
+ - if (rpmCharCheck(spec, EVR, ve-v, ".-_+:")) goto exit;
40
+ + if (rpmCharCheck(spec, EVR, ve-v, ".-_+:%{}")) goto exit;
41
+ re = ve; /* ==> next token after EVR string starts here */
42
+ } else
43
+ EVR = NULL;
file modified
+6 -1
rpm.spec CHANGED
@@ -21,7 +21,7 @@
21
21
Summary: The RPM package management system
22
22
Name: rpm
23
23
Version: %{rpmver}
24
- Release: 0.%{snapver}.3
24
+ Release: 0.%{snapver}.4
25
25
Group: System Environment/Base
26
26
Url: http://www.rpm.org/
27
27
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@@ -39,6 +39,7 @@ Patch3: rpm-4.7.90-fedora-specspo.patch
39
39
# Patches already in upstream
40
40
Patch200: rpm-4.7.90-python-bytecompile.patch
41
41
Patch201: rpm-4.7.90-python-refcounts.patch
42
+ Patch202: rpm-4.7.90-spec-allow-unexpanded-macros.patch
42
43
43
44
# These are not yet upstream
44
45
Patch301: rpm-4.6.0-niagara.patch
@@ -185,6 +186,7 @@ packages on a system.
185
186
186
187
%patch200 -p1 -b .python-bytecompile
187
188
%patch201 -p1 -b .python-refcounts
189
+ %patch202 -p1 -b .spec-unexpanded-macros
188
190
189
191
%patch301 -p1 -b .niagara
190
192
%patch302 -p1 -b .geode
@@ -399,6 +401,9 @@ exit 0
399
401
%doc doc/librpm/html/*
400
402
401
403
%changelog
404
+ * Thu Dec 17 2009 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-0.beta1.4
405
+ - permit unexpanded macros when parsing spec (#547997)
406
+
402
407
* Wed Dec 09 2009 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-0.beta1.3
403
408
- fix a bunch of python refcount-errors causing major memory leaks
404
409