]> granicus.if.org Git - file/log
file
10 years agodocument regex limit.
Christos Zoulas [Fri, 30 May 2014 16:52:20 +0000 (16:52 +0000)]
document regex limit.

10 years agoUpdate regex recommendation.
Christos Zoulas [Fri, 30 May 2014 16:51:23 +0000 (16:51 +0000)]
Update regex recommendation.

10 years agoLimit regex search for BEGIN to the first 4K of the file.
Christos Zoulas [Fri, 30 May 2014 16:48:44 +0000 (16:48 +0000)]
Limit regex search for BEGIN to the first 4K of the file.

10 years agoIf requested, limit search length.
Christos Zoulas [Fri, 30 May 2014 16:47:44 +0000 (16:47 +0000)]
If requested, limit search length.

10 years agorecognize nonorton ghost files. Joerg Jenderek
Christos Zoulas [Fri, 30 May 2014 15:07:02 +0000 (15:07 +0000)]
recognize nonorton ghost files. Joerg Jenderek

10 years ago- fix non-ascii.
Christos Zoulas [Wed, 28 May 2014 20:33:59 +0000 (20:33 +0000)]
- fix non-ascii.
- mention recent changes

10 years agofurther optimize awk by not looking for the BEGIN regex until we found the
Christos Zoulas [Wed, 28 May 2014 19:52:36 +0000 (19:52 +0000)]
further optimize awk by not looking for the BEGIN regex until we found the
BEGIN (Jan Kaluza)

10 years agofix endianness problem.
Christos Zoulas [Wed, 28 May 2014 19:50:41 +0000 (19:50 +0000)]
fix endianness problem.

10 years agoCVE-2014-0207: Prevent 0 element vectors and vectors longer than the number
Christos Zoulas [Wed, 21 May 2014 13:04:38 +0000 (13:04 +0000)]
CVE-2014-0207: Prevent 0 element vectors and vectors longer than the number
of properties from accessing random memory.

10 years agoadd linux device tree.
Christos Zoulas [Tue, 20 May 2014 20:10:17 +0000 (20:10 +0000)]
add linux device tree.

10 years agoPR/343: dosexec mime broken
Christos Zoulas [Thu, 15 May 2014 01:24:58 +0000 (01:24 +0000)]
PR/343: dosexec mime broken

10 years agoPR/354: Fix stray ^M's
Christos Zoulas [Wed, 14 May 2014 23:32:30 +0000 (23:32 +0000)]
PR/354: Fix stray ^M's

10 years agoPR/354: Encoding irregularities.
Christos Zoulas [Wed, 14 May 2014 23:30:28 +0000 (23:30 +0000)]
PR/354: Encoding irregularities.

10 years agoPR/352: Support for Hangul (Korean) Word Processor 5.x Files (*.hwp)
Christos Zoulas [Wed, 14 May 2014 23:22:48 +0000 (23:22 +0000)]
PR/352: Support for Hangul (Korean) Word Processor 5.x Files (*.hwp)

10 years agoPR/347: Windows patches.
Christos Zoulas [Wed, 14 May 2014 23:15:42 +0000 (23:15 +0000)]
PR/347: Windows patches.

10 years agoremove unused.
Christos Zoulas [Wed, 14 May 2014 23:09:21 +0000 (23:09 +0000)]
remove unused.

10 years agoPR/346: New sereal magic
Christos Zoulas [Wed, 14 May 2014 23:04:59 +0000 (23:04 +0000)]
PR/346: New sereal magic

10 years agoPR/353: Dagobert Michelsen: Add "file.h" to get proper headers for intptr_t
Christos Zoulas [Tue, 13 May 2014 16:48:12 +0000 (16:48 +0000)]
PR/353: Dagobert Michelsen: Add "file.h" to get proper headers for intptr_t

10 years agoRoman I Khimov:
Christos Zoulas [Tue, 13 May 2014 16:44:24 +0000 (16:44 +0000)]
Roman I Khimov:
access() can't handle NULL as first argument and we can end up
calling it this way if inname is NULL in file_or_fd() and fd is a
pipe. Issue spotted by clang static analysis.

10 years agoRoman I Khimov:
Christos Zoulas [Tue, 13 May 2014 16:42:17 +0000 (16:42 +0000)]
Roman I Khimov:
Remove useless assignments found by clang static analysis.

