Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/file/dist from ftp.astron.com, this is a bug fi...



details:   https://anonhg.NetBSD.org/src/rev/da587d01da80
branches:  trunk
changeset: 325046:da587d01da80
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Dec 01 19:28:08 2013 +0000

description:
from ftp.astron.com, this is a bug fix release:
       * always leave magic file loaded, don't unload for magic_check, etc.
       * fix default encoding to binary instead of unknown which broke recently
       * handle empty and one byte files, less specially so that
         --mime-encoding does not break completely.
       * fix erroneous non-zero exit code from non-existant file and message
       * add CDF MSI file detection (Guy Helmer)

diffstat:

 external/bsd/file/dist/ChangeLog                   |   52 ++++
 external/bsd/file/dist/README                      |    9 +-
 external/bsd/file/dist/TODO                        |   11 +-
 external/bsd/file/dist/magic/Localstuff            |    2 +-
 external/bsd/file/dist/magic/magdir/android        |  100 ++++++++
 external/bsd/file/dist/magic/magdir/animation      |    4 +-
 external/bsd/file/dist/magic/magdir/audio          |   55 ++++-
 external/bsd/file/dist/magic/magdir/c-lang         |   20 +-
 external/bsd/file/dist/magic/magdir/cad            |   67 ++++-
 external/bsd/file/dist/magic/magdir/commands       |    4 +-
 external/bsd/file/dist/magic/magdir/compress       |   15 +-
 external/bsd/file/dist/magic/magdir/ctf            |   23 +
 external/bsd/file/dist/magic/magdir/database       |   11 +-
 external/bsd/file/dist/magic/magdir/fsav           |    5 +-
 external/bsd/file/dist/magic/magdir/ibm6000        |   17 +-
 external/bsd/file/dist/magic/magdir/images         |   58 ++++-
 external/bsd/file/dist/magic/magdir/java           |   21 +-
 external/bsd/file/dist/magic/magdir/linux          |   54 ++++-
 external/bsd/file/dist/magic/magdir/macintosh      |    5 +-
 external/bsd/file/dist/magic/magdir/msooxml        |   38 +-
 external/bsd/file/dist/magic/magdir/msx            |  255 +++++++++++++++++++++
 external/bsd/file/dist/magic/magdir/pdf            |    3 +-
 external/bsd/file/dist/magic/magdir/pdp            |   10 +-
 external/bsd/file/dist/magic/magdir/riff           |    5 +-
 external/bsd/file/dist/magic/magdir/sql            |   30 +-
 external/bsd/file/dist/magic/magdir/ssh            |    3 +
 external/bsd/file/dist/magic/magdir/ssl            |    1 +
 external/bsd/file/dist/magic/magdir/symbos         |   42 +++
 external/bsd/file/dist/magic/magdir/sysex          |   10 +-
 external/bsd/file/dist/magic/magdir/tex            |    5 +-
 external/bsd/file/dist/magic/magdir/windows        |  179 ++++++++++++++-
 external/bsd/file/dist/magic/magdir/wordprocessors |    7 +-
 external/bsd/file/dist/magic/magdir/xilinx         |   52 ++--
 external/bsd/file/dist/src/ascmagic.c              |    9 +-
 external/bsd/file/dist/src/encoding.c              |   18 +-
 external/bsd/file/dist/src/file.c                  |   13 +-
 external/bsd/file/dist/src/file_opts.h             |    4 +-
 external/bsd/file/dist/src/magic.h.in              |    1 +
 external/bsd/file/dist/src/pread.c                 |    8 +-
 external/bsd/file/dist/src/readelf.h               |   42 +++-
 40 files changed, 1101 insertions(+), 167 deletions(-)

diffs (truncated from 1939 to 300 lines):

