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 import file-5.14



details:   https://anonhg.NetBSD.org/src/rev/b136d2847748
branches:  trunk
changeset: 785617:b136d2847748
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Mar 23 15:49:08 2013 +0000

description:
import file-5.14
changes are "name" + "use" keyword features, bug fixes

diffstat:

 external/bsd/file/dist/ChangeLog                   |   44 ++
 external/bsd/file/dist/README                      |   19 +-
 external/bsd/file/dist/magic/Localstuff            |    2 +-
 external/bsd/file/dist/magic/magdir/animation      |    7 +-
 external/bsd/file/dist/magic/magdir/aout           |   46 ++
 external/bsd/file/dist/magic/magdir/audio          |    4 +-
 external/bsd/file/dist/magic/magdir/bsdi           |   16 +-
 external/bsd/file/dist/magic/magdir/cafebabe       |   59 +--
 external/bsd/file/dist/magic/magdir/commands       |    4 +-
 external/bsd/file/dist/magic/magdir/console        |    6 +-
 external/bsd/file/dist/magic/magdir/database       |  330 +++++++++++++++-----
 external/bsd/file/dist/magic/magdir/digital        |   30 +-
 external/bsd/file/dist/magic/magdir/fonts          |   13 +-
 external/bsd/file/dist/magic/magdir/gnome          |   59 +++
 external/bsd/file/dist/magic/magdir/gpt            |  241 +++++++++++++++
 external/bsd/file/dist/magic/magdir/hitachi-sh     |    5 +-
 external/bsd/file/dist/magic/magdir/ibm6000        |    3 +-
 external/bsd/file/dist/magic/magdir/icc            |   51 +++
 external/bsd/file/dist/magic/magdir/images         |   55 ++-
 external/bsd/file/dist/magic/magdir/intel          |    4 +-
 external/bsd/file/dist/magic/magdir/java           |   12 +-
 external/bsd/file/dist/magic/magdir/jpeg           |    4 +-
 external/bsd/file/dist/magic/magdir/linux          |    9 +-
 external/bsd/file/dist/magic/magdir/llvm           |   14 +-
 external/bsd/file/dist/magic/magdir/lua            |    3 +-
 external/bsd/file/dist/magic/magdir/mach           |  299 ++++++++++++------
 external/bsd/file/dist/magic/magdir/mail.news      |    6 +-
 external/bsd/file/dist/magic/magdir/maple          |    4 +-
 external/bsd/file/dist/magic/magdir/matroska       |    4 +-
 external/bsd/file/dist/magic/magdir/mips           |   68 +----
 external/bsd/file/dist/magic/magdir/misctools      |   12 +-
 external/bsd/file/dist/magic/magdir/msdos          |   16 +-
 external/bsd/file/dist/magic/magdir/msooxml        |   10 +-
 external/bsd/file/dist/magic/magdir/natinst        |    4 +-
 external/bsd/file/dist/magic/magdir/netbsd         |   10 +-
 external/bsd/file/dist/magic/magdir/python         |    3 +-
 external/bsd/file/dist/magic/magdir/revision       |    4 +-
 external/bsd/file/dist/magic/magdir/riff           |    6 +-
 external/bsd/file/dist/magic/magdir/rpm            |   27 +-
 external/bsd/file/dist/magic/magdir/sgi            |   71 ++++-
 external/bsd/file/dist/magic/magdir/sniffer        |  164 +++------
 external/bsd/file/dist/magic/magdir/sql            |   11 +-
 external/bsd/file/dist/magic/magdir/sun            |   93 +++--
 external/bsd/file/dist/magic/magdir/unknown        |   47 +-
 external/bsd/file/dist/magic/magdir/vax            |   18 +-
 external/bsd/file/dist/magic/magdir/vms            |    8 +-
 external/bsd/file/dist/magic/magdir/wordprocessors |    4 +-
 external/bsd/file/dist/magic/magdir/wsdl           |    4 +-
 external/bsd/file/dist/magic/magdir/xilinx         |    5 +-
 external/bsd/file/dist/magic/magdir/xwindows       |    4 +-
 external/bsd/file/dist/src/Makefile.am             |    7 +
 external/bsd/file/dist/src/elfclass.h              |    5 +-
 external/bsd/file/dist/src/file.c                  |   11 +-
 external/bsd/file/dist/src/getline.c               |    4 +-
 external/bsd/file/dist/src/magic.h                 |    5 +-
 external/bsd/file/dist/src/magic.h.in              |  107 ++++++
 external/bsd/file/dist/src/pread.c                 |   20 +
 external/bsd/file/dist/src/readelf.h               |   10 +-
 58 files changed, 1440 insertions(+), 671 deletions(-)