10 years agoRoman I Khimov:
Christos Zoulas [Tue, 13 May 2014 16:41:06 +0000 (16:41 +0000)]
Roman I Khimov:
If cdf_count_chain() is called with sid < 0, then we end up returning
zero length, which in turn leads to calloc() calls for 0 bytes in
cdf_read_long_sector_chain(), cdf_read_short_sector_chain() and
cdf_read_ssat(). Depending on calloc() implementation we can end
up returning -1 or 0 from those. As negative sid is probably wrong
case anyway, it might be better to always return -1.
Issue found by clang static analysis.

10 years agoRoman I Khimov:
Christos Zoulas [Tue, 13 May 2014 16:38:23 +0000 (16:38 +0000)]
Roman I Khimov:
If file_reset() fails for some reason, we pass uninitialized sb to
close_and_restore() which uses it for utimes().
Issue spotted by clang static analysis.

10 years agoFix coredump in clang caused by missing array terminator element.
Christos Zoulas [Wed, 7 May 2014 21:26:06 +0000 (21:26 +0000)]
Fix coredump in clang caused by missing array terminator element.

10 years agomerge dup VDI
Christos Zoulas [Wed, 7 May 2014 21:25:41 +0000 (21:25 +0000)]
merge dup VDI
move virtual images from msdos to virtual

10 years agomore lz4
Christos Zoulas [Wed, 7 May 2014 19:36:59 +0000 (19:36 +0000)]
more lz4

10 years agoFix for uninialized title (Jan Kaluza)
Christos Zoulas [Wed, 7 May 2014 10:13:12 +0000 (10:13 +0000)]
Fix for uninialized title (Jan Kaluza)

10 years agoRemove loop that kept reading the same offset (Jan Kaluza)
Christos Zoulas [Tue, 6 May 2014 18:20:39 +0000 (18:20 +0000)]
Remove loop that kept reading the same offset (Jan Kaluza)

10 years ago_POSIX2_RE_DUP_MAX is 255 on most systems.
Christos Zoulas [Tue, 6 May 2014 16:08:32 +0000 (16:08 +0000)]
_POSIX2_RE_DUP_MAX is 255 on most systems.

10 years agoCompile regex during the magic compilation process so that we catch bad
Christos Zoulas [Tue, 6 May 2014 16:07:23 +0000 (16:07 +0000)]
Compile regex during the magic compilation process so that we catch bad
regular expressions early.

10 years agofactor out all the duplicated regex code into a wrapper.
Christos Zoulas [Mon, 5 May 2014 20:53:10 +0000 (20:53 +0000)]
factor out all the duplicated regex code into a wrapper.

10 years agoApply patches from file-CVE-2012-1571.patch
Christos Zoulas [Mon, 5 May 2014 16:11:21 +0000 (16:11 +0000)]
Apply patches from file-CVE-2012-1571.patch
From Francisco Alonso Espejo:
    file < 5.18/git version can be made to crash when checking some
    corrupt CDF files (Using an invalid cdf_read_short_sector size)
    The problem I found here, is that in most situations (if
    h_short_sec_size_p2 > 8) because the blocksize is 512 and normal
    values are 06 which means reading 64 bytes.As long as the check
    for the block size copy is not checked properly (there's an assert
    that makes wrong/invalid assumptions)

10 years agoPR/351: Fix compilation of empty files.
Christos Zoulas [Sun, 4 May 2014 18:57:34 +0000 (18:57 +0000)]
PR/351: Fix compilation of empty files.

10 years agoCode to detect gnu attributes, and start of parser.
Christos Zoulas [Fri, 2 May 2014 02:25:10 +0000 (02:25 +0000)]
Code to detect gnu attributes, and start of parser.

10 years agoFrom Christoph Biedl:
Christos Zoulas [Fri, 2 May 2014 00:26:49 +0000 (00:26 +0000)]
From Christoph Biedl:
Debian bug #745546 et al: At the moment, the magic for "Macromedia
Flash data" and "Macromedia Flash Video" is just three printable
characters, no wonder this results in mis-detection of text files.

"Flash Video" is easy to fix, according to Wikipedia the forth
octet must have value 1.

