]> granicus.if.org Git - file/log
file
16 years agoput back compressed entries
Christos Zoulas [Thu, 22 May 2008 19:02:03 +0000 (19:02 +0000)]
put back compressed entries

16 years agoUse sizeof instead of array length from Charles Longeau
Christos Zoulas [Sun, 18 May 2008 23:21:17 +0000 (23:21 +0000)]
Use sizeof instead of array length from Charles Longeau

16 years agoAvoid printing a bad pointer from Charles Longeau
Christos Zoulas [Sun, 18 May 2008 23:20:40 +0000 (23:20 +0000)]
Avoid printing a bad pointer from Charles Longeau

16 years agofix vprintf bug.
Christos Zoulas [Fri, 16 May 2008 14:25:00 +0000 (14:25 +0000)]
fix vprintf bug.

16 years agoadd WSQ
Christos Zoulas [Wed, 14 May 2008 18:18:34 +0000 (18:18 +0000)]
add WSQ

16 years ago- compile with all warnings turned on.
Christos Zoulas [Fri, 9 May 2008 14:20:28 +0000 (14:20 +0000)]
- compile with all warnings turned on.
- don't tack .mgc if the file ends in .mgc

16 years agomove thunk to the right place
Christos Zoulas [Tue, 6 May 2008 11:08:29 +0000 (11:08 +0000)]
move thunk to the right place

16 years agobob's cleanup patches.
Christos Zoulas [Tue, 6 May 2008 11:07:41 +0000 (11:07 +0000)]
bob's cleanup patches.

16 years agofix search
Christos Zoulas [Tue, 29 Apr 2008 01:12:36 +0000 (01:12 +0000)]
fix search

16 years agocheck for <= 0 not just 0
Christos Zoulas [Tue, 29 Apr 2008 01:11:39 +0000 (01:11 +0000)]
check for <= 0 not just 0

16 years agomore debian patches from abelcheung
Christos Zoulas [Fri, 25 Apr 2008 14:58:57 +0000 (14:58 +0000)]
more debian patches from abelcheung

16 years agomore patches from abel cheung
Christos Zoulas [Wed, 23 Apr 2008 19:01:16 +0000 (19:01 +0000)]
more patches from abel cheung

16 years agomore from abel cheung
Christos Zoulas [Wed, 23 Apr 2008 19:00:31 +0000 (19:00 +0000)]
more from abel cheung

16 years agomore Debian fixes from Abel Cheung
Christos Zoulas [Wed, 23 Apr 2008 04:07:29 +0000 (04:07 +0000)]
more Debian fixes from Abel Cheung

16 years agodon't clobber windows icon files; Abel Cheung
Christos Zoulas [Wed, 23 Apr 2008 03:59:30 +0000 (03:59 +0000)]
don't clobber windows icon files; Abel Cheung

16 years agoRecent changes.
Christos Zoulas [Wed, 23 Apr 2008 03:53:01 +0000 (03:53 +0000)]
Recent changes.

16 years agoNew files
Christos Zoulas [Wed, 23 Apr 2008 03:52:38 +0000 (03:52 +0000)]
New files

16 years agosplit windows and msdos entries from Abel Cheung
Christos Zoulas [Wed, 23 Apr 2008 03:50:55 +0000 (03:50 +0000)]
split windows and msdos entries from Abel Cheung

16 years agoAdd magic submission guidelines from Abel Cheung
Christos Zoulas [Wed, 23 Apr 2008 03:45:20 +0000 (03:45 +0000)]
Add magic submission guidelines from Abel Cheung

16 years agogc some of the weak magic inone place.
Christos Zoulas [Mon, 21 Apr 2008 01:06:07 +0000 (01:06 +0000)]
gc some of the weak magic inone place.

16 years agoFrom Abel Cheung: Fix the WMF magic.
Christos Zoulas [Sun, 20 Apr 2008 22:24:45 +0000 (22:24 +0000)]
From Abel Cheung: Fix the WMF magic.