diffs (truncated from 3131 to 300 lines):

diff -r 271184ec0ca6 -r b136d2847748 external/bsd/file/dist/ChangeLog
--- a/external/bsd/file/dist/ChangeLog  Sat Mar 23 15:45:27 2013 +0000
+++ b/external/bsd/file/dist/ChangeLog  Sat Mar 23 15:49:08 2013 +0000
@@ -1,3 +1,47 @@
+2013-03-06  21:24  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * fix recursive magic separator printing
+
+2013-02-26  19:28  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * limit recursion level for mget
+       * fix pread() related breakage in cdf
+       * handle offsets properly in recursive "use"
+
+2013-02-18  10:39  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * add elf reading of debug info to determine if file is stripped
+         (Jan Kaluza)
+       * use pread()
+
+2013-01-25  18:05  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * change mime description size from 64 to 80 to accommodate OOXML.
+
+2013-01-11  14:50  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * Warn about inconsistent continuation levels.
+       * Change fsmagic to add a space after it prints.
+
+2013-01-10  21:00  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * Make getline public so that file can link against it.
+         Perhaps it is better to rename it, or hide it differently.
+         Fixes builds on platforms that do not provide it.
+         
+2013-01-07  16:30  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * Add SuS d{,1,2,4,8}, u{,1,2,4,8} and document
+         what long, int, short, etc is (Guy Harris)
+
+2013-01-06  11:20  Christos Zoulas <christos%zoulas.com@localhost>
+
+       * add magic_version function and constant
+       * Redo memory allocation and de-allocation.
+         (prevents double frees on non mmap platforms)
+       * Fix bug with name/use having to do with passing
+         found state from the parent to the child and back.
+
 2012-12-19   8:47  Christos Zoulas <christos%zoulas.com@localhost>
 
        * Only print elf capabilities for archs we know (Jan Kaluza)
diff -r 271184ec0ca6 -r b136d2847748 external/bsd/file/dist/README
--- a/external/bsd/file/dist/README     Sat Mar 23 15:45:27 2013 +0000
+++ b/external/bsd/file/dist/README     Sat Mar 23 15:49:08 2013 +0000
@@ -1,5 +1,5 @@
 ** README for file(1) Command **