"Flash data" is more work. The length information at offset 4 must be
non-zero, and the version number at offset 3 must be sound. According
to the pdf document, the latest version is 19, I found a few examples
in the lower twenties, so 32 should be a sane limit for the time
being. There are however quite a few files with version 255, and since
the virus scanners created an alert for all of them, they are now
reported as "suspicious".

10 years agoKill %h %hh and %l modifiers for bytes, shorts, and longs respectively.
Christos Zoulas [Wed, 30 Apr 2014 21:41:01 +0000 (21:41 +0000)]
Kill %h %hh and %l modifiers for bytes, shorts, and longs respectively.
Use nothing, for all types except quads which need %ll

10 years agoAdd missing specifiers for %h?
Christos Zoulas [Mon, 28 Apr 2014 14:09:07 +0000 (14:09 +0000)]
Add missing specifiers for %h?

10 years agofix integer format widths
Christos Zoulas [Mon, 28 Apr 2014 12:04:50 +0000 (12:04 +0000)]
fix integer format widths

10 years agoadd perl hash magic
Christos Zoulas [Mon, 28 Apr 2014 12:04:35 +0000 (12:04 +0000)]
add perl hash magic

10 years agoFix wrong ifdef configure test (Jean-Louis CHARTON)
Christos Zoulas [Thu, 17 Apr 2014 12:47:11 +0000 (12:47 +0000)]
Fix wrong ifdef configure test (Jean-Louis CHARTON)

10 years agotry to fix memcpy (Jean-Louis CHARTON)
Christos Zoulas [Thu, 17 Apr 2014 12:45:50 +0000 (12:45 +0000)]
try to fix memcpy (Jean-Louis CHARTON)

10 years agokill c99 comments, aix does not like them (Jean-Louis CHARTON)
Christos Zoulas [Thu, 17 Apr 2014 12:44:01 +0000 (12:44 +0000)]
kill c99 comments, aix does not like them (Jean-Louis CHARTON)

10 years agoPR/337: Fix incorrect handling of offsets (wrong sign)
Christos Zoulas [Sat, 12 Apr 2014 15:47:10 +0000 (15:47 +0000)]
PR/337: Fix incorrect handling of offsets (wrong sign)
Test:
$ perl -e 'print "ABC", "\xff\xff", "\x00"x70000, "DEF"' > abc.data
$ cat abc.magic
0 string ABC ABC test file format
>(3.s) search/0x3000 DEF \b, DEF sub type
$ file -m abc.magic abc.data
abc.data: ABC test file format, DEF sub type

10 years agoPR/339: updates from Rick Richardson
Christos Zoulas [Sat, 12 Apr 2014 14:51:52 +0000 (14:51 +0000)]
PR/339: updates from Rick Richardson

10 years agoPR/340: New magic for snappy framing
Christos Zoulas [Sat, 12 Apr 2014 14:44:33 +0000 (14:44 +0000)]
PR/340: New magic for snappy framing

10 years agoPR/345: add tests for intptr_t and uintptr_t
Christos Zoulas [Sat, 12 Apr 2014 14:41:34 +0000 (14:41 +0000)]
PR/345: add tests for intptr_t and uintptr_t

10 years agoFix regression: If a file was already bytes, don't try to convert it.
Christos Zoulas [Thu, 3 Apr 2014 20:47:24 +0000 (20:47 +0000)]
Fix regression: If a file was already bytes, don't try to convert it.
From: Arfrever Frehtes Taifersar Arahesis

10 years agoNew fixes
Christos Zoulas [Tue, 1 Apr 2014 15:57:45 +0000 (15:57 +0000)]
New fixes

10 years agoPR/341: Jan Kaluza: Fix memory leak
Christos Zoulas [Tue, 1 Apr 2014 15:57:28 +0000 (15:57 +0000)]
PR/341: Jan Kaluza: Fix memory leak

10 years agoPR/342: Jan Kaluza: Reverse order of evaluation to fix out of bounds read.
Christos Zoulas [Tue, 1 Apr 2014 15:44:26 +0000 (15:44 +0000)]
PR/342: Jan Kaluza: Reverse order of evaluation to fix out of bounds read.

10 years agoraise the strength of the targa magic, instead of dropping the cursor magic
Christos Zoulas [Sun, 30 Mar 2014 21:41:45 +0000 (21:41 +0000)]
raise the strength of the targa magic, instead of dropping the cursor magic
so that they does not get recognized as lotus 123 files. From Christoph Biedl