16 years agoadd cppflags for tests
Christos Zoulas [Sun, 20 Apr 2008 17:32:27 +0000 (17:32 +0000)]
add cppflags for tests

16 years agofixes from ALex Cheung.
Christos Zoulas [Sat, 19 Apr 2008 14:46:28 +0000 (14:46 +0000)]
fixes from ALex Cheung.

16 years agorecycle magic
Christos Zoulas [Wed, 16 Apr 2008 12:28:17 +0000 (12:28 +0000)]
recycle magic

16 years agofixes for pack200 from From: Ivan Todoroski <grnch@gmx.net>
Christos Zoulas [Tue, 8 Apr 2008 12:54:46 +0000 (12:54 +0000)]
fixes for pack200 from From: Ivan Todoroski <grnch@gmx.net>

16 years agoAdd Ruby patterns, based on the Lua ones.
Reuben Thomas [Tue, 8 Apr 2008 12:28:46 +0000 (12:28 +0000)]
Add Ruby patterns, based on the Lua ones.

16 years agoAdd some more MIME types, mainly for scripting languages. Change some
Reuben Thomas [Tue, 8 Apr 2008 12:22:14 +0000 (12:22 +0000)]
Add some more MIME types, mainly for scripting languages. Change some
that were "application/x-foo" to "text/x-foo".

Move the gnu gettext catalog patterns to "gnu" from "lisp".

16 years agoput back elfcore changelog entry.
Christos Zoulas [Mon, 7 Apr 2008 23:30:52 +0000 (23:30 +0000)]
put back elfcore changelog entry.

16 years agowe don't support <= and >= so don't allow it.
Christos Zoulas [Fri, 4 Apr 2008 15:01:09 +0000 (15:01 +0000)]
we don't support <= and >= so don't allow it.

16 years agoWe don't support >= or <=; fix the magic.
Christos Zoulas [Fri, 4 Apr 2008 14:57:49 +0000 (14:57 +0000)]
We don't support >= or <=; fix the magic.

16 years agouse magwarn for format warnings. FILE4_24
Christos Zoulas [Fri, 28 Mar 2008 18:19:30 +0000 (18:19 +0000)]
use magwarn for format warnings.

16 years agofix format
Christos Zoulas [Fri, 28 Mar 2008 18:18:29 +0000 (18:18 +0000)]
fix format

16 years agoelfcore fixes from Bob.
Christos Zoulas [Thu, 27 Mar 2008 22:00:28 +0000 (22:00 +0000)]
elfcore fixes from Bob.

16 years agomore ogg formats
Christos Zoulas [Wed, 26 Mar 2008 12:28:39 +0000 (12:28 +0000)]
more ogg formats

16 years agothanks, I've added it.
Christos Zoulas [Sun, 23 Mar 2008 16:05:50 +0000 (16:05 +0000)]
thanks, I've added it.

16 years agofile 4.24
Christos Zoulas [Sat, 22 Mar 2008 21:39:43 +0000 (21:39 +0000)]
file 4.24

16 years agomake distcheck work.
Christos Zoulas [Sat, 22 Mar 2008 21:36:18 +0000 (21:36 +0000)]
make distcheck work.

16 years agotry to fix distcheck
Christos Zoulas [Sat, 22 Mar 2008 21:26:43 +0000 (21:26 +0000)]
try to fix distcheck

16 years agoput the fragments back in; otherwise make distcheck fails.
Christos Zoulas [Sat, 22 Mar 2008 21:21:21 +0000 (21:21 +0000)]
put the fragments back in; otherwise make distcheck fails.

16 years ago* does not work in all the Makes.
Christos Zoulas [Sat, 22 Mar 2008 21:00:59 +0000 (21:00 +0000)]
* does not work in all the Makes.

