summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-12-17 08:43:31 +0200
committerPanu Matilainen <pmatilai@redhat.com>2009-12-17 08:43:31 +0200
commit507f21f6bb4bf7029a0bca255cfe4aae3361f358 (patch)
treec70bfd2579fb534ff6339da32cd6bd0136c3380a /build
parent72f210f56abee3f704ba1a1b32c06e294473f9b9 (diff)
downloadrpm-507f21f6bb4bf7029a0bca255cfe4aae3361f358.tar.gz
rpm-507f21f6bb4bf7029a0bca255cfe4aae3361f358.tar.bz2
rpm-507f21f6bb4bf7029a0bca255cfe4aae3361f358.zip
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.
Diffstat (limited to 'build')
-rw-r--r--build/parsePreamble.c4
-rw-r--r--build/parseReqs.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index 82744fd60..b5f1780bd 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 1a657a6d7..d12aca329 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;