Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/dist/file file 4.06



details:   https://anonhg.NetBSD.org/src/rev/d7ddf8376fc3
branches:  trunk
changeset: 554372:d7ddf8376fc3
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Oct 27 16:14:00 2003 +0000

description:
file 4.06

magic and bug fixes

diffstat:

 dist/file/ChangeLog            |   17 ++++
 dist/file/doc/libmagic.3       |   32 +++++++-
 dist/file/magic/Makefile.am    |    4 +-
 dist/file/magic/magdir/amigaos |   18 +++++
 dist/file/magic/magdir/iff     |    2 +
 dist/file/magic/magdir/images  |   19 +++++
 dist/file/magic/magdir/psion   |   43 ++++++++++++
 dist/file/magic/magdir/sysex   |   51 ++++++++++++++
 dist/file/magic/magic.mime     |    2 +
 dist/file/src/apptype.c        |   22 +++---
 dist/file/src/compress.c       |   27 +++----
 dist/file/src/fsmagic.c        |  146 +++++++++++++++++++++++-----------------
 dist/file/src/funcs.c          |   62 ++++++++++++++--
 dist/file/src/is_tar.c         |    8 +-
 dist/file/src/magic.h          |   24 +++---
 dist/file/src/names.h          |    8 +-
 dist/file/src/patchlevel.h     |    9 +-
 dist/file/src/softmagic.c      |   51 ++++++++++++--
 dist/file/src/tar.h            |    6 +-
 19 files changed, 414 insertions(+), 137 deletions(-)

diffs (truncated from 1073 to 300 lines):

diff -r e68125c89f06 -r d7ddf8376fc3 dist/file/ChangeLog
--- a/dist/file/ChangeLog       Mon Oct 27 14:11:46 2003 +0000
+++ b/dist/file/ChangeLog       Mon Oct 27 16:14:00 2003 +0000
@@ -1,3 +1,20 @@
+
+2003-10-14 21:39  Christos Zoulas  <christos%zoulas.com@localhost>
+       * Python bindings (Brett Funderburg) <brettf%deepfile.com@localhost>
+       * Don't lookup past the end of the buffer
+         (Chad Hanson) <chanson%tcs-sec.com@localhost>
+       * Add MAGIC_ERROR and api on magic_errno()
+
+2003-10-08 12:40  Christos Zoulas  <christos%zoulas.com@localhost>
+
+       * handle error conditions from compile as fatal
+         (Antti Kantee) <pooka%netbsd.org@localhost>
+       * handle magic filename parsing sanely
+       * more magic fixes.
+       * fix a memory leak (Illes Marton) <illes.marton%balabit.hu@localhost>
+       * describe magic file handling
+         (Bryan Henderson) <bryanh%giraffe-data.com@localhost>
+
 2003-09-12 15:09  Christos Zoulas  <christos%zoulas.com@localhost>
 
        * update magic files.
diff -r e68125c89f06 -r d7ddf8376fc3 dist/file/doc/libmagic.3
--- a/dist/file/doc/libmagic.3  Mon Oct 27 14:11:46 2003 +0000
+++ b/dist/file/doc/libmagic.3  Mon Oct 27 16:14:00 2003 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: libmagic.3,v 1.1.1.3 2003/09/25 17:58:56 pooka Exp $
+.\"    $NetBSD: libmagic.3,v 1.1.1.4 2003/10/27 16:14:19 pooka Exp $
 .\"
 .\"
 .\" Copyright (c) Christos Zoulas 2003.
@@ -52,6 +52,8 @@
 .Fn magic_close "magic_t cookie"
 .Ft const char *
 .Fn magic_error "magic_t cookie"
+.Ft int
+.Fn magic_errno "magic_t cookie"
 .Ft const char *
 .Fn magic_file "magic_t cookie, const char *filename"
 .Ft const char *
@@ -101,6 +103,11 @@
 or
 .Xr utimes 2 ,
 attempt to preserve the access time of files analyzed.
+.It Dv MAGIC_RAW
+Don't translate unprintable characters to a \eooo octal representation.
+.It Dv MAGIC_ERROR
+Treat operating system errors while trying to open files and follow symlinks
+as real errors, instead of printing them in the magic buffer.
 .El
 .Pp
 The
@@ -115,6 +122,12 @@
 no error.
 .Pp
 The
+.Fn magic_errno
+function returns the last operating system error number (
+.Xr errno 3 )
+that was encountered by a system call.
+.Pp
+The
 .Fn magic_file
 function returns a textual description of the contents of the
 .Ar filename
@@ -160,8 +173,15 @@
 function must be used to load the the colon
 separated list of database files passed in as
 .Ar filename ,
-or NULL for the default database
+or NULL for the default database file
 before any magic queries can performed.
+.Pp
+The default database file is named by the MAGIC environment variable.  If
+that variable is not set, the default database file name is /usr/share/misc/magic.
+.Pp
+.Fn magic_load
+adds ".mime" and/or ".mgc" to the database filename as appropriate.
+
 .Sh RETURN VALUES
 The function
 .Fn magic_open