16 years agothe fragment generation does not work:
Christos Zoulas [Sat, 22 Mar 2008 20:56:20 +0000 (20:56 +0000)]
the fragment generation does not work:
$ make
cd .. && /bin/bash /u/christos/src/file/missing --run automake-1.10 --gnu  magic/Makefile
 automake-1.10: cannot open < magic/magic_fragments.mak: No such file or directory

16 years agoSince the fragments are in pkgdata_DATA, they don't need to be in
Reuben Thomas [Wed, 19 Mar 2008 00:51:46 +0000 (00:51 +0000)]
Since the fragments are in pkgdata_DATA, they don't need to be in
EXTRA_DIST.

16 years agoBuild list of magic fragments in a way that should work on most makes.
Reuben Thomas [Wed, 19 Mar 2008 00:50:19 +0000 (00:50 +0000)]
Build list of magic fragments in a way that should work on most makes.

16 years agogive the magic file the proper name.
Christos Zoulas [Fri, 7 Mar 2008 20:03:45 +0000 (20:03 +0000)]
give the magic file the proper name.

16 years agobring them back so that we don't lose history and mess up other repositories.
Christos Zoulas [Fri, 7 Mar 2008 19:51:01 +0000 (19:51 +0000)]
bring them back so that we don't lose history and mess up other repositories.

16 years agoStar expansion is not portable; only gmake supports it.
Christos Zoulas [Fri, 7 Mar 2008 16:21:44 +0000 (16:21 +0000)]
Star expansion is not portable; only gmake supports it.

16 years agoText/binary split.
Reuben Thomas [Sat, 1 Mar 2008 22:21:48 +0000 (22:21 +0000)]
Text/binary split.

16 years agoCast [f]printf to void to make lint happy.
Reuben Thomas [Sat, 1 Mar 2008 11:49:07 +0000 (11:49 +0000)]
Cast [f]printf to void to make lint happy.

16 years agoHave exactly one CVS $File line in each .man file
Reuben Thomas [Thu, 28 Feb 2008 22:24:46 +0000 (22:24 +0000)]
Have exactly one CVS $File line in each .man file

16 years agoMention Linux in sections note
Reuben Thomas [Thu, 28 Feb 2008 22:22:19 +0000 (22:22 +0000)]
Mention Linux in sections note

16 years agoMake some small improvements to the magic man page, including nesting
Reuben Thomas [Thu, 28 Feb 2008 20:10:10 +0000 (20:10 +0000)]
Make some small improvements to the magic man page, including nesting
the list of magic line elements correctly, modernising some of the
early discussion of magic patterns, and making the warning against
regexs clearer.

16 years agoFix typo in gedcom.magic.
Reuben Thomas [Thu, 28 Feb 2008 19:48:49 +0000 (19:48 +0000)]
Fix typo in gedcom.magic.

Fix gedcom.result to correspond to reality.

Make test read and check result file against actual result.

16 years agoAdd basic instructions for writing tests.
Reuben Thomas [Thu, 28 Feb 2008 19:27:49 +0000 (19:27 +0000)]
Add basic instructions for writing tests.

16 years agoUse wildcards to avoid having to extend EXTRA_DIST each time a test is
Reuben Thomas [Thu, 28 Feb 2008 19:18:58 +0000 (19:18 +0000)]
Use wildcards to avoid having to extend EXTRA_DIST each time a test is
added.

16 years agoRemove already-fulfilled FIXME.
Reuben Thomas [Thu, 28 Feb 2008 19:17:50 +0000 (19:17 +0000)]
Remove already-fulfilled FIXME.

16 years agoModernise the language at the start, speaking of "magic patterns"
Reuben Thomas [Thu, 28 Feb 2008 13:14:26 +0000 (13:14 +0000)]
Modernise the language at the start, speaking of "magic patterns"
rather than "magic numbers". We still mention these later in an
historical context.

Be more consistent in syntax of magic fragments.

16 years agoFix bogus white space introduced in last commit.
Reuben Thomas [Wed, 27 Feb 2008 18:04:53 +0000 (18:04 +0000)]
Fix bogus white space introduced in last commit.

