From: jbj Date: Sun, 5 Jan 2003 19:30:54 +0000 (+0000) Subject: - file: avoid ogg/vorbis file classification problems. X-Git-Tag: rpm-4.4-release~742 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92676fe33232f6cac4847a6943f31bc303a54d26;p=platform%2Fupstream%2Frpm.git - file: avoid ogg/vorbis file classification problems. CVS patchset: 5996 CVS date: 2003/01/05 19:30:54 --- diff --git a/CHANGES b/CHANGES index b5e394f..62b7d89 100644 --- a/CHANGES +++ b/CHANGES @@ -97,6 +97,7 @@ - ignore items not in our rainbow (i.e. colors are functional). - fix: dependency helpers now rate limited at 10ms, not 1s. - add per-arch canonical color, only x86_64 enabled for now. + - file: avoid ogg/vorbis file classification problems. 4.0.4 -> 4.1: - loosely wire beecrypt library into rpm. diff --git a/file/Magdir/vorbis b/file/Magdir/vorbis index 6e4efad..dab2c3b 100644 --- a/file/Magdir/vorbis +++ b/file/Magdir/vorbis @@ -4,6 +4,7 @@ # # From Felix von Leitner # Extended by Beni Cherniavsky +# Further extended by Greg Wooledge # # Most (everything but the number of channels and bitrate) is commented # out with `##' as it's not interesting to the average user. The most @@ -25,38 +26,48 @@ >>>>39 ubyte 2 stereo, >>>>39 ubyte >2 %u channels, >>>>40 lelong x %lu Hz -# Minimal, nominal and maximal bitrates specified when encoding ->>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff \b, -# The above tests if at least one of these is specified: ->>>>>44 lelong !-1 ->>>>>>44 lelong x >%lu ->>>>>48 lelong !-1 ->>>>>>48 lelong x ~%lu ->>>>>52 lelong !-1 ->>>>>>52 lelong x <%lu ->>>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff kbps -# -- Second vorbis header packet - the comments ->>>102 string \x03vorbis -# A kludge to read the vendor string. It's a counted string, not a -# zero-terminated one, so file(1) can't read it in a generic way. -# libVorbis is the only one existing currently, so I detect specifically -# it. The interesting value is the cvs date (8 digits decimal). -##>>>>113 string/c Xiphophorus\ libVorbis\ I \b, created by: Xiphophorus libVorbis I -##>>>>>137 string >00000000 %.8s -# Map to beta version numbers: -##>>>>>>137 string <20000508 (>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff \b, +## The above tests if at least one of these is specified: +#>>>>>44 lelong !-1 +## Vorbis RC2 has a bug which puts -1000 in the min/max bitrate fields +## instead of -1. +#>>>>>>44 lelong !-1000 +#>>>>>>>44 lelong x >%lu +#>>>>>48 lelong !-1 +#>>>>>>48 lelong x ~%lu +#>>>>>52 lelong !-1 +#>>>>>>52 lelong !-1000 +#>>>>>>>52 lelong x <%lu +#>>>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff kbps +## -- Second vorbis header packet - the comments +## A kludge to read the vendor string. It's a counted string, not a +## zero-terminated one, so file(1) can't read it in a generic way. +## libVorbis is the only one existing currently, so I detect specifically +## it. The interesting value is the cvs date (8 digits decimal). +## Post-RC1 Ogg files have the second header packet (and thus the version) +## in a different place, so we must use an indirect offset. +#>>>(84.b+85) string \x03vorbis +#>>>>(84.b+96) string/c Xiphophorus\ libVorbis\ I \b, created by: Xiphophorus libVorbis I +#>>>>>(84.b+120) string >00000000 %.8s +## Map to beta version numbers: +#>>>>>>(84.b+120) string <20000508 (>>>>>(84.b+120) string 20000508 (beta1/2) +#>>>>>>(84.b+120) string >20000508 +#>>>>>>>(84.b+120) string <20001031 (beta2-3) +#>>>>>>(84.b+120) string 20001031 (beta3) +#>>>>>>(84.b+120) string >20001031 +#>>>>>>>(84.b+120) string <20010225 (beta3-4) +#>>>>>>(84.b+120) string 20010225 (beta4) +#>>>>>>(84.b+120) string >20010225 +#>>>>>>>(84.b+120) string <20010615 (beta4-RC1) +#>>>>>>(84.b+120) string 20010615 (RC1) +#>>>>>>(84.b+120) string 20010813 (RC2) +#>>>>>>(84.b+120) string 20010816 (RC2 - Garf tuned v1) +#>>>>>>(84.b+120) string 20011014 (RC2 - Garf tuned v2) +#>>>>>>(84.b+120) string 20011217 (pre-RC3 CVS) +#>>>>>>(84.b+120) string 20011231 (RC3) # The string has not changed from beta1 to 2 - they are indistinguishable. -##>>>>>>137 string 20000508 (beta1/2) -##>>>>>>137 string >20000508 -##>>>>>>>137 string <20001031 (beta2-3) -##>>>>>>137 string 20001031 (beta3) -##>>>>>>137 string >20001031 -##>>>>>>>137 string <20010225 (beta3-4) -##>>>>>>137 string 20010225 (beta4) -##>>>>>>137 string >20010225 -##>>>>>>>137 string <20010615 (beta4-RC1) -##>>>>>>137 string 20010615 (RC1) -##>>>>>>137 string >20010615 (>RC1) # Then come the comments, again length-counted (and number-counted). # Some looping constructs and registers would allow reading them but now # it's impossible. However we can print the number of comments present diff --git a/file/fsmagic.c b/file/fsmagic.c index 09be7a1..c4cfc04 100644 --- a/file/fsmagic.c +++ b/file/fsmagic.c @@ -152,7 +152,7 @@ fmagicD(fmagic fm) fmagicPrintf(fm, "unreadable symlink (%s).", strerror(errno)); return 1; } - buf[nch] = '\0'; /* readlink(2) forgets this */ + buf[nch] = '\0'; /* readlink(2) needs this */ /* If broken symlink, say so and quit early. */ /*@-branchstate@*/ @@ -324,7 +324,7 @@ fmagicProcess(fmagic fm, const char *fn, int wid) fmagicPrintf(fm, ((fm->flags & FMAGIC_FLAGS_MIME) ? "application/x-empty" : "empty"), fm); else { - fm->buf[fm->nb++] = '\0'; /* null-terminate it */ + fm->buf[fm->nb++] = '\0'; /* null-terminate data buffer */ match = fmagicF(fm, (fm->flags & FMAGIC_FLAGS_UNCOMPRESS)); } diff --git a/file/softmagic.c b/file/softmagic.c index a973f4c..bf7ddc6 100644 --- a/file/softmagic.c +++ b/file/softmagic.c @@ -994,11 +994,13 @@ fmagicSMatch(const fmagic fm) /*@globals fileSystem @*/ /*@modifies fm, fileSystem @*/ { + struct magic * m; uint32_t nmagic = fm->ml->nmagic; int cont_level = 0; int need_separator = 0; /*@only@*/ - static int32_t *tmpoff = NULL; + static int32_t * tmpoff = NULL; + static int tmpdelta = 64; static size_t tmplen = 0; int32_t oldoff = 0; int firstline = 1; /* a flag to print X\n X\n- X */ @@ -1006,7 +1008,6 @@ fmagicSMatch(const fmagic fm) int i; for (i = 0; i < nmagic; i++) { - struct magic * m; m = &fm->ml->magic[i]; /* if main entry matches, print it... */ if (!fmagicSGet(fm, m) || @@ -1025,8 +1026,10 @@ fmagicSMatch(const fmagic fm) fmagicPrintf(fm, "\n- "); } - if ((cont_level+1) >= tmplen) - tmpoff = (int32_t *) xrealloc(tmpoff, tmplen += 20); + if ((cont_level+1) >= tmplen) { + tmplen += tmpdelta; + tmpoff = xrealloc(tmpoff, tmplen); + } tmpoff[cont_level] = fmagicSPrint(fm, m); cont_level++; @@ -1071,8 +1074,10 @@ fmagicSMatch(const fmagic fm) fmagicPrintf(fm, " "); need_separator = 0; } - if ((cont_level+1) >= tmplen) - tmpoff = xrealloc(tmpoff, tmplen += 20); + if ((cont_level+1) >= tmplen) { + tmplen += tmpdelta; + tmpoff = xrealloc(tmpoff, tmplen); + } tmpoff[cont_level] = fmagicSPrint(fm, m); cont_level++; if (m->desc[0]) diff --git a/po/cs.po b/po/cs.po index 1acefdc..357f338 100644 --- a/po/cs.po +++ b/po/cs.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 2001-07-24 10:02+0100\n" "Last-Translator: Milan Kerslager \n" "Language-Team: Czech \n" diff --git a/po/da.po b/po/da.po index 9a84c24..9ee55a1 100644 --- a/po/da.po +++ b/po/da.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 2001-04-05 23:03GMT\n" "Last-Translator: Claus Hindsgaul \n" "Language-Team: Danish \n" diff --git a/po/de.po b/po/de.po index 3c565ea..3cdd667 100644 --- a/po/de.po +++ b/po/de.po @@ -37,7 +37,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 1998-08-03 18:02+02:00\n" "Last-Translator: Karl Eichwalder \n" "Language-Team: German \n" diff --git a/po/fi.po b/po/fi.po index b684667..fc189ea 100644 --- a/po/fi.po +++ b/po/fi.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 1998-05-02 21:41:47-0400\n" "Last-Translator: Raimo Koski \n" "Language-Team: Finnish \n" diff --git a/po/fr.po b/po/fr.po index 1e2711f..6d628b7 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/gl.po b/po/gl.po index 1e73b1a..ccc6fb9 100644 --- a/po/gl.po +++ b/po/gl.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.1\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 2001-01-13 22:31+0100\n" "Last-Translator: Jesús Bravo Álvarez \n" "Language-Team: Galician \n" diff --git a/po/is.po b/po/is.po index 4f719a4..16ead50 100644 --- a/po/is.po +++ b/po/is.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 2001-07-12 13:25+0000\n" "Last-Translator: Richard Allen \n" "Language-Team: is \n" diff --git a/po/ja.po b/po/ja.po index fd8c03e..cdc6291 100644 --- a/po/ja.po +++ b/po/ja.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 1999-12-01 22:49 +JST\n" "Last-Translator: Kanda Mitsuru \n" "Language-Team: JRPM \n" diff --git a/po/ko.po b/po/ko.po index fd2c6fa..a74d7d6 100644 --- a/po/ko.po +++ b/po/ko.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.4\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 2002-03-04 17:17+0900\n" "Last-Translator: Jong-Hoon Ryu \n" "Language-Team: GNU Translation project \n" diff --git a/po/no.po b/po/no.po index 2d7f8c4..35b4fea 100644 --- a/po/no.po +++ b/po/no.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 2001-06-27 12:24+0200\n" "Last-Translator: Kjartan Maraas \n" "Language-Team: Norwegian \n" diff --git a/po/pl.po b/po/pl.po index ee758a9..9bdfaf6 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 1999-05-25 17:00+0100\n" "Last-Translator: Pawe³ Dziekoñski \n" "Language-Team: Polish \n" diff --git a/po/pt.po b/po/pt.po index 91dcc43..0ea5a73 100644 --- a/po/pt.po +++ b/po/pt.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 2002-02-14 10:51+0000\n" "Last-Translator: José Nuno Coelho Sanarra Pires \n" "Language-Team: pt \n" "Language-Team: Romanian \n" diff --git a/po/rpm.pot b/po/rpm.pot index da2f065..605f845 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/ru.po b/po/ru.po index df01613..fc01fb0 100644 --- a/po/ru.po +++ b/po/ru.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 2002-08-27 13:36-0400\n" "Last-Translator: Eugene Kanter, \n" "Language-Team: Black Cat Linux Team \n" diff --git a/po/sk.po b/po/sk.po index c766e7f..47e7771 100644 --- a/po/sk.po +++ b/po/sk.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 1999-04-08 21:37+02:00\n" "Last-Translator: Stanislav Meduna \n" "Language-Team: Slovak \n" diff --git a/po/sl.po b/po/sl.po index 07d93cb..da9a90c 100644 --- a/po/sl.po +++ b/po/sl.po @@ -1,12 +1,12 @@ # -*- mode:po; coding:iso-latin-2; -*- Slovenian messages for Redhat pkg. mngr. # Copyright (C) 2000 Free Software Foundation, Inc. # Primo¾ Peterlin , 2000. -# $Id: sl.po,v 1.359 2003/01/01 20:33:32 jbj Exp $ +# $Id: sl.po,v 1.360 2003/01/05 19:31:26 jbj Exp $ # msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 2000-10-08 19:05+0200\n" "Last-Translator: Grega Fajdiga \n" "Language-Team: Slovenian \n" diff --git a/po/sr.po b/po/sr.po index bb4c21a..3276b6a 100644 --- a/po/sr.po +++ b/po/sr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-2\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/sv.po b/po/sv.po index c8de487..8e34551 100644 --- a/po/sv.po +++ b/po/sv.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.1\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 2002-08-19 22:26+0200\n" "Last-Translator: Göran Uddeborg \n" "Language-Team: Swedish \n" diff --git a/po/tr.po b/po/tr.po index e2bd8b3..7e3ef12 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-01 15:20-0500\n" +"POT-Creation-Date: 2003-01-05 14:26-0500\n" "PO-Revision-Date: 2001-07-05 08:02+300\n" "Last-Translator: Nilgun Belma Buguner \n" "Language-Team: Turkish \n" diff --git a/rpm.spec.in b/rpm.spec.in index 390dc05..3c68575 100644 --- a/rpm.spec.in +++ b/rpm.spec.in @@ -15,7 +15,7 @@ Name: rpm %define version @VERSION@ Version: %{version} %{expand: %%define rpm_version %{version}} -Release: 0.49 +Release: 0.51 Group: System Environment/Base Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz Copyright: GPL @@ -459,6 +459,9 @@ exit 0 %{__prefix}/include/popt.h %changelog +* Sun Jan 5 2003 Jeff Johnson 4.2-0.1 +- file: avoid ogg/vorbis file classification problems. + * Wed Jan 1 2003 Jeff Johnson 4.2-0.49 - add rpmts/rpmte/rpmfi/rpmds element colors. - ignore items not in our rainbow (i.e. colors are functional).