@@ -194,13 +214,13 @@
 .Sh FILES
 .Bl -tag -width /usr/share/misc/magic.mime.mgc -compact
 .It Pa /usr/share/misc/magic.mime
-The non-compiled magic mime database.
+The non-compiled default magic mime database.
 .It Pa /usr/share/misc/magic.mime.mgc
-The compiled magic mime database.
+The compiled default magic mime database.
 .It Pa /usr/share/misc/magic
-The non-compiled magic database.
+The non-compiled default magic database.
 .It Pa /usr/share/misc/magic.mgc
-The compiled magic database.
+The compiled default magic database.
 .El
 .Sh SEE ALSO
 .Xr file 1 ,
diff -r e68125c89f06 -r d7ddf8376fc3 dist/file/magic/Makefile.am
--- a/dist/file/magic/Makefile.am       Mon Oct 27 14:11:46 2003 +0000
+++ b/dist/file/magic/Makefile.am       Mon Oct 27 16:14:00 2003 +0000
@@ -38,7 +38,6 @@
 Magdir/asterix \
 Magdir/att3b \
 Magdir/audio \
-Magdir/audio.orig \
 Magdir/bFLT \
 Magdir/blender \
 Magdir/blit \
@@ -105,7 +104,6 @@
 Magdir/lisp \
 Magdir/mach \
 Magdir/macintosh \
-Magdir/macintosh.orig \
 Magdir/magic \
 Magdir/mail.news \
 Magdir/maple \
@@ -146,6 +144,7 @@
 Magdir/printer \
 Magdir/project \
 Magdir/psdbms \
+Magdir/psion \
 Magdir/pulsar \
 Magdir/pyramid \
 Magdir/python \
@@ -188,7 +187,6 @@
 Magdir/vms \
 Magdir/vmware \
 Magdir/vorbis \
-Magdir/vorbis.orig \
 Magdir/vxl \
 Magdir/wordprocessors \
 Magdir/xdelta \
diff -r e68125c89f06 -r d7ddf8376fc3 dist/file/magic/magdir/amigaos
--- a/dist/file/magic/magdir/amigaos    Mon Oct 27 14:11:46 2003 +0000
+++ b/dist/file/magic/magdir/amigaos    Mon Oct 27 16:14:00 2003 +0000
@@ -37,3 +37,21 @@
 26     string          BPSM            Brian Postma's Soundmon Module sound file v3
 26     string          V.2             Brian Postma's Soundmon Module sound file v2
 
+# The following are from: "Stefan A. Haubenthal" <polluks%web.de@localhost>
+0      beshort         0x0f00          AmigaOS bitmap font
+0      beshort         0x0f03          AmigaOS outline font
+0      belong          0x80001001      AmigaOS outline tag
+0      string          ##\ version     catalog translation
+
+0      string          FORM            IFF data
+>8     string          CTLG            \b, CTLG message catalog
+>8     string          PREF            \b, PREF preferences
+
+0      string          Rar!            RAR archive data,
+>44    byte            x               v%0x,
+>35    byte            0               os: MS-DOS
+>35    byte            1               os: OS/2
+>35    byte            2               os: Win32
+>35    byte            3               os: Unix
+
+0      belong          0x000003fa      AmigaOS shared library
diff -r e68125c89f06 -r d7ddf8376fc3 dist/file/magic/magdir/iff
--- a/dist/file/magic/magdir/iff        Mon Oct 27 14:11:46 2003 +0000
+++ b/dist/file/magic/magdir/iff        Mon Oct 27 16:14:00 2003 +0000
@@ -16,6 +16,8 @@
 >8     string          AIFC            \b, AIFF-C compressed audio
 >8     string          8SVX            \b, 8SVX 8-bit sampled sound voice
 >8     string          SAMP            \b, SAMP sampled audio
+>8     string          DTYP            \b, DTYP datatype description
+>8     string          PTCH            \b, PTCH binary patch
 # image formats
 >8     string          ILBMBMHD        \b, ILBM interleaved image
 >>20   beshort         x               \b, %d x
diff -r e68125c89f06 -r d7ddf8376fc3 dist/file/magic/magdir/images
--- a/dist/file/magic/magdir/images     Mon Oct 27 14:11:46 2003 +0000
+++ b/dist/file/magic/magdir/images     Mon Oct 27 16:14:00 2003 +0000
@@ -460,3 +460,22 @@
 # Squeak images and - etoffi%softhome.net@localhost
 0 string \146\031\0\0  Squeak image data
 0 string 'From\040Squeak  Squeak program text
