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.22
details: https://anonhg.NetBSD.org/src/rev/9cbdb27d7698
branches: trunk
changeset: 805450:9cbdb27d7698
user: christos <christos%NetBSD.org@localhost>
date: Fri Jan 02 20:34:26 2015 +0000
description:
Import file-5.22
diffstat:
external/bsd/file/dist/README | 32 +++-
external/bsd/file/dist/TODO | 2 +
external/bsd/file/dist/magic/magdir/android | 47 +------
external/bsd/file/dist/magic/magdir/animation | 8 +-
external/bsd/file/dist/magic/magdir/cafebabe | 4 +-
external/bsd/file/dist/magic/magdir/database | 173 ++++++++++++++++---------
external/bsd/file/dist/magic/magdir/images | 152 ++++++++++++++++------
external/bsd/file/dist/magic/magdir/jpeg | 106 +-------------
external/bsd/file/dist/magic/magdir/kerberos | 45 ++++++
external/bsd/file/dist/magic/magdir/linux | 18 ++-
external/bsd/file/dist/magic/magdir/qt | 19 ++
external/bsd/file/dist/magic/magdir/sereal | 15 +-
external/bsd/file/dist/magic/magdir/ssh | 2 +
external/bsd/file/dist/src/apptype.c | 5 +-
external/bsd/file/dist/src/ascmagic.c | 10 +-
external/bsd/file/dist/src/asctime_r.c | 5 +-
external/bsd/file/dist/src/asprintf.c | 5 +-
external/bsd/file/dist/src/cdf.h | 3 +-
external/bsd/file/dist/src/ctime_r.c | 5 +-
external/bsd/file/dist/src/elfclass.h | 37 +++-
external/bsd/file/dist/src/file_opts.h | 9 +-
external/bsd/file/dist/src/fmtcheck.c | 3 +-
external/bsd/file/dist/src/getline.c | 5 +-
external/bsd/file/dist/src/getopt_long.c | 5 +-
external/bsd/file/dist/src/is_tar.c | 5 +-
external/bsd/file/dist/src/magic.h.in | 11 +-
external/bsd/file/dist/src/mygetopt.h | 3 +-
external/bsd/file/dist/src/pread.c | 5 +-
external/bsd/file/dist/src/readelf.h | 3 +-
external/bsd/file/dist/src/strcasestr.c | 3 +-
external/bsd/file/dist/src/strlcat.c | 3 +-
external/bsd/file/dist/src/strlcpy.c | 3 +-
external/bsd/file/dist/src/tar.h | 3 +-
external/bsd/file/dist/src/vasprintf.c | 17 +-
external/bsd/file/dist/tests/test.c | 3 +-
35 files changed, 455 insertions(+), 319 deletions(-)
diffs (truncated from 1330 to 300 lines):
diff -r 52cc524b8eef -r 9cbdb27d7698 external/bsd/file/dist/README
--- a/external/bsd/file/dist/README Fri Jan 02 19:56:20 2015 +0000
+++ b/external/bsd/file/dist/README Fri Jan 02 20:34:26 2015 +0000
@@ -1,6 +1,6 @@
## README for file(1) Command ##
- @(#) $File: README,v 1.48 2014/03/07 13:55:30 christos Exp $
+ @(#) $File: README,v 1.49 2015/01/02 20:23:04 christos Exp $
Mailing List: file%mx.gw.com@localhost
Mailing List archives: http://mx.gw.com/pipermail/file/
@@ -25,8 +25,8 @@
https://github.com/file/file
-The major changes for 5.x are CDF file parsing, indirect magic, and
-overhaul in mime and ascii encoding handling.
+The major changes for 5.x are CDF file parsing, indirect magic, name/use
+(recursion) and overhaul in mime and ascii encoding handling.
The major feature of 4.x is the refactoring of the code into a library,
and the re-write of the file command in terms of that library. The library
@@ -67,33 +67,41 @@
COPYING - read this first.
README - read this second (you are currently reading this file).
INSTALL - read on how to install
-
src/apprentice.c - parses /etc/magic to learn magic
+src/asctime_r.c - replacement for OS's that don't have it.
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/asctime_r.c - replacement for OS's that don't have it.
+src/asprintf.c - replacement for OS's that don't have it.
+src/cdf.[ch] - 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/ctime_r.c - replacement for OS's that don't have it.
+src/elfclass.h - common code for elf 32/64.
src/encoding.c - handles unicode encodings
src/file.c - the main program
src/file.h - header file
+src/file_opts.h - list of options
+src/fmtcheck.c - replacement for OS's that don't have it.
src/fsmagic.c - first set of tests the program runs, based on filesystem info
src/funcs.c - utilility functions
-src/getopt_long.c - for systems that don't have it.
-src/getline.c - for systems that don't have it.
+src/getline.c - replacement for OS's that don't have it.
+src/getopt_long.c - replacement for OS's 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.h.in - source file for magic.h
src/magic.c - the libmagic api
+src/pread.c - replacement for OS's that don't have it.
src/print.c - print results, errors, warnings.
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 - for systems that don't have it.
-src/strlcpy.c - for systems that don't have it.
+src/mygetopt.h - replacement for OS's that don't have it.
+src/strcasestr.c - replacement for OS's that don't have it.
+src/strlcat.c - replacement for OS's that don't have it.
+src/strlcpy.c - replacement for OS's that don't have it.
+src/tar.h - tar file definitions
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.
diff -r 52cc524b8eef -r 9cbdb27d7698 external/bsd/file/dist/TODO
--- a/external/bsd/file/dist/TODO Fri Jan 02 19:56:20 2015 +0000
+++ b/external/bsd/file/dist/TODO Fri Jan 02 20:34:26 2015 +0000
@@ -15,3 +15,5 @@
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.
+
+Read the kerberos magic entry for more ideas.
diff -r 52cc524b8eef -r 9cbdb27d7698 external/bsd/file/dist/magic/magdir/android
--- a/external/bsd/file/dist/magic/magdir/android Fri Jan 02 19:56:20 2015 +0000
+++ b/external/bsd/file/dist/magic/magdir/android Fri Jan 02 20:34:26 2015 +0000
@@ -1,6 +1,6 @@
#------------------------------------------------------------
-# $File: android,v 1.6 2014/08/04 06:00:36 christos Exp $
+# $File: android,v 1.7 2014/11/10 05:08:23 christos Exp $
# Various android related magic entries
#------------------------------------------------------------
@@ -15,54 +15,11 @@
>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
+>1024 string LOKI\01 \b, LOKI'd
>8 lelong >0 \b, kernel
>>12 lelong >0 \b (0x%x)
>16 lelong >0 \b, ramdisk
diff -r 52cc524b8eef -r 9cbdb27d7698 external/bsd/file/dist/magic/magdir/animation
--- a/external/bsd/file/dist/magic/magdir/animation Fri Jan 02 19:56:20 2015 +0000
+++ b/external/bsd/file/dist/magic/magdir/animation Fri Jan 02 20:34:26 2015 +0000
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: animation,v 1.55 2014/09/13 14:29:51 christos Exp $
+# $File: animation,v 1.56 2014/10/23 23:12:51 christos Exp $
# animation: file(1) magic for animation/movie formats
#
# animation formats
@@ -114,11 +114,11 @@
!:mime image/jpx
>8 string KDDI \b, 3GPP2 EZmovie for KDDI 3G cellphones
!:mime video/3gpp2
->8 string M4A \b, Apple iTunes AAC-LC (.M4A) Audio
+>8 string M4A \b, Apple iTunes ALAC/AAC-LC (.M4A) Audio
!:mime audio/x-m4a
->8 string M4B \b, Apple iTunes AAC-LC (.M4B) Audio Book
+>8 string M4B \b, Apple iTunes ALAC/AAC-LC (.M4B) Audio Book
!:mime audio/mp4
->8 string M4P \b, Apple iTunes AAC-LC (.M4P) AES Protected Audio
+>8 string M4P \b, Apple iTunes ALAC/AAC-LC (.M4P) AES Protected Audio
!:mime video/mp4
>8 string M4V \b, Apple iTunes Video (.M4V) Video
!:mime video/x-m4v
diff -r 52cc524b8eef -r 9cbdb27d7698 external/bsd/file/dist/magic/magdir/cafebabe
--- a/external/bsd/file/dist/magic/magdir/cafebabe Fri Jan 02 19:56:20 2015 +0000
+++ b/external/bsd/file/dist/magic/magdir/cafebabe Fri Jan 02 20:34:26 2015 +0000
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: cafebabe,v 1.16 2014/04/30 21:41:02 christos Exp $
+# $File: cafebabe,v 1.17 2015/01/01 17:07:00 christos Exp $
# Cafe Babes unite!
#
# Since Java bytecode and Mach-O universal binaries have the same magic number,
@@ -45,7 +45,7 @@
0 name mach-o \b [
>0 use mach-o-cpu \b
->&(8.L) indirect \b:
+>(8.L) indirect \b:
>0 belong x \b]
0 belong 0xcafebabe
diff -r 52cc524b8eef -r 9cbdb27d7698 external/bsd/file/dist/magic/magdir/database
--- a/external/bsd/file/dist/magic/magdir/database Fri Jan 02 19:56:20 2015 +0000
+++ b/external/bsd/file/dist/magic/magdir/database Fri Jan 02 20:34:26 2015 +0000
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: database,v 1.42 2014/08/19 14:18:04 christos Exp $
+# $File: database,v 1.43 2014/10/28 15:47:39 christos Exp $
# database: file(1) magic for various databases
#
# extracted from header/code files by Graeme Wilford (eep2gw%ee.surrey.ac.uk@localhost)
@@ -210,27 +210,27 @@
# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserverd (NULL)
>>>>>>>24 ubelong&0x0133f7ff >0
# test for reserved NULL byte
->>>>>>>>47 ubyte x
+>>>>>>>>47 ubyte 0
# test for valid TAG key format (0x10 or 0)
>>>>>>>>>559 ubyte&0xeF 0
# test MM <= 12
->>>>>>>>>45 ubeshort <0x0C20
->>>>>>>>>>45 ubyte >0
->>>>>>>>>>>46 ubyte <32
->>>>>>>>>>>>46 ubyte >0
+>>>>>>>>>>45 ubeshort <0x0C20
+>>>>>>>>>>>45 ubyte >0
+>>>>>>>>>>>>46 ubyte <32
+>>>>>>>>>>>>>46 ubyte >0
#!:mime application/x-mdx
->>>>>>>>>>>>>0 use xbase-type
->>>>>>>>>>>>>0 ubyte x \b MDX
->>>>>>>>>>>>>1 ubyte x \b, creation-date
->>>>>>>>>>>>>1 use xbase-date
->>>>>>>>>>>>>44 ubyte x \b, update-date
->>>>>>>>>>>>>44 use xbase-date
+>>>>>>>>>>>>>>0 use xbase-type
+>>>>>>>>>>>>>>0 ubyte x \b MDX
+>>>>>>>>>>>>>>1 ubyte x \b, creation-date
+>>>>>>>>>>>>>>1 use xbase-date
+>>>>>>>>>>>>>>44 ubyte x \b, update-date
+>>>>>>>>>>>>>>44 use xbase-date
# No.of tags in use (1,2,5,12)
->>>>>>>>>>>>>28 uleshort x \b, %d
+>>>>>>>>>>>>>>28 uleshort x \b, %d
# No. of entries in tag (0x30)
->>>>>>>>>>>>>25 ubyte x \b/%d tags
+>>>>>>>>>>>>>>25 ubyte x \b/%d tags
# Length of tag
->>>>>>>>>>>>>26 ubyte x * %d
+>>>>>>>>>>>>>>26 ubyte x * %d
# 1st tag name_
>>>>>>>>>>>>>548 string x \b, 1st tag "%.11s"
# 2nd tag name
@@ -345,60 +345,103 @@
# dBASE III
>>>>>>16 ubyte 3
# dBASE III DBT
->>>>>>>0 use xbase-memo-print
-# dBASE IV DBT , FoxPro FPT or many PNG , ZIP , DBF garbage
+>>>>>>>0 use dbase3-memo-print
+# dBASE III DBT without version, dBASE IV DBT , FoxPro FPT , or many ZIP , DBF garbage
>>>>>>16 ubyte 0
-# dBASE IV DBT with DBF name or DBF garbage
->>>>>>>8 ubelong >0x40000000
-# skip DBF and catch dBASE IV DBT with DBF name and with non big index of next free block
->>>>>>>>0 ulelong <0x01010002
->>>>>>>>>0 use xbase-memo-print
->>>>>>>8 ubelong 0
+# unusual dBASE III DBT like angest.dbt, dBASE IV DBT with block size 0 , FoxPro FPT , or garbage PCX DBF
+>>>>>>>20 uleshort 0
+# FoxPro FPT , unusual dBASE III DBT like biblio.dbt or garbage
+>>>>>>>>8 ulong =0
+>>>>>>>>>6 ubeshort >0
+# skip emacs.PIF
+>>>>>>>>>>4 ushort 0
+>>>>>>>>>>>0 use foxpro-memo-print
+# dBASE III DBT , garbage
+>>>>>>>>>6 ubeshort 0
# skip MM*DD*.bin by test for for reserved NULL byte
->>>>>>>>508 ubelong 0
-# real memo files should contain text here
->>>>>>>>>520 ubelong >0x20202019
->>>>>>>>>>520 ubelong <0xFEFEFEFF
->>>>>>>>>>>0 use xbase-memo-print
-# garbage PCX , ZIP , JAR , XPI
->>>>>>>8 default x
+>>>>>>>>>>510 ubeshort 0
+# skip TK-DOS11.img image by looking for memo text
+>>>>>>>>>>>512 ubelong <0xfeffff03
+# skip EFI executables by looking for memo text
+>>>>>>>>>>>>512 ubelong >0x1F202020
+>>>>>>>>>>>>>513 ubyte >0
+# unusual dBASE III DBT like adressen.dbt
+>>>>>>>>>>>>>>0 use dbase3-memo-print
+# dBASE III DBT like angest.dbt, or garbage PCX DBF
+>>>>>>>>8 ubelong !0
+# skip PCX and some DBF by test for for reserved NULL bytes
+>>>>>>>>>510 ubeshort 0
+# skip some DBF by test of invalid version
+>>>>>>>>>>0 ubyte >5
+>>>>>>>>>>>0 ubyte <48
+>>>>>>>>>>>>0 use dbase3-memo-print
+# dBASE IV DBT with positive block size
+>>>>>>>20 uleshort >0
+>>>>>>>>0 use dbase4-memo-print
Home |
Main Index |
Thread Index |
Old Index