teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

Blame rpm-4.6.0-utf-dependencies.patch

Panu Matilainen 3f11e3
commit 58e92b976aebe43ebddbe2d2ec41bff0dd46b6fc
Panu Matilainen 3f11e3
Author: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen 3f11e3
Date:   Sat Feb 21 12:11:54 2009 +0200
Panu Matilainen 3f11e3
Panu Matilainen 3f11e3
    Loosen up restrictions on dependency token names (rhbz#455119)
Panu Matilainen 3f11e3
    - Package names aren't restricted to ascii, no point restricting
Panu Matilainen 3f11e3
      dependency names either.
Panu Matilainen 3f11e3
    - This lets UTF-8 to go through but also all sorts of other junk but
Panu Matilainen 3f11e3
      as we haven't got a clue about the specs encoding, no can do. So we
Panu Matilainen 3f11e3
      only check for bad characters from plain ascii.
Panu Matilainen 3f11e3
Panu Matilainen 3f11e3
diff --git a/build/parseReqs.c b/build/parseReqs.c
Panu Matilainen 3f11e3
index 54230c7..f2130ec 100644
Panu Matilainen 3f11e3
--- a/build/parseReqs.c
Panu Matilainen 3f11e3
+++ b/build/parseReqs.c
Panu Matilainen 3f11e3
@@ -100,8 +100,11 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN,
Panu Matilainen 3f11e3
 
Panu Matilainen 3f11e3
 	Flags = (tagflags & ~RPMSENSE_SENSEMASK);
Panu Matilainen 3f11e3
 
Panu Matilainen 3f11e3
-	/* Tokens must begin with alphanumeric, _, or / */
Panu Matilainen 3f11e3
-	if (!(risalnum(r[0]) || r[0] == '_' || r[0] == '/')) {
Panu Matilainen 3f11e3
+	/* 
Panu Matilainen 3f11e3
+	 * Tokens must begin with alphanumeric, _, or /, but we don't know
Panu Matilainen 3f11e3
+	 * the spec's encoding so we only check what we can: plain ascii.
Panu Matilainen 3f11e3
+	 */
Panu Matilainen 3f11e3
+	if (isascii(r[0]) && !(risalnum(r[0]) || r[0] == '_' || r[0] == '/')) {
Panu Matilainen 3f11e3
 	    rpmlog(RPMLOG_ERR,
Panu Matilainen 3f11e3
 		     _("line %d: Dependency tokens must begin with alpha-numeric, '_' or '/': %s\n"),
Panu Matilainen 3f11e3
 		     spec->lineNum, spec->line);