+
+# partimage: file(1) magic for PartImage files (experimental, incomplete)
+# Author: Hans-Joachim Baader <hjb%pro-linux.de@localhost>
+0              string  PaRtImAgE-VoLuMe        PartImage
+>0x0020                string  0.6.1           file version %s
+>>0x0060       lelong  >-1             volume %ld
+#>>0x0064 8 byte identifier
+#>>0x007c reserved
+>>0x0200       string  >\0             type %s
+>>0x1400       string  >\0             device %s,
+>>0x1600       string  >\0             original filename %s,
+# Some fields omitted
+>>0x2744       lelong  0               not compressed
+>>0x2744       lelong  1               gzip compressed
+>>0x2744       lelong  2               bzip2 compressed
+>>0x2744       lelong  >2              compressed with unknown algorithm
+>0x0020                string  >0.6.1          file version %s
+>0x0020                string  <0.6.1          file version %s
+
diff -r e68125c89f06 -r d7ddf8376fc3 dist/file/magic/magdir/psion
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/dist/file/magic/magdir/psion      Mon Oct 27 16:14:00 2003 +0000
@@ -0,0 +1,43 @@
+
+#------------------------------------------------------------------------------
+# psion:  file(1) magic for Psion handhelds data
+# from: Peter Breitenlohner <peb%mppmu.mpg.de@localhost>
+#
+0      lelong          0x10000037      Psion Series 5
+>4     lelong          0x10000039      font file
+>4     lelong          0x1000003A      printer driver
+>4     lelong          0x1000003B      clipboard
+>4     lelong          0x10000042      multi-bitmap image
+>4     lelong          0x1000006A      application infomation file
+>4     lelong          0x1000006D
+>>8    lelong          0x1000007D      sketch image
+>>8    lelong          0x1000007E      voice note
+>>8    lelong          0x1000007F      word file
+>>8    lelong          0x10000085      OPL program
+>>8    lelong          0x10000088      sheet file
+>>8    lelong          0x100001C4      EasyFax initialisation file
+>4     lelong          0x10000073      OPO module
+>4     lelong          0x10000074      OPL application
+>4     lelong          0x1000008A      exported multi-bitmap image
+
+0      lelong          0x10000041      Psion Series 5 ROM multi-bitmap image
+
+0      lelong          0x10000050      Psion Series 5
+>4     lelong          0x1000006D      database
+>4     lelong          0x100000E4      ini file
+
+0      lelong          0x10000079      Psion Series 5 binary:
+>4     lelong          0x00000000      DLL
+>4     lelong          0x10000049      comms hardware library
+>4     lelong          0x1000004A      comms protocol library
+>4     lelong          0x1000005D      OPX
+>4     lelong          0x1000006C      application
+>4     lelong          0x1000008D      DLL
+>4     lelong          0x100000AC      logical device driver
+>4     lelong          0x100000AD      physical device driver
+>4     lelong          0x100000E5      file transfer protocol
+>4     lelong          0x100000E5      file transfer protocol
+>4     lelong          0x10000140      printer defintion
+>4     lelong          0x10000141      printer defintion
+
+0      lelong          0x1000007A      Psion Series 5 executable
diff -r e68125c89f06 -r d7ddf8376fc3 dist/file/magic/magdir/sysex
--- a/dist/file/magic/magdir/sysex      Mon Oct 27 14:11:46 2003 +0000
+++ b/dist/file/magic/magdir/sysex      Mon Oct 27 16:14:00 2003 +0000
@@ -4,13 +4,63 @@
 # 
 0      byte                    0xF0            SysEx File -
 
+# North American Group
+>1     byte                    0x01            Sequential
+>1     byte                    0x02            IDP
+>1     byte                    0x03            OctavePlateau
+>1     byte                    0x04            Moog
+>1     byte                    0x05            Passport
+>1     byte                    0x06            Lexicon
+>1     byte                    0x07            Kurzweil
+>1     byte                    0x08            Fender
+>1     byte                    0x09            Gulbransen
+>1     byte                    0x0a            AKG
+>1     byte                    0x0b            Voyce
+>1     byte                    0x0c            Waveframe
+>1     byte                    0x0d            ADA
+>1     byte                    0x0e            Garfield
+>1     byte                    0x0f            Ensoniq
+>1     byte                    0x10            Oberheim
+>1     byte                    0x11            Apple
+>1     byte                    0x12            GreyMatter
+>1     byte                    0x14            PalmTree
+>1     byte                    0x15            JLCooper
+>1     byte                    0x16            Lowrey
+>1     byte                    0x17            AdamsSmith
+>1     byte                    0x18            E-mu
+>1     byte                    0x19            Harmony
+>1     byte                    0x1a            ART
+>1     byte                    0x1b            Baldwin
+>1     byte                    0x1c            Eventide
+>1     byte                    0x1d            Inventronics
+>1     byte                    0x1f            Clarity
+
+# European Group
+>1     byte                    0x21            SIEL
+>1     byte                    0x22            Synthaxe
+>1     byte                    0x24            Hohner
+>1     byte                    0x25            Twister
+>1     byte                    0x26            Solton
+>1     byte                    0x27            Jellinghaus
+>1     byte                    0x28            Southworth
+>1     byte                    0x29            PPG
+>1     byte                    0x2a            JEN
+>1     byte                    0x2b            SSL
+>1     byte                    0x2c            AudioVertrieb
+
 >1     byte                    0x2f            ELKA
 >>3    byte                    0x09            EK-44



Home | Main Index | Thread Index | Old Index