10 years agoremove extra line (Christoph Biedl)
Christos Zoulas [Sun, 30 Mar 2014 21:40:08 +0000 (21:40 +0000)]
remove extra line (Christoph Biedl)

10 years agocapitalize sparc
Christos Zoulas [Sat, 29 Mar 2014 15:40:34 +0000 (15:40 +0000)]
capitalize sparc

10 years agoImprove library detection, (Christoph Biedl)
Christos Zoulas [Fri, 28 Mar 2014 19:11:40 +0000 (19:11 +0000)]
Improve library detection, (Christoph Biedl)

10 years agofix compilation without fmt debug.
Christos Zoulas [Fri, 28 Mar 2014 19:07:08 +0000 (19:07 +0000)]
fix compilation without fmt debug.

10 years agoreduce strength of windows cursors so that they don't win over Targa files
Christos Zoulas [Fri, 28 Mar 2014 19:06:09 +0000 (19:06 +0000)]
reduce strength of windows cursors so that they don't win over Targa files
(Christoph Biedl)

10 years ago- Add some debugging code to print incorrect formats.
Christos Zoulas [Thu, 27 Mar 2014 18:12:12 +0000 (18:12 +0000)]
- Add some debugging code to print incorrect formats.
- Fix "long" formats which in magic "long" == 32 bit, which is not
  what "long" means in "C".

10 years agowelcome to 5.18 FILE5_18
Christos Zoulas [Wed, 26 Mar 2014 15:28:41 +0000 (15:28 +0000)]
welcome to 5.18

10 years agoadd megaraid.
Christos Zoulas [Sun, 23 Mar 2014 18:05:38 +0000 (18:05 +0000)]
add megaraid.

10 years agominor changes
Christos Zoulas [Sun, 16 Mar 2014 13:32:55 +0000 (13:32 +0000)]
minor changes

10 years agoTurn heading into markdown heading.
Kimmo Suominen [Sun, 16 Mar 2014 08:56:36 +0000 (08:56 +0000)]
Turn heading into markdown heading.

Verify that PR/336 is addressed also.

10 years agoDocument the release procedure.
Kimmo Suominen [Sun, 16 Mar 2014 08:53:09 +0000 (08:53 +0000)]
Document the release procedure.

10 years agoadd ConTeXt documents
Christos Zoulas [Sun, 16 Mar 2014 02:53:03 +0000 (02:53 +0000)]
add ConTeXt documents

10 years agoadd fmtcheck
Christos Zoulas [Sat, 15 Mar 2014 21:47:40 +0000 (21:47 +0000)]
add fmtcheck

10 years agotoday's changes
Christos Zoulas [Fri, 14 Mar 2014 19:14:11 +0000 (19:14 +0000)]
today's changes

10 years agoPR/319: Remove superfluous call to file_ascmagic_with_encoding. file_encoding
Christos Zoulas [Fri, 14 Mar 2014 19:02:37 +0000 (19:02 +0000)]
PR/319: Remove superfluous call to file_ascmagic_with_encoding. file_encoding
should have set looks_text correctly before, and file_ascmagic already calls
file_ascmagic_with_encoding if it needs to.

10 years agoPR/320: Issue a warning for mime types that are attached to magic entries
Christos Zoulas [Fri, 14 Mar 2014 18:48:11 +0000 (18:48 +0000)]
PR/320: Issue a warning for mime types that are attached to magic entries
that don't yet have descriptions.

10 years agoFix mime entries that were attached to magic entries that did not yet
Christos Zoulas [Fri, 14 Mar 2014 18:47:29 +0000 (18:47 +0000)]
Fix mime entries that were attached to magic entries that did not yet
have descriptions.

10 years agoPR/333: Be more precise about counting the strength of a regex, by counting the
Christos Zoulas [Fri, 14 Mar 2014 17:38:33 +0000 (17:38 +0000)]
PR/333: Be more precise about counting the strength of a regex, by counting the
number of actual matching characters specified in them.

10 years agoPR/334: don't try to free the magic list if it was not allocated, since this
Christos Zoulas [Fri, 14 Mar 2014 14:58:59 +0000 (14:58 +0000)]
PR/334: don't try to free the magic list if it was not allocated, since this
is an error.

