Loosen up restrictions on dependency token names (rhbz#455119)
authorPanu Matilainen <pmatilai@redhat.com>
Sat, 21 Feb 2009 10:11:54 +0000 (12:11 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Sat, 21 Feb 2009 10:11:54 +0000 (12:11 +0200)
- Package names aren't restricted to ascii, no point restricting
  dependency names either.
- This lets UTF-8 to go through but also all sorts of other junk but
  as we haven't got a clue about the specs encoding, no can do. So we
  only check for bad characters from plain ascii.

build/parseReqs.c

index 54230c7..f2130ec 100644 (file)
@@ -100,8 +100,11 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN,
 
        Flags = (tagflags & ~RPMSENSE_SENSEMASK);
 
-       /* Tokens must begin with alphanumeric, _, or / */
-       if (!(risalnum(r[0]) || r[0] == '_' || r[0] == '/')) {
+       /* 
+        * Tokens must begin with alphanumeric, _, or /, but we don't know
+        * the spec's encoding so we only check what we can: plain ascii.
+        */
+       if (isascii(r[0]) && !(risalnum(r[0]) || r[0] == '_' || r[0] == '/')) {
            rpmlog(RPMLOG_ERR,
                     _("line %d: Dependency tokens must begin with alpha-numeric, '_' or '/': %s\n"),
                     spec->lineNum, spec->line);