16 years agoFix formatting of function declaration.
Reuben Thomas [Wed, 27 Feb 2008 17:59:21 +0000 (17:59 +0000)]
Fix formatting of function declaration.

Don't try to parse a file we can't open!

16 years agoCompact some over-generously-spaced comments.
Reuben Thomas [Wed, 27 Feb 2008 15:02:33 +0000 (15:02 +0000)]
Compact some over-generously-spaced comments.

16 years agoRemove a spurious comma.
Reuben Thomas [Tue, 26 Feb 2008 03:26:17 +0000 (03:26 +0000)]
Remove a spurious comma.

16 years agoRemove unused #ifdef, NOORDER.
Reuben Thomas [Tue, 26 Feb 2008 03:03:40 +0000 (03:03 +0000)]
Remove unused #ifdef, NOORDER.

16 years agoUse "private" instead of "static" for load_1, as it should be.
Reuben Thomas [Mon, 25 Feb 2008 18:19:48 +0000 (18:19 +0000)]
Use "private" instead of "static" for load_1, as it should be.

16 years agoFix relative offsets after search again, this time I think properly.
Reuben Thomas [Mon, 25 Feb 2008 02:54:08 +0000 (02:54 +0000)]
Fix relative offsets after search again, this time I think properly.
Since this fix was complex (for me!), I'll explain it; the fix also is
slightly more than minimal in order to make the code clearer.

The bug was in lines 1644 and 1652: ms->search.offset = m->offset
overwrites the earlier addition, in lines 192-3, of the relevant offset
to ms->offset. So m->offset should become ms->offset in both lines.

This is a correct fix, but it is not ideal. For starters (and
indepdently of this fix), line 1652 can be changed simply to
ms->search.offset += idx, as this does not mention ms->offset
unnecessarily. Secondly, the code for FILE_REGEX initialises
ms->search.offset in mcopy at about line 820, not in magiccheck at
all, so it makes sense to move FILE_SEARCH's initialisation there too
for consistency. It then becomes
ms->search.offset = offset. We can check that "offset" is earlier set
to "ms->offset" in mcopy's caller, mget, so it's the same value.

16 years agoRevert change made in 1.108 and 1.109, as I still haven't got this
Reuben Thomas [Mon, 25 Feb 2008 01:05:30 +0000 (01:05 +0000)]
Revert change made in 1.108 and 1.109, as I still haven't got this
right, and the bugs my changes introduced are much worse than those it
fixed. I'll fix this properly as soon as I can work out how.

16 years agodon't let gcc optimize out our RCS id.
Christos Zoulas [Sun, 24 Feb 2008 01:35:58 +0000 (01:35 +0000)]
don't let gcc optimize out our RCS id.

16 years agoFix magic directory/file parsing code so it really can parse a single file.
Reuben Thomas [Sun, 24 Feb 2008 01:19:36 +0000 (01:19 +0000)]
Fix magic directory/file parsing code so it really can parse a single file.

16 years agoThis code was funny, but it caught my eye too many times, both
Reuben Thomas [Sun, 24 Feb 2008 01:17:54 +0000 (01:17 +0000)]
This code was funny, but it caught my eye too many times, both
directly and when grepping.

16 years agoMake looks_utf8 a global function, file_looks_utf8
Reuben Thomas [Sun, 24 Feb 2008 01:16:08 +0000 (01:16 +0000)]
Make looks_utf8 a global function, file_looks_utf8

16 years agoChange magic.nospflag to a flag bit in magic.flag.
Reuben Thomas [Sun, 24 Feb 2008 01:13:13 +0000 (01:13 +0000)]
Change magic.nospflag to a flag bit in magic.flag.

16 years agoReduce MAXMAGIS again; I hadn't realised it isn't really a maximum,
Reuben Thomas [Sun, 24 Feb 2008 01:06:08 +0000 (01:06 +0000)]
Reduce MAXMAGIS again; I hadn't realised it isn't really a maximum,
just an initial max. size.