-@(#) $File: README,v 1.44 2011/03/24 13:03:39 rrt Exp $
+@(#) $File: README,v 1.45 2013/01/11 16:51:01 christos Exp $
 
 Mailing List: file%mx.gw.com@localhost
 Bug tracker: http://bugs.gw.com/
@@ -68,15 +68,19 @@
 src/apptype.c - used for OS/2 specific application type magic
 src/asprintf.c - replacement for OS's that don't have it.
 src/ascmagic.c - third & last set of tests, based on hardwired assumptions.
+src/asctime_r.c - for systems that don't have it.
+src/asprintf.c - for systems that don't have it.
 src/cdf.c - parser for Microsoft Compound Document Files
 src/cdf_time.c - time converter for CDF.
 src/compress.c - handles decompressing files to look inside.
+src/ctime_r.c - for systems that don't have it.
 src/encoding.c - handles unicode encodings
 src/file.c - the main program
 src/file.h - header file
 src/fsmagic.c - first set of tests the program runs, based on filesystem info
 src/funcs.c - utilility functions
-src/getopt_long.c - used for OS/2 specific application type magic
+src/getopt_long.c - for systems that don't have it.
+src/getline.c - for systems that don't have it.
 src/is_tar.c, tar.h - knows about tarchives (courtesy John Gilmore).
 src/names.h - header file for ascmagic.c
 src/magic.c - the libmagic api
@@ -84,14 +88,13 @@
 src/readcdf.c - CDF wrapper.
 src/readelf.[ch] - Stand-alone elf parsing code.
 src/softmagic.c - 2nd set of tests, based on /etc/magic
-src/strlcat.c - used for OS/2 specific application type magic
-src/strlcpy.c - used for OS/2 specific application type magic
-src/vasprintf.c - used for OS/2 specific application type magic
-doc/file.1 - man page for the command
-doc/magic.4 - man page for the magic file, courtesy Guy Harris.
+src/strlcat.c - for systems that don't have it.
+src/strlcpy.c - for systems that don't have it.
+src/vasprintf.c - for systems that don't have it.
+doc/file.man - man page for the command
+doc/magic.man - man page for the magic file, courtesy Guy Harris.
        Install as magic.4 on USG and magic.5 on V7 or Berkeley; cf Makefile.
 Magdir - directory of /etc/magic pieces
-
 ------------------------------------------------------------------------------
 
 If you submit a new magic entry please make sure you read the following
diff -r 271184ec0ca6 -r b136d2847748 external/bsd/file/dist/magic/Localstuff
--- a/external/bsd/file/dist/magic/Localstuff   Sat Mar 23 15:45:27 2013 +0000
+++ b/external/bsd/file/dist/magic/Localstuff   Sat Mar 23 15:49:08 2013 +0000
@@ -2,6 +2,6 @@
 #------------------------------------------------------------------------------
 # Localstuff:  file(1) magic for locally observed files
 #
-# $File: Localstuff,v 1.4 2003/03/23 04:17:27 christos Exp $
+# $File: Localstuff,v 1.5 2007/01/12 17:38:27 christos Exp $
 # Add any locally observed files here.  Remember:
 # text if readable, executable if runnable binary, data if unreadable.
diff -r 271184ec0ca6 -r b136d2847748 external/bsd/file/dist/magic/magdir/animation
--- a/external/bsd/file/dist/magic/magdir/animation     Sat Mar 23 15:45:27 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/animation     Sat Mar 23 15:49:08 2013 +0000
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: animation,v 1.46 2012/08/26 10:43:05 christos Exp $
+# $File: animation,v 1.48 2013/03/09 22:36:00 christos Exp $
 # animation:  file(1) magic for animation/movie formats
 #
 # animation formats
@@ -89,7 +89,10 @@
 >>4      byte               77             \b, main
 >>4      byte               88             \b, extended
 >>6      byte               x              \b @ L %u
+# GRR too general as it catches also FoxPro Memo example NG.FPT
 >3       byte               0xB0           MPEG sequence, v4
+# TODO: maybe this extra line exclude FoxPro Memo example NG.FPT starting with 000001b0 00000100 00000000
+#>>4      byte               !0             MPEG sequence, v4
 !:mime  video/mpeg4-generic
 >>5      belong             0x000001B5
 >>>9     byte               &0x80
@@ -751,7 +754,7 @@
 >0     byte            x               GameCube movie,
 >0x34  ubeshort        x               %d x
 >0x36  ubeshort        x               %d,
->0x26  ubeshort        x               %dµs,
+>0x26  ubeshort        x               %dus,
 >0x42  ubeshort        0               no audio
 >0x42  ubeshort        >0              %dHz audio
 
diff -r 271184ec0ca6 -r b136d2847748 external/bsd/file/dist/magic/magdir/aout
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/file/dist/magic/magdir/aout  Sat Mar 23 15:49:08 2013 +0000
@@ -0,0 +1,46 @@
+
+#------------------------------------------------------------------------------
+# $File: aout,v 1.1 2013/01/09 22:37:23 christos Exp $
+# aout:  file(1) magic for a.out executable/object/etc entries that
+# handle executables on multiple platforms.
+#
+
+#
+# Little-endian 32-bit-int a.out, merged from bsdi (for BSD/OS, from
+# BSDI), netbsd, and vax (for UNIX/32V and BSD)
+#
+# XXX - is there anything we can look at to distinguish BSD/OS 386 from
+# NetBSD 386 from various VAX binaries?  The BSD/OS shared library flag
+# works only for binaries using shared libraries.  Grabbing the entry
+# point from the a.out header, using it to find the first code executed
+# in the program, and looking at that might help.
+#
+0      lelong          0407            a.out little-endian 32-bit executable
+>16    lelong          >0              not stripped
+>32    byte            0x6a            (uses BSD/OS shared libs)
+
+0      lelong          0410            a.out little-endian 32-bit pure executable
+>16    lelong          >0              not stripped
+>32    byte            0x6a            (uses BSD/OS shared libs)
+
+0      lelong          0413            a.out little-endian 32-bit demand paged pure executable
+>16    lelong          >0              not stripped
+>32    byte            0x6a            (uses BSD/OS shared libs)
+
+#
+# Big-endian 32-bit-int a.out, merged from sun (for old 68010 SunOS a.out),
+# mips (for old 68020(!) SGI a.out), and netbsd (for old big-endian a.out).
+#
+# XXX - is there anything we can look at to distinguish old SunOS 68010
+# from old 68020 IRIX from old NetBSD?  Again, I guess we could look at
+# the first instruction or instructions in the program.
+#
+0      belong          0407            a.out big-endian 32-bit executable
+>16    belong          >0              not stripped
+
+0      belong          0410            a.out big-endian 32-bit pure executable
+>16    belong          >0              not stripped
+
+0      belong          0413            a.out big-endian 32-bit demand paged executable
+>16    belong          >0              not stripped
+
diff -r 271184ec0ca6 -r b136d2847748 external/bsd/file/dist/magic/magdir/audio
--- a/external/bsd/file/dist/magic/magdir/audio Sat Mar 23 15:45:27 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/audio Sat Mar 23 15:49:08 2013 +0000
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: audio,v 1.65 2012/10/31 13:38:40 christos Exp $
+# $File: audio,v 1.66 2013/02/06 14:18:52 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),
@@ -512,7 +512,7 @@
 >>12           ulelong         x               \b, sample rate %d
 
 # adlib sound files
-# From Gürkan Sengün <gurkan%linuks.mine.nu@localhost>, http://www.linuks.mine.nu
+# From Gurkan Sengun <gurkan%linuks.mine.nu@localhost>, http://www.linuks.mine.nu
 0      string          RAWADATA        RdosPlay RAW
 
 1068   string          RoR             AMUSIC Adlib Tracker
diff -r 271184ec0ca6 -r b136d2847748 external/bsd/file/dist/magic/magdir/bsdi
--- a/external/bsd/file/dist/magic/magdir/bsdi  Sat Mar 23 15:45:27 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/bsdi  Sat Mar 23 15:49:08 2013 +0000
@@ -1,25 +1,15 @@
 
 #------------------------------------------------------------------------------
-# $File: bsdi,v 1.5 2009/09/19 16:28:08 christos Exp $
+# $File: bsdi,v 1.6 2013/01/09 22:37:24 christos Exp $
 # bsdi:  file(1) magic for BSD/OS (from BSDI) objects
+# Some object/executable formats use the same magic numbers as are used
+# in other OSes; those are handled by entries in aout.
 #
 
 0      lelong          0314            386 compact demand paged pure executable
 >16    lelong          >0              not stripped
 >32    byte            0x6a            (uses shared libs)
 
-0      lelong          0407            386 executable
->16    lelong          >0              not stripped
->32    byte            0x6a            (uses shared libs)
-
-0      lelong          0410            386 pure executable
->16    lelong          >0              not stripped
->32    byte            0x6a            (uses shared libs)
-
-0      lelong          0413            386 demand paged pure executable
->16    lelong          >0              not stripped
->32    byte            0x6a            (uses shared libs)
-
 # same as in SunOS 4.x, except for static shared libraries
 0      belong&077777777        0600413         sparc demand paged
 >0     byte            &0x80
diff -r 271184ec0ca6 -r b136d2847748 external/bsd/file/dist/magic/magdir/cafebabe
--- a/external/bsd/file/dist/magic/magdir/cafebabe      Sat Mar 23 15:45:27 2013 +0000
+++ b/external/bsd/file/dist/magic/magdir/cafebabe      Sat Mar 23 15:49:08 2013 +0000
@@ -1,13 +1,13 @@
 
 #------------------------------------------------------------------------------
-# $File: cafebabe,v 1.10 2012/10/31 16:32:01 christos Exp $
+# $File: cafebabe,v 1.14 2013/02/27 16:59:59 christos Exp $
 # Cafe Babes unite!
 #
-# Since Java bytecode and Mach-O fat-files have the same magic number, the test
-# must be performed in the same "magic" sequence to get both right.  The long
-# at offset 4 in a mach-O fat file tells the number of architectures; the short at
-# offset 4 in a Java bytecode file is the JVM minor version and the
-# short at offset 6 is the JVM major version.  Since there are only 
+# Since Java bytecode and Mach-O universal binaries have the same magic number,
+# the test must be performed in the same "magic" sequence to get both right.
+# The long at offset 4 in a Mach-O universal binary tells the number of
+# architectures; the short at offset 4 in a Java bytecode file is the JVM minor
+# version and the short at offset 6 is the JVM major version.  Since there are only 
 # only 18 labeled Mach-O architectures at current, and the first released 
 # Java class format was version 43.0, we can safely choose any number
 # between 18 and 39 to test the number of architectures against
@@ -30,49 +30,34 @@
 >>4    belong          0x0032          (Java 1.6)
 
 0      belong          0xcafed00d      JAR compressed with pack200,
->>5    byte            x               version %d.
->>4    byte            x               \b%d
+>5     byte            x               version %d.
+>4     byte            x               \b%d
 !:mime application/x-java-pack200
 
 
 0      belong          0xcafed00d      JAR compressed with pack200,
->>5    byte            x               version %d.
->>4    byte            x               \b%d
+>5     byte            x               version %d.
+>4     byte            x               \b%d
 !:mime application/x-java-pack200
 
 ### JAVA END ###
 ### MACH-O START ###
 
-# 16777216 = 0x01000000
-0      name            mach-o          \b [ 
->0     belong          0xffffffff      \bAny
->0     belong          1               \bVax
->0     belong          6               \bMC680x0
->0     belong          7               \bI386
->0     belong          8               \bMIPS
->0     belong          10              \bMC98000
->0     belong          11              \bHPPA
->0     belong          12              \bARM



Home | Main Index | Thread Index | Old Index