10 years agoremove debugging printf.
Christos Zoulas [Tue, 11 Mar 2014 21:00:13 +0000 (21:00 +0000)]
remove debugging printf.

10 years agoremove bogus comment
Christos Zoulas [Tue, 11 Mar 2014 17:13:18 +0000 (17:13 +0000)]
remove bogus comment

10 years agofix bug intruduced by the locale changes.
Christos Zoulas [Tue, 11 Mar 2014 15:52:54 +0000 (15:52 +0000)]
fix bug intruduced by the locale changes.

10 years agoAdd ID.
Kimmo Suominen [Mon, 10 Mar 2014 12:42:49 +0000 (12:42 +0000)]
Add ID.

10 years agoSort list of packages for ease of maintenance.
Kimmo Suominen [Mon, 10 Mar 2014 12:38:08 +0000 (12:38 +0000)]
Sort list of packages for ease of maintenance.

10 years agoRemove explicit autotools-dev.
Kimmo Suominen [Mon, 10 Mar 2014 12:35:59 +0000 (12:35 +0000)]
Remove explicit autotools-dev.

10 years agoFix typo another way. Per Christoph Biedl.
Kimmo Suominen [Mon, 10 Mar 2014 08:48:18 +0000 (08:48 +0000)]
Fix typo another way. Per Christoph Biedl.

10 years agoescape space.
Christos Zoulas [Mon, 10 Mar 2014 00:53:38 +0000 (00:53 +0000)]
escape space.

10 years agoFix typo.
Kimmo Suominen [Sun, 9 Mar 2014 11:18:24 +0000 (11:18 +0000)]
Fix typo.

10 years agoAdd compiled delphi magic
Christos Zoulas [Sat, 8 Mar 2014 21:43:09 +0000 (21:43 +0000)]
Add compiled delphi magic

10 years agoExplain date number format (Christoph Biedl)
Christos Zoulas [Sat, 8 Mar 2014 17:28:08 +0000 (17:28 +0000)]
Explain date number format (Christoph Biedl)

10 years agoFIx windows icons and cursors (Christoph Biedl)
Christos Zoulas [Sat, 8 Mar 2014 17:26:48 +0000 (17:26 +0000)]
FIx windows icons and cursors (Christoph Biedl)

the detection of MS-Windows icon files was buggy and incomplete. Since
non-animated cursors have a very similar format, they are added here,
too.

Some details: Using only the very first four octets for determination
has always some risk of false detection. So additionally look at
offset 9 which should always be zero, but according to Wikipedia might
also be 0xff.

In "number of colors" at offset 8, the zero value previously was used
to describe "256 colors", according to Wikipedia this isn't true, so
it was dropped.

On a side node: This introduces another usage of name/use. I'm afraid
we might sooner or later end up in name clashes on these identifiers.
Feel free to extend them like prefixing with the file name "msdos-".

Also, I was a bit surprised no "message" in "use" is printed, I wanted
to do

    >>4 use     ico-dir     MS Windows icon resource

but that message gets lost. Hence the hackery

    >>0 byte    x           MS Windows icon resource
    >>4 use     ico-dir

So a feature request: Print any message in "use".

This patch by the way fixes Debian#562250. It just got a little
bigger.

10 years agoSync README.DEVELOPER and .travis.yml
Kimmo Suominen [Sat, 8 Mar 2014 08:41:07 +0000 (08:41 +0000)]
Sync README.DEVELOPER and .travis.yml

Minimize the number and size of dependencies and remove redundant
packages from the list.

10 years agodocument the apple option (Christoph Biedl)
Christos Zoulas [Fri, 7 Mar 2014 23:11:51 +0000 (23:11 +0000)]
document the apple option (Christoph Biedl)

10 years agoclarify the syntax for string searches (Christoph Biedl)
Christos Zoulas [Fri, 7 Mar 2014 23:11:16 +0000 (23:11 +0000)]
clarify the syntax for string searches (Christoph Biedl)

10 years agoAdd a couple of missing files
Christos Zoulas [Fri, 7 Mar 2014 17:25:17 +0000 (17:25 +0000)]
Add a couple of missing files

10 years agojust commit the yml, not all the html surrounding it.
Christos Zoulas [Fri, 7 Mar 2014 17:20:37 +0000 (17:20 +0000)]
just commit the yml, not all the html surrounding it.