16 years agoTests now in separate directory
Reuben Thomas [Sun, 24 Feb 2008 00:57:59 +0000 (00:57 +0000)]
Tests now in separate directory

16 years agoFix dependency typo
Reuben Thomas [Sun, 24 Feb 2008 00:57:30 +0000 (00:57 +0000)]
Fix dependency typo

16 years agoAdd the beginnings of a test suite, based on test.c.
Reuben Thomas [Sun, 24 Feb 2008 00:55:49 +0000 (00:55 +0000)]
Add the beginnings of a test suite, based on test.c.

16 years agoTweak strength formula for search/regex patterns.
Reuben Thomas [Tue, 19 Feb 2008 18:38:38 +0000 (18:38 +0000)]
Tweak strength formula for search/regex patterns.

16 years agoFixes for fragmented magic.
Reuben Thomas [Tue, 19 Feb 2008 18:04:09 +0000 (18:04 +0000)]
Fixes for fragmented magic.

16 years agoAdd elfclass.h to libmagic_la_SOURCES.
Reuben Thomas [Tue, 19 Feb 2008 18:00:12 +0000 (18:00 +0000)]
Add elfclass.h to libmagic_la_SOURCES.

16 years agoUpdate man page to cover magic directories.
Reuben Thomas [Tue, 19 Feb 2008 17:58:00 +0000 (17:58 +0000)]
Update man page to cover magic directories.

Several other updates and fixes.

16 years agoAllow elements of a magic path to be directories.
Reuben Thomas [Tue, 19 Feb 2008 17:29:30 +0000 (17:29 +0000)]
Allow elements of a magic path to be directories.

Up MAXMAGIS to 16384 (seems more reasonable, we have nearly 8000
patterns already).

16 years agoUse fragments directly, don't cat them into a big file.
Reuben Thomas [Tue, 19 Feb 2008 17:27:15 +0000 (17:27 +0000)]
Use fragments directly, don't cat them into a big file.

Rename Magdir to magic for historical compatibility (magic.mgc still
exists).

16 years ago- Fix dynamic object stripped/notstripped printing that was broken with the
Christos Zoulas [Tue, 19 Feb 2008 15:53:09 +0000 (15:53 +0000)]
- Fix dynamic object stripped/notstripped printing that was broken with the
  dynamic executable switch fixes.
- Propagate the dynamic executable fixes to the 64 bit code, and merge the
  code snippets so that they don't diverge again.

16 years agoReplace use of (v)snprintf with (v)asprintf. This has several advantages:
Reuben Thomas [Tue, 19 Feb 2008 00:58:59 +0000 (00:58 +0000)]
Replace use of (v)snprintf with (v)asprintf. This has several advantages:

1. (Mostly) easier to program with as the allocation is done for you.
   (Sometimes it's a little more complicated to get the deallocation
   right). The amount of code removed as a result by this commit is
   greater than the amount introduced (excluding the (v)asprintf
   implementation).

2. Safer: no buffer overflows.