diff -r 2432d8ff471a -r da587d01da80 external/bsd/file/dist/ChangeLog
--- a/external/bsd/file/dist/ChangeLog  Sun Dec 01 17:29:40 2013 +0000
+++ b/external/bsd/file/dist/ChangeLog  Sun Dec 01 19:28:08 2013 +0000
@@ -1,3 +1,55 @@
+2013-11-19  20:10  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * always leave magic file loaded, don't unload for magic_check, etc.
+       * fix default encoding to binary instead of unknown which broke recently
+       * handle empty and one byte files, less specially so that
+         --mime-encoding does not break completely.
+               `
+2013-11-06  14:40  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * fix erroneous non-zero exit code from non-existant file and message
+
+2013-10-29  14:25  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * add CDF MSI file detection (Guy Helmer)
+
+2013-09-03  11:56  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * Don't mix errors and regular output if there was an error
+       * in magic_descriptor() don't close the file and try to restore
+         its position
+
+2013-05-30  17:25  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * Don't treat magic as an error if offset was past EOF (Christoph Biedl)
+
+2013-05-28  17:25  Christos Zoulas <christos%zoulas.com@localhost>
+       
+       * Fix spacing issues in softmagic and elf (Jan Kaluza)
+
+2013-05-02  18:00  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * Fix segmentation fault with multiple magic_load commands.
+
+2013-04-22  11:20  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * The way "default" was implemented was not very useful
+         because the "if something was printed at that level"
+         was not easily controlled by the user, and the format
+         was bound to a string which is too restrictive. Add
+         a "clear" for that level keyword and make "default"
+         void. This way one can do:
+
+               >>13    clear   x
+               >>13    lelong  1       foo
+               >>13    lelong  2       bar
+               >>13    default x
+               >>>13   lelong  x       unknown %x
+
+2013-03-25  13:20  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * disallow strength setting in "name" entries
+
 2013-03-06  21:24  Christos Zoulas <christos%zoulas.com@localhost>
 
        * fix recursive magic separator printing
diff -r 2432d8ff471a -r da587d01da80 external/bsd/file/dist/README
--- a/external/bsd/file/dist/README     Sun Dec 01 17:29:40 2013 +0000
+++ b/external/bsd/file/dist/README     Sun Dec 01 19:28:08 2013 +0000
@@ -1,7 +1,8 @@
 ** README for file(1) Command **
-@(#) $File: README,v 1.45 2013/01/11 16:51:01 christos Exp $
+@(#) $File: README,v 1.47 2013/06/04 23:15:02 ian Exp $
 
 Mailing List: file%mx.gw.com@localhost
+Mailing List archives: http://mx.gw.com/pipermail/file/
 Bug tracker: http://bugs.gw.com/
 E-mail: christos%astron.com@localhost
 
@@ -13,11 +14,11 @@
 This version is the standard "file" command for Linux,
 *BSD, and other systems. (See "patchlevel.h" for the exact release number).
 
-You can download the latest version of file from:
+You can download the latest version of the original sources for file from:
 
        ftp://ftp.astron.com/pub/file/
 
-A public read-only git repository is available at:
+A public read-only git repository of the same sources is available at:
 
        https://github.com/glensc/file
 
@@ -28,7 +29,7 @@
 and the re-write of the file command in terms of that library. The library
 itself, libmagic can be used by 3rd party programs that wish to identify
 file types without having to fork() and exec() file. The prime contributor
-for 4.0 was M\xe5ns Rullg\xe5rd.
+for 4.0 was Mans Rullgard.
 
 UNIX is a trademark of UNIX System Laboratories.
 
diff -r 2432d8ff471a -r da587d01da80 external/bsd/file/dist/TODO
--- a/external/bsd/file/dist/TODO       Sun Dec 01 17:29:40 2013 +0000
+++ b/external/bsd/file/dist/TODO       Sun Dec 01 19:28:08 2013 +0000
@@ -9,8 +9,9 @@
 
 It would be nice to simplify file considerably. For example,
 reimplement the apprentice and non-pattern magic methods in Python,
-and compile the magic patterns to a giant regex (or something similar)
-so that only a small amount of C is needed (because fast execution is
-typically only required for soft magic, not the more detailed
-information given by hard-wired routines). In this regard, note that
-hplip, which is BSD-licensed, has a magic reimplementation in Python.
+and compile the magic patterns to a giant regex (or something similar;
+maybe using Ragel (http://www.complang.org/ragel/)) so that only a
+small amount of C is needed (because fast execution is typically only
+required for soft magic, not the more detailed information given by
+hard-wired routines). In this regard, note that hplip, which is
+BSD-licensed, has a magic reimplementation in Python.
diff -r 2432d8ff471a -r da587d01da80 external/bsd/file/dist/magic/Localstuff
--- a/external/bsd/file/dist/magic/Localstuff   Sun Dec 01 17:29:40 2013 +0000
+++ b/external/bsd/file/dist/magic/Localstuff   Sun Dec 01 19:28:08 2013 +0000
@@ -2,6 +2,6 @@
 #------------------------------------------------------------------------------
 # Localstuff:  file(1) magic for locally observed files
 #
-# $File: Localstuff,v 1.5 2007/01/12 17:38:27 christos Exp $
+# $File: Localstuff,v 1.4 2003/03/23 04:17:27 christos Exp $
 # Add any locally observed files here.  Remember:
 # text if readable, executable if runnable binary, data if unreadable.
diff -r 2432d8ff471a -r da587d01da80 external/bsd/file/dist/magic/magdir/android
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/file/dist/magic/magdir/android       Sun Dec 01 19:28:08 2013 +0000
@@ -0,0 +1,100 @@
+
+#------------------------------------------------------------
+# $File: android,v 1.3 2013/11/08 01:24:22 christos Exp $
+# Various android related magic entries
+#------------------------------------------------------------
+
+# Dalvik .dex format. http://retrodev.com/android/dexformat.html
+# From <mkf%google.com@localhost> "Mike Fleming"
+# Fixed to avoid regexec 17 errors on some dex files
+# From <diff%lookout.com@localhost> "Tim Strazzere"
+0      string  dex\n
+>0     regex   dex\n[0-9]{2}\0 Dalvik dex file
+>4     string  >000                    version %s
+0      string  dey\n
+>0     regex   dey\n[0-9]{2}\0 Dalvik dex file (optimized for host)
+>4     string  >000                    version %s
+
+# http://android.stackexchange.com/questions/23357/\
+# is-there-a-way-to-look-inside-and-modify-an-adb-backup-created-file/\
+# 23608#23608
+0      string  ANDROID\040BACKUP\n     Android Backup
+>15    string  1\n                     \b, version 1
+>17    string  0\n                     \b, uncompressed
+>17    string  1\n                     \b, compressed
+>19    string  none\n                  \b, unencrypted
+>19    string  AES-256\n               \b, encrypted AES-256
+
+# Android bootimg format
+# From https://android.googlesource.com/\
+# platform/system/core/+/master/mkbootimg/bootimg.h
+0              string  ANDROID!        Android bootimg
+>8             lelong  >0                      \b, kernel
+>>12   lelong  >0                      \b (0x%x)
+>16            lelong  >0                      \b, ramdisk
+>>20   lelong  >0                      \b (0x%x)
+>24            lelong  >0                      \b, second stage
+>>28   lelong  >0                      \b (0x%x)
+>36            lelong  >0                      \b, page size: %d
+>38            string  >0                      \b, name: %s
+>64            string  >0                      \b, cmdline (%s)
+# Dalvik .dex format. http://retrodev.com/android/dexformat.html
+# From <mkf%google.com@localhost> "Mike Fleming"
+# Fixed to avoid regexec 17 errors on some dex files
+# From <diff%lookout.com@localhost> "Tim Strazzere"
+0      string  dex\n
+>0     regex   dex\n[0-9]{2}\0 Dalvik dex file
+>4     string  >000                    version %s
+0      string  dey\n
+>0     regex   dey\n[0-9]{2}\0 Dalvik dex file (optimized for host)
+>4     string  >000                    version %s
+
+# http://android.stackexchange.com/questions/23357/\
+# is-there-a-way-to-look-inside-and-modify-an-adb-backup-created-file/\
+# 23608#23608
+0      string  ANDROID\040BACKUP\n     Android Backup
+>15    string  1\n                     \b, version 1
+>17    string  0\n                     \b, uncompressed
+>17    string  1\n                     \b, compressed
+>19    string  none\n                  \b, unencrypted
+>19    string  AES-256\n               \b, encrypted AES-256
+
+# Android bootimg format
+# From https://android.googlesource.com/\
+# platform/system/core/+/master/mkbootimg/bootimg.h
+0              string  ANDROID!        Android bootimg
+>8             lelong  >0                      \b, kernel
+>>12   lelong  >0                      \b (0x%x)
+>16            lelong  >0                      \b, ramdisk
+>>20   lelong  >0                      \b (0x%x)
+>24            lelong  >0                      \b, second stage
+>>28   lelong  >0                      \b (0x%x)
+>36            lelong  >0                      \b, page size: %d
+>38            string  >0                      \b, name: %s
+>64            string  >0                      \b, cmdline (%s)
+
+# Android Backup archive
+# From: Ariel Shkedi
+# File extension: .ab
+# No mime-type defined
+# URL: https://github.com/android/platform_frameworks_base/blob/\
+# 0bacfd2ba68d21a68a3df345b830bc2a1e515b5a/services/java/com/\
+# android/server/BackupManagerService.java#L2367
+# After the header comes a tar file
+# If compressed, the entire tar file is compressed with JAVA deflate
+#
+# Include the version number hardcoded with the magic string to avoid
+# false positives
+0      string/b        ANDROID\ BACKUP\n1\n    Android Backup
+>17    string          0\n                     \b, Not-Compressed
+>17    string          1\n                     \b, Compressed
+# any string as long as it's not the word none (which is matched below)
+>>19    regex/1                \^([^n\n]|n[^o]|no[^n]|non[^e]|none.+).*        \b, Encrypted (%s)
+>>19   string          none\n                  \b, Not-Encrypted
+# Commented out because they don't seem useful to print
+# (but they are part of the header - the tar file comes after them):
+#>>>&1         regex/1 .*      \b, Password salt: %s
+#>>>>&1                regex/1 .*      \b, Master salt: %s
+#>>>>>&1       regex/1 .*      \b, PBKDF2 rounds: %s
+#>>>>>>&1      regex/1 .*      \b, IV: %s
+#>>>>>>>&1     regex/1 .*      \b, Key: %s
diff -r 2432d8ff471a -r da587d01da80 external/bsd/file/dist/magic/magdir/animation
--- a/external/bsd/file/dist/magic/magdir/animation     Sun Dec 01 17:29:40 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/animation     Sun Dec 01 19:28:08 2013 +0000
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: animation,v 1.48 2013/03/09 22:36:00 christos Exp $
+# $File: animation,v 1.49 2013/08/15 13:15:11 christos Exp $
 # animation:  file(1) magic for animation/movie formats
 #
 # animation formats
@@ -802,7 +802,7 @@
 !:mime video/mp4v-es
 0       belong             0x000001B3
 !:mime video/mpv
-0       belong&0xFF5FFF1F  0x47400010
+0       belong&0xFF5FFF10  0x47400010
 !:mime video/mp2t
 0       belong             0x00000001
 >4      byte&0x1F         0x07
diff -r 2432d8ff471a -r da587d01da80 external/bsd/file/dist/magic/magdir/audio
--- a/external/bsd/file/dist/magic/magdir/audio Sun Dec 01 17:29:40 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/audio Sun Dec 01 19:28:08 2013 +0000
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: audio,v 1.66 2013/02/06 14:18:52 christos Exp $
+# $File: audio,v 1.67 2013/08/14 09:01:45 christos Exp $
 # audio:  file(1) magic for sound formats (see also "iff")
 #
 # Jan Nicolai Langfeldt (janl%ifi.uio.no@localhost), Dan Quinlan (quinlan%yggdrasil.com@localhost),
@@ -637,3 +637,56 @@
 # URL:  http://wiki.multimedia.cx/index.php?title=WavPack
 # From: Mike Melanson <mike%multimedia.cx@localhost>
 0      string  wvpk    WavPack Lossless Audio
+
+# From Fábio R. Schmidlin <frs%pop.com.br@localhost>
+# VGM music file
+0      string          Vgm\ 
+>9     ubyte           >0      VGM Video Game Music dump v
+>>9    ubyte/16        >0      \b%d
+>>9    ubyte&0x0F      x       \b%d
+>>8    ubyte/16        x       \b.%d
+>>8    ubyte&0x0F      >0      \b%d
+#Get soundchips
+>>8    ubyte           x       \b, soundchip(s)=
+>>0x0C ulelong         >0      SN76489,
+>>0x10 ulelong         >0      YM2413,
+>>0x2C ulelong         >0      YM2612,
+>>0x30 ulelong         >0      YM2151,
+>>0x38 ulelong         >0      Sega PCM,
+>>0x34 ulelong         >0xC
+>>>0x40        ulelong         >0      RF5C68,
+>>0x34 ulelong         >0x10
+>>>0x44        ulelong         >0      YM2203,
+>>0x34 ulelong         >0x14
+>>>0x48        ulelong         >0      YM2608,
+>>0x34 ulelong         >0x18
+>>>0x4C        lelong          >0      YM2610,
+>>>0x4C        lelong          <0      YM2610B,
+>>0x34 ulelong         >0x1C
+>>>0x50        ulelong         >0      YM3812,
+>>0x34 ulelong         >0x20
+>>>0x54        ulelong         >0      YM3526,
+>>0x34 ulelong         >0x24
+>>>0x58        ulelong         >0      Y8950,
+>>0x34 ulelong         >0x28
+>>>0x5C        ulelong         >0      YMF262,
+>>0x34 ulelong         >0x2C
+>>>0x60        ulelong         >0      YMF278B,
+>>0x34 ulelong         >0x30
+>>>0x64        ulelong         >0      YMF271,



Home | Main Index | Thread Index | Old Index