10 years agomake this travis friendly.
Christos Zoulas [Fri, 7 Mar 2014 13:55:30 +0000 (13:55 +0000)]
make this travis friendly.

10 years agoDebian#605143: Appearently there's a formatting error in the
Christos Zoulas [Thu, 6 Mar 2014 19:30:52 +0000 (19:30 +0000)]
Debian#605143: Appearently there's a formatting error in the
presentation of some not-so-often MS-DOS executables.

10 years agoFrom Christoph Biedl, factor our riff magic
Christos Zoulas [Thu, 6 Mar 2014 18:55:09 +0000 (18:55 +0000)]
From Christoph Biedl, factor our riff magic

10 years agofrom glensc for testing
Christos Zoulas [Thu, 6 Mar 2014 17:45:46 +0000 (17:45 +0000)]
from glensc for testing

10 years agoone more
Christos Zoulas [Thu, 6 Mar 2014 17:29:28 +0000 (17:29 +0000)]
one more

10 years agonew changes
Christos Zoulas [Thu, 6 Mar 2014 17:28:14 +0000 (17:28 +0000)]
new changes

10 years agofix typo, add comment of perhaps a simpler path to success
Christos Zoulas [Thu, 6 Mar 2014 16:57:57 +0000 (16:57 +0000)]
fix typo, add comment of perhaps a simpler path to success

10 years agodon't compare SIZE_MAX to off_t; if they are the same size in bytes it is
Christos Zoulas [Thu, 6 Mar 2014 16:50:55 +0000 (16:50 +0000)]
don't compare SIZE_MAX to off_t; if they are the same size in bytes it is
wrong. Use a more appropriate comparison.

10 years agotypo
Christos Zoulas [Thu, 6 Mar 2014 16:37:39 +0000 (16:37 +0000)]
typo

10 years agoFixes from Christoph Biedl:
Christos Zoulas [Thu, 6 Mar 2014 16:37:16 +0000 (16:37 +0000)]
Fixes from Christoph Biedl:

Inspired by Debian#588953 that rightly complained about poor
recognition of avr32 ELF files: There have been changes since the
original bug submission, file(1) now detects them as

| ELF 32-bit MSB executable, *unknown arch 0xb9* version 1 (SYSV) (...)

but this was an impetus to update the list of "machines" (ELF speak),
or "architectures".

The list was taken from binutils-2.24:include/elf/common.h with some
extra research. Numbers marked "reserved" were excluded.

Additional changes:

* sorted strictly by machine number.
* some missing trailing comma added.
* slight change in Motorola names for clarity.
* fix obviously wrong endianess in 138 = LatticeMico32.
* marked all inofficial numbers as such (unless already "obsolete").
* description trimmed to keep strings short. Perhaps even any
  trailing "familiy" should be dropped for the same reason.

For your information, the two attached files were used as starting
point:

elf-archs-file.magic: The relevant lines in magic/Magic/elf
elf-archs-binutils.magic: The relevant lines in include/elf/common.h,
    sorted, converted into magic

As you can see, several names still differ, and it's not always easy
to judge which is better. The most prominent difference is machine
number 9, "IBM System/370" vs. "Amdahl". There's a reason for both,
and I decided to keep the name currently used by file(1).

Fun fact: file(1) knows more machine numbers than binutils.

10 years agosign police.
Christos Zoulas [Thu, 6 Mar 2014 16:18:53 +0000 (16:18 +0000)]
sign police.

10 years agoPR/323: Tobias Stoeckmann: Add size_t overflow check for stat.
Christos Zoulas [Thu, 6 Mar 2014 16:16:56 +0000 (16:16 +0000)]
PR/323: Tobias Stoeckmann: Add size_t overflow check for stat.

10 years agoPR/324: Sebastian Willing: Add CuBase
Christos Zoulas [Thu, 6 Mar 2014 16:14:08 +0000 (16:14 +0000)]
PR/324: Sebastian Willing: Add CuBase

10 years agoPR/326: Mark Schreiber: Add Abook (console addressbook program used with mutt)
Christos Zoulas [Thu, 6 Mar 2014 16:08:58 +0000 (16:08 +0000)]
PR/326: Mark Schreiber: Add Abook (console addressbook program used with mutt)