- file: avoid ogg/vorbis file classification problems.
authorjbj <devnull@localhost>
Sun, 5 Jan 2003 19:30:54 +0000 (19:30 +0000)
committerjbj <devnull@localhost>
Sun, 5 Jan 2003 19:30:54 +0000 (19:30 +0000)
CVS patchset: 5996
CVS date: 2003/01/05 19:30:54

26 files changed:
CHANGES
file/Magdir/vorbis
file/fsmagic.c
file/softmagic.c
po/cs.po
po/da.po
po/de.po
po/fi.po
po/fr.po
po/gl.po
po/is.po
po/ja.po
po/ko.po
po/no.po
po/pl.po
po/pt.po
po/pt_BR.po
po/ro.po
po/rpm.pot
po/ru.po
po/sk.po
po/sl.po
po/sr.po
po/sv.po
po/tr.po
rpm.spec.in

diff --git a/CHANGES b/CHANGES
index b5e394f..62b7d89 100644 (file)
--- 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.
index 6e4efad..dab2c3b 100644 (file)
@@ -4,6 +4,7 @@
 #
 # From Felix von Leitner <leitner@fefe.de>
 # Extended by Beni Cherniavsky <cben@crosswinds.net>
+# Further extended by Greg Wooledge <greg@wooledge.org>
 #
 # Most (everything but the number of channels and bitrate) is commented
 # out with `##' as it's not interesting to the average user.  The most
 >>>>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       (<beta1 - prepublic)
+## 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
+## 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       (<beta1 - prepublic)
+#>>>>>>(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
index 09be7a1..c4cfc04 100644 (file)
@@ -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));
        }
 
index a973f4c..bf7ddc6 100644 (file)
@@ -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])
index 1acefdc..357f338 100644 (file)
--- 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 <kerslage@linux.cz>\n"
 "Language-Team: Czech <cs@li.org>\n"
index 9a84c24..9ee55a1 100644 (file)
--- 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 <claus_h@image.dk>\n"
 "Language-Team: Danish <dansk@klid.dk>\n"
index 3c565ea..3cdd667 100644 (file)
--- 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 <ke@SuSE.DE>\n"
 "Language-Team: German <de@li.org>\n"
index b684667..fc189ea 100644 (file)
--- 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 <rkoski@pp.weppi.fi>\n"
 "Language-Team: Finnish <linux@sot.com>\n"
index 1e2711f..6d628b7 100644 (file)
--- 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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 1e73b1a..ccc6fb9 100644 (file)
--- 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 <jba@pobox.com>\n"
 "Language-Team: Galician <trasno@ceu.fi.udc.es>\n"
index 4f719a4..16ead50 100644 (file)
--- 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 <ra@hp.is>\n"
 "Language-Team: is <kde-isl@mmedia.is>\n"
index fd8c03e..cdc6291 100644 (file)
--- 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 <kanda@nn.iij4u.or.jp>\n"
 "Language-Team: JRPM <jrpm@linux.or.jp>\n"
index fd2c6fa..a74d7d6 100644 (file)
--- 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 <redhat4u@netian.com>\n"
 "Language-Team: GNU Translation project <ko@li.org>\n"
index 2d7f8c4..35b4fea 100644 (file)
--- 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 <kmaraas@gnome.org>\n"
 "Language-Team: Norwegian <no@li.org>\n"
index ee758a9..9bdfaf6 100644 (file)
--- 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 <pdziekonski@mml.ch.pwr.wroc.pl>\n"
 "Language-Team: Polish <pl@li.org>\n"
index 91dcc43..0ea5a73 100644 (file)
--- 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 <jncp@rnl.ist.utl.pt>\n"
 "Language-Team: pt <morais@kde.org\n"
index 984d689..e19bbde 100644 (file)
@@ -4,7 +4,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-1\n"
 "Content-Transfer-Encoding: 8-bit\n"
index 3589ce9..4d192e9 100644 (file)
--- a/po/ro.po
+++ b/po/ro.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-10 12:00+EST\n"
 "Last-Translator: Cristian Gafton <gafton@redhat.com>\n"
 "Language-Team: Romanian <ro@li.org>\n"
index da2f065..605f845 100644 (file)
@@ -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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index df01613..fc01fb0 100644 (file)
--- 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, <eugene@blackcatlinux.com>\n"
 "Language-Team: Black Cat Linux Team <blackcat-support@blackcatlinux.com>\n"
index c766e7f..47e7771 100644 (file)
--- 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 <stano@eunet.sk>\n"
 "Language-Team: Slovak <sk-i18n@rak.isternet.sk>\n"
index 07d93cb..da9a90c 100644 (file)
--- 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 <primoz.peterlin@biofiz.mf.uni-lj.si>, 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 <gregor.fajdiga@telemach.net>\n"
 "Language-Team: Slovenian <sl@li.org>\n"
index bb4c21a..3276b6a 100644 (file)
--- 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"
index c8de487..8e34551 100644 (file)
--- 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 <goeran@uddeborg.pp.se>\n"
 "Language-Team: Swedish <sv@li.org>\n"
index e2bd8b3..7e3ef12 100644 (file)
--- 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 <nilgun@technologist.com>\n"
 "Language-Team: Turkish <tr@li.org>\n"
index 390dc05..3c68575 100644 (file)
@@ -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 <jbj@redhat.com> 4.2-0.1
+- file: avoid ogg/vorbis file classification problems.
+
 * Wed Jan  1 2003 Jeff Johnson <jbj@redhat.com> 4.2-0.49
 - add rpmts/rpmte/rpmfi/rpmds element colors.
 - ignore items not in our rainbow (i.e. colors are functional).