3. Works on all platforms: BSD-licensed mature xnprintf code used
   (I've been using this for some years in Zile with no problems). No
   more overflows due to the previous bogus snprintf/vsnprintf
   fallbacks.

Also add and use a MAX() macro in the same vein as MIN().

16 years agoRemove unused variable
Reuben Thomas [Mon, 18 Feb 2008 21:50:24 +0000 (21:50 +0000)]
Remove unused variable

16 years agoRename apprentice_file to apprentice_load to avoid confusion between
Reuben Thomas [Mon, 18 Feb 2008 21:45:58 +0000 (21:45 +0000)]
Rename apprentice_file to apprentice_load to avoid confusion between
apprentice_file and file_apprentice.

16 years agoFix email address. pre-rrt-big-changes-post-4-23
Reuben Thomas [Mon, 18 Feb 2008 21:28:38 +0000 (21:28 +0000)]
Fix email address.

16 years agoNote that search patterns can use the same modifiers as string patterns.
Reuben Thomas [Mon, 18 Feb 2008 18:32:31 +0000 (18:32 +0000)]
Note that search patterns can use the same modifiers as string patterns.

16 years agoWarn about regex use
Reuben Thomas [Mon, 18 Feb 2008 18:28:51 +0000 (18:28 +0000)]
Warn about regex use

16 years agoAdd GnuCash support (Debian bug #383504)
Reuben Thomas [Mon, 18 Feb 2008 18:27:54 +0000 (18:27 +0000)]
Add GnuCash support (Debian bug #383504)

16 years agoRemove the "on most system" clause from the various types: the sizes
Reuben Thomas [Mon, 18 Feb 2008 18:09:00 +0000 (18:09 +0000)]
Remove the "on most system" clause from the various types: the sizes
of types are hardwired, and so file doesn't work anyway if they're
different.

16 years agoFix Vorbis detection for Ogg files with ID3 tags.
Reuben Thomas [Mon, 18 Feb 2008 18:02:15 +0000 (18:02 +0000)]
Fix Vorbis detection for Ogg files with ID3 tags.

16 years agoComment out overly weak Lisp/Windows .inf magic. Can't tell the
Reuben Thomas [Mon, 18 Feb 2008 17:15:47 +0000 (17:15 +0000)]
Comment out overly weak Lisp/Windows .inf magic. Can't tell the
difference between .inf format such as for wine.conf (where there are
no \r's) and Scheme/Lisp. Possibly one could use keywords to find Lisp
and .inf section headings to guess .inf files, but for now just give up.

16 years agoComment out LZMA detection, as according to discussion on Debian bug
Reuben Thomas [Mon, 18 Feb 2008 14:17:20 +0000 (14:17 +0000)]
Comment out LZMA detection, as according to discussion on Debian bug
#364260 it's not possible to make it reliable. Apparently there's a
newer version of the archive format that can be detected, but it
doesn't seem to be deployed yet; I have asked for more details.

16 years agoAttempt to make LZMA work better, by observation: simply cut off the
Reuben Thomas [Mon, 18 Feb 2008 13:27:36 +0000 (13:27 +0000)]
Attempt to make LZMA work better, by observation: simply cut off the
bytes that don't match an arbitrary file I made. 5 bytes is still
enough for binary magic.

16 years agoComment out more weak magic.
Reuben Thomas [Mon, 18 Feb 2008 12:42:43 +0000 (12:42 +0000)]
Comment out more weak magic.

16 years agoFix offset update for pstrings (Debian bug #466033)
Reuben Thomas [Mon, 18 Feb 2008 00:43:45 +0000 (00:43 +0000)]
Fix offset update for pstrings (Debian bug #466033)

16 years agoRemove regex.
Reuben Thomas [Mon, 18 Feb 2008 00:04:28 +0000 (00:04 +0000)]
Remove regex.

16 years agoFix typo in earlier fix
Reuben Thomas [Sun, 17 Feb 2008 23:40:48 +0000 (23:40 +0000)]
Fix typo in earlier fix

16 years agoReplace a regex with a search pattern
Reuben Thomas [Sun, 17 Feb 2008 19:58:01 +0000 (19:58 +0000)]
Replace a regex with a search pattern

16 years agoEnforce range in search (use default non-zero value if not given in
Reuben Thomas [Sun, 17 Feb 2008 19:28:54 +0000 (19:28 +0000)]
Enforce range in search (use default non-zero value if not given in
magic file).

Rename str_count to str_range for clarity.

Improve exegetical comment in file_strncmp.

16 years agoClarify syntax
Reuben Thomas [Sun, 17 Feb 2008 19:26:15 +0000 (19:26 +0000)]
Clarify syntax

16 years agoReplace a regex with a search
Reuben Thomas [Sun, 17 Feb 2008 19:22:47 +0000 (19:22 +0000)]
Replace a regex with a search