Reuben Thomas [Tue, 8 Apr 2008 12:28:46 +0000 (12:28 +0000)]
Add Ruby patterns, based on the Lua ones.
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".
Christos Zoulas [Mon, 7 Apr 2008 23:30:52 +0000 (23:30 +0000)]
put back elfcore changelog entry.
Christos Zoulas [Fri, 4 Apr 2008 15:01:09 +0000 (15:01 +0000)]
we don't support <= and >= so don't allow it.
Christos Zoulas [Fri, 4 Apr 2008 14:57:49 +0000 (14:57 +0000)]
We don't support >= or <=; fix the magic.
Christos Zoulas [Fri, 28 Mar 2008 18:19:30 +0000 (18:19 +0000)]
use magwarn for format warnings.
Christos Zoulas [Fri, 28 Mar 2008 18:18:29 +0000 (18:18 +0000)]
fix format
Christos Zoulas [Thu, 27 Mar 2008 22:00:28 +0000 (22:00 +0000)]
elfcore fixes from Bob.
Christos Zoulas [Wed, 26 Mar 2008 12:28:39 +0000 (12:28 +0000)]
more ogg formats
Christos Zoulas [Sun, 23 Mar 2008 16:05:50 +0000 (16:05 +0000)]
thanks, I've added it.
Christos Zoulas [Sat, 22 Mar 2008 21:39:43 +0000 (21:39 +0000)]
file 4.24
Christos Zoulas [Sat, 22 Mar 2008 21:36:18 +0000 (21:36 +0000)]
make distcheck work.
Christos Zoulas [Sat, 22 Mar 2008 21:26:43 +0000 (21:26 +0000)]
try to fix distcheck
Christos Zoulas [Sat, 22 Mar 2008 21:21:21 +0000 (21:21 +0000)]
put the fragments back in; otherwise make distcheck fails.
Christos Zoulas [Sat, 22 Mar 2008 21:00:59 +0000 (21:00 +0000)]
* does not work in all the Makes.
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
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.
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.
Christos Zoulas [Fri, 7 Mar 2008 20:03:45 +0000 (20:03 +0000)]
give the magic file the proper name.
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.
Christos Zoulas [Fri, 7 Mar 2008 16:21:44 +0000 (16:21 +0000)]
Star expansion is not portable; only gmake supports it.
Reuben Thomas [Sat, 1 Mar 2008 22:21:48 +0000 (22:21 +0000)]
Text/binary split.
Reuben Thomas [Sat, 1 Mar 2008 11:49:07 +0000 (11:49 +0000)]
Cast [f]printf to void to make lint happy.
Reuben Thomas [Thu, 28 Feb 2008 22:24:46 +0000 (22:24 +0000)]
Have exactly one CVS $File line in each .man file
Reuben Thomas [Thu, 28 Feb 2008 22:22:19 +0000 (22:22 +0000)]
Mention Linux in sections note
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.
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.
Reuben Thomas [Thu, 28 Feb 2008 19:27:49 +0000 (19:27 +0000)]
Add basic instructions for writing tests.
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.
Reuben Thomas [Thu, 28 Feb 2008 19:17:50 +0000 (19:17 +0000)]
Remove already-fulfilled FIXME.
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.
Reuben Thomas [Wed, 27 Feb 2008 18:04:53 +0000 (18:04 +0000)]
Fix bogus white space introduced in last commit.
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!
Reuben Thomas [Wed, 27 Feb 2008 15:02:33 +0000 (15:02 +0000)]
Compact some over-generously-spaced comments.
Reuben Thomas [Tue, 26 Feb 2008 03:26:17 +0000 (03:26 +0000)]
Remove a spurious comma.
Reuben Thomas [Tue, 26 Feb 2008 03:03:40 +0000 (03:03 +0000)]
Remove unused #ifdef, NOORDER.
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.
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.
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.
Christos Zoulas [Sun, 24 Feb 2008 01:35:58 +0000 (01:35 +0000)]
don't let gcc optimize out our RCS id.
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.
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.
Reuben Thomas [Sun, 24 Feb 2008 01:16:08 +0000 (01:16 +0000)]
Make looks_utf8 a global function, file_looks_utf8
Reuben Thomas [Sun, 24 Feb 2008 01:13:13 +0000 (01:13 +0000)]
Change magic.nospflag to a flag bit in magic.flag.
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.
Reuben Thomas [Sun, 24 Feb 2008 00:57:59 +0000 (00:57 +0000)]
Tests now in separate directory
Reuben Thomas [Sun, 24 Feb 2008 00:57:30 +0000 (00:57 +0000)]
Fix dependency typo
Reuben Thomas [Sun, 24 Feb 2008 00:55:49 +0000 (00:55 +0000)]
Add the beginnings of a test suite, based on test.c.
Reuben Thomas [Tue, 19 Feb 2008 18:38:38 +0000 (18:38 +0000)]
Tweak strength formula for search/regex patterns.
Reuben Thomas [Tue, 19 Feb 2008 18:04:09 +0000 (18:04 +0000)]
Fixes for fragmented magic.
Reuben Thomas [Tue, 19 Feb 2008 18:00:12 +0000 (18:00 +0000)]
Add elfclass.h to libmagic_la_SOURCES.
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.
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).
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).
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.
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().
Reuben Thomas [Mon, 18 Feb 2008 21:50:24 +0000 (21:50 +0000)]
Remove unused variable
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.
Reuben Thomas [Mon, 18 Feb 2008 21:28:38 +0000 (21:28 +0000)]
Fix email address.
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.
Reuben Thomas [Mon, 18 Feb 2008 18:28:51 +0000 (18:28 +0000)]
Warn about regex use
Reuben Thomas [Mon, 18 Feb 2008 18:27:54 +0000 (18:27 +0000)]
Add GnuCash support (Debian bug #383504)
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.
Reuben Thomas [Mon, 18 Feb 2008 18:02:15 +0000 (18:02 +0000)]
Fix Vorbis detection for Ogg files with ID3 tags.
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.
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.
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.
Reuben Thomas [Mon, 18 Feb 2008 12:42:43 +0000 (12:42 +0000)]
Comment out more weak magic.
Reuben Thomas [Mon, 18 Feb 2008 00:43:45 +0000 (00:43 +0000)]
Fix offset update for pstrings (Debian bug #466033)
Reuben Thomas [Mon, 18 Feb 2008 00:04:28 +0000 (00:04 +0000)]
Remove regex.
Reuben Thomas [Sun, 17 Feb 2008 23:40:48 +0000 (23:40 +0000)]
Fix typo in earlier fix
Reuben Thomas [Sun, 17 Feb 2008 19:58:01 +0000 (19:58 +0000)]
Replace a regex with a search pattern
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.
Reuben Thomas [Sun, 17 Feb 2008 19:26:15 +0000 (19:26 +0000)]
Clarify syntax
Reuben Thomas [Sun, 17 Feb 2008 19:22:47 +0000 (19:22 +0000)]
Replace a regex with a search
Reuben Thomas [Sun, 17 Feb 2008 19:21:34 +0000 (19:21 +0000)]
Spelling correction
Christos Zoulas [Fri, 15 Feb 2008 12:32:01 +0000 (12:32 +0000)]
ext4 detection from =?UTF-8?B?VG9tw6HFoQ==?= Smetana <tsmetana@redhat.com>
Christos Zoulas [Thu, 14 Feb 2008 20:22:20 +0000 (20:22 +0000)]
add mailing list info.
Christos Zoulas [Thu, 14 Feb 2008 20:22:05 +0000 (20:22 +0000)]
- use my astron address
- remove commented out done stuff
Christos Zoulas [Thu, 14 Feb 2008 20:17:59 +0000 (20:17 +0000)]
no processing for mime.
Reuben Thomas [Wed, 13 Feb 2008 01:13:14 +0000 (01:13 +0000)]
kBits to kbps; fixes Debian bug #400933
Reuben Thomas [Tue, 12 Feb 2008 17:35:26 +0000 (17:35 +0000)]
Fix from Jon Dowland (Debian bug #359301) to Doom magic.
Reuben Thomas [Tue, 12 Feb 2008 17:31:30 +0000 (17:31 +0000)]
Fix Ogg FLAC signature (Debian bug #347244).
Reuben Thomas [Tue, 12 Feb 2008 17:27:28 +0000 (17:27 +0000)]
Make MPEG sequence magic more precise so it's less strong than Windows
icon magic and won't unnecessarily match Windows icons. Fixes Debian
bug #299091.
Reuben Thomas [Tue, 12 Feb 2008 17:22:54 +0000 (17:22 +0000)]
Diagnose symlink loops. Fixes Debian bug #297775.
Reuben Thomas [Tue, 12 Feb 2008 16:30:48 +0000 (16:30 +0000)]
Add to-do.
Reuben Thomas [Tue, 12 Feb 2008 15:59:18 +0000 (15:59 +0000)]
Fix typo and markup in description of 'x' test.
Reuben Thomas [Tue, 12 Feb 2008 15:50:02 +0000 (15:50 +0000)]
Comment out too-weak binary magic
Reuben Thomas [Tue, 12 Feb 2008 15:48:04 +0000 (15:48 +0000)]
Fix Postscript version printing (Debian bug #129518)
Reuben Thomas [Tue, 12 Feb 2008 15:36:54 +0000 (15:36 +0000)]
Remove a regex
Reuben Thomas [Tue, 12 Feb 2008 15:28:39 +0000 (15:28 +0000)]
Fix change made yesterday to correctly update offset for both indirect
and non-indirect offsets.
Reuben Thomas [Tue, 12 Feb 2008 01:08:39 +0000 (01:08 +0000)]
Allow empty magic files
Reuben Thomas [Mon, 11 Feb 2008 23:40:42 +0000 (23:40 +0000)]
Extra magic from Albert Cahalan <acahalan@gmail.com> via Debian bug
#442819.
Reuben Thomas [Mon, 11 Feb 2008 23:26:17 +0000 (23:26 +0000)]
Clarify documentation of search and regex matches, and sync with
actual behaviour of program.
Reuben Thomas [Mon, 11 Feb 2008 23:20:51 +0000 (23:20 +0000)]
Fix Debian bug #407120 (Bug in relative use of search/regex), which is
caused by relative offsets not working properly.
Reuben Thomas [Mon, 11 Feb 2008 23:00:26 +0000 (23:00 +0000)]
Comment out lots of macintosh magic that plausibly matches text files.
Can be de-commented once we have text/binary split.
Reuben Thomas [Mon, 11 Feb 2008 22:18:08 +0000 (22:18 +0000)]
Fix Debian bugs #383498 (ODT detected as application/x-zip) and
#409231 (ODT not detected (non-MIME mode)).
Reuben Thomas [Mon, 11 Feb 2008 22:14:25 +0000 (22:14 +0000)]
Fix description of offset for regex/search types, as per actual
behaviour of file.
Reuben Thomas [Mon, 11 Feb 2008 22:12:24 +0000 (22:12 +0000)]
Add period (.) to allowable MIME type character list
Reuben Thomas [Mon, 11 Feb 2008 22:11:24 +0000 (22:11 +0000)]
Remove misleading, unnecessary comment.