]> granicus.if.org Git - file/log
file
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

16 years agoSpelling correction
Reuben Thomas [Sun, 17 Feb 2008 19:21:34 +0000 (19:21 +0000)]
Spelling correction

16 years agoext4 detection from =?UTF-8?B?VG9tw6HFoQ==?= Smetana <tsmetana@redhat.com>
Christos Zoulas [Fri, 15 Feb 2008 12:32:01 +0000 (12:32 +0000)]
ext4 detection from =?UTF-8?B?VG9tw6HFoQ==?= Smetana <tsmetana@redhat.com>

16 years agoadd mailing list info.
Christos Zoulas [Thu, 14 Feb 2008 20:22:20 +0000 (20:22 +0000)]
add mailing list info.

16 years ago- use my astron address
Christos Zoulas [Thu, 14 Feb 2008 20:22:05 +0000 (20:22 +0000)]
- use my astron address
- remove commented out done stuff

16 years agono processing for mime.
Christos Zoulas [Thu, 14 Feb 2008 20:17:59 +0000 (20:17 +0000)]
no processing for mime.

16 years agokBits to kbps; fixes Debian bug #400933
Reuben Thomas [Wed, 13 Feb 2008 01:13:14 +0000 (01:13 +0000)]
kBits to kbps; fixes Debian bug #400933

16 years agoFix from Jon Dowland (Debian bug #359301) to Doom magic.
Reuben Thomas [Tue, 12 Feb 2008 17:35:26 +0000 (17:35 +0000)]
Fix from Jon Dowland (Debian bug #359301) to Doom magic.

16 years agoFix Ogg FLAC signature (Debian bug #347244).
Reuben Thomas [Tue, 12 Feb 2008 17:31:30 +0000 (17:31 +0000)]
Fix Ogg FLAC signature (Debian bug #347244).

16 years agoMake MPEG sequence magic more precise so it's less strong than Windows
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.

16 years agoDiagnose symlink loops. Fixes Debian bug #297775.
Reuben Thomas [Tue, 12 Feb 2008 17:22:54 +0000 (17:22 +0000)]
Diagnose symlink loops. Fixes Debian bug #297775.

16 years agoAdd to-do.
Reuben Thomas [Tue, 12 Feb 2008 16:30:48 +0000 (16:30 +0000)]
Add to-do.

16 years agoFix typo and markup in description of 'x' test.
Reuben Thomas [Tue, 12 Feb 2008 15:59:18 +0000 (15:59 +0000)]
Fix typo and markup in description of 'x' test.

16 years agoComment out too-weak binary magic
Reuben Thomas [Tue, 12 Feb 2008 15:50:02 +0000 (15:50 +0000)]
Comment out too-weak binary magic

16 years agoFix Postscript version printing (Debian bug #129518)
Reuben Thomas [Tue, 12 Feb 2008 15:48:04 +0000 (15:48 +0000)]
Fix Postscript version printing (Debian bug #129518)

16 years agoRemove a regex
Reuben Thomas [Tue, 12 Feb 2008 15:36:54 +0000 (15:36 +0000)]
Remove a regex

16 years agoFix change made yesterday to correctly update offset for both indirect
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.

16 years agoAllow empty magic files
Reuben Thomas [Tue, 12 Feb 2008 01:08:39 +0000 (01:08 +0000)]
Allow empty magic files

16 years agoExtra magic from Albert Cahalan <acahalan@gmail.com> via Debian bug
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.

16 years agoClarify documentation of search and regex matches, and sync with
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.

16 years agoFix Debian bug #407120 (Bug in relative use of search/regex), which is
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.

16 years agoComment out lots of macintosh magic that plausibly matches text files.
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.

16 years agoFix Debian bugs #383498 (ODT detected as application/x-zip) and
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)).

16 years agoFix description of offset for regex/search types, as per actual
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.

16 years agoAdd period (.) to allowable MIME type character list
Reuben Thomas [Mon, 11 Feb 2008 22:12:24 +0000 (22:12 +0000)]
Add period (.) to allowable MIME type character list

16 years agoRemove misleading, unnecessary comment.
Reuben Thomas [Mon, 11 Feb 2008 22:11:24 +0000 (22:11 +0000)]
Remove misleading, unnecessary comment.

16 years agoAs we currently have regex support, rewrite this comment.
Reuben Thomas [Mon, 11 Feb 2008 21:36:24 +0000 (21:36 +0000)]
As we currently have regex support, rewrite this comment.

16 years agoFix an offset and some commented magic
Reuben Thomas [Mon, 11 Feb 2008 02:14:23 +0000 (02:14 +0000)]
Fix an offset and some commented magic

16 years agoDocument tonight's commits.
Reuben Thomas [Mon, 11 Feb 2008 01:37:11 +0000 (01:37 +0000)]
Document tonight's commits.

16 years agoMake not-equal 0 strength, not the same as =
Reuben Thomas [Mon, 11 Feb 2008 01:36:08 +0000 (01:36 +0000)]
Make not-equal 0 strength, not the same as =

16 years agoFix Debian bug #416842 (sign extension of low bits in quad patterns).
Reuben Thomas [Mon, 11 Feb 2008 01:02:11 +0000 (01:02 +0000)]
Fix Debian bug #416842 (sign extension of low bits in quad patterns).

16 years agoComment out too weak magic, fixing Debian bugs #209043 (MPEG I test
Reuben Thomas [Mon, 11 Feb 2008 00:38:19 +0000 (00:38 +0000)]
Comment out too weak magic, fixing Debian bugs #209043 (MPEG I test
catches UTF-16 BOM), #305337 (text identified as MPEG-4) and #348372
(text identified as Apple Partition data).

16 years agoComment out text types that are detected by internal magic (and should
Reuben Thomas [Mon, 11 Feb 2008 00:36:29 +0000 (00:36 +0000)]
Comment out text types that are detected by internal magic (and should
be left to it).

16 years agoFix Debian bug #303733 (HTML "DOCTYPE" vs "doctype") by making text
Reuben Thomas [Mon, 11 Feb 2008 00:35:27 +0000 (00:35 +0000)]
Fix Debian bug #303733 (HTML "DOCTYPE" vs "doctype") by making text
"DOCTYPE" case-insensitive, which is allowed.

16 years agoStop RTF message looking odd when unknown versions of RTF (!= 1)
Reuben Thomas [Mon, 11 Feb 2008 00:34:33 +0000 (00:34 +0000)]
Stop RTF message looking odd when unknown versions of RTF (!= 1)
found. Cope with missing encoding better too. Fixes Debian bug
#136534.

16 years agoImprove documentation of too-weak PPT magic (still commented out, though).
Reuben Thomas [Mon, 11 Feb 2008 00:33:15 +0000 (00:33 +0000)]
Improve documentation of too-weak PPT magic (still commented out, though).

16 years agoAdd MIME type for TeXMacs files, closing Debian bug #246780.
Reuben Thomas [Mon, 11 Feb 2008 00:32:02 +0000 (00:32 +0000)]
Add MIME type for TeXMacs files, closing Debian bug #246780.

16 years agoPrint contents of unsigned fields with %lu, not %d, to fix Debian bug
Reuben Thomas [Mon, 11 Feb 2008 00:31:22 +0000 (00:31 +0000)]
Print contents of unsigned fields with %lu, not %d, to fix Debian bug
#342334; however, for this bug to have shown up in the first place,
the numbers involved must have been enormous (with MS bit set), so
another bug is likely somewhere in the magic, the softmagic code, or
the file being checked may have been corrupt.

16 years agoAdd *.lineno
Reuben Thomas [Mon, 11 Feb 2008 00:25:46 +0000 (00:25 +0000)]
Add *.lineno

16 years agoClarify UTF-8 BOM message (Reuben Thomas)
Reuben Thomas [Mon, 11 Feb 2008 00:19:29 +0000 (00:19 +0000)]
Clarify UTF-8 BOM message (Reuben Thomas)

Add HTML comment to token list in names.h

16 years agofix ufs2 dump.
Christos Zoulas [Fri, 8 Feb 2008 13:54:13 +0000 (13:54 +0000)]
fix ufs2 dump.

16 years agoBOM UTF-8 improvements from rrt@
Christos Zoulas [Fri, 8 Feb 2008 13:31:19 +0000 (13:31 +0000)]
BOM UTF-8 improvements from rrt@

16 years agofix for libmagic.la from rrt@
Christos Zoulas [Fri, 8 Feb 2008 13:27:58 +0000 (13:27 +0000)]
fix for libmagic.la from rrt@

16 years agoforgot to commit this
Christos Zoulas [Fri, 8 Feb 2008 13:22:28 +0000 (13:22 +0000)]
forgot to commit this

16 years agonew configure.ac from rrt@
Christos Zoulas [Fri, 8 Feb 2008 13:19:56 +0000 (13:19 +0000)]
new configure.ac from rrt@

16 years agomore fixes from rrt@
Christos Zoulas [Fri, 8 Feb 2008 13:09:56 +0000 (13:09 +0000)]
more fixes from rrt@

16 years agodon't use c99 features
Christos Zoulas [Thu, 7 Feb 2008 03:10:20 +0000 (03:10 +0000)]
don't use c99 features

16 years agodetect the utf8 header and from debian bugid 345928. I cannot compile right
Christos Zoulas [Thu, 7 Feb 2008 03:05:02 +0000 (03:05 +0000)]
detect the utf8 header and from debian bugid 345928. I cannot compile right
now.

16 years agomore fixes from rrt@
Christos Zoulas [Thu, 7 Feb 2008 00:58:51 +0000 (00:58 +0000)]
more fixes from rrt@

16 years agoFrom: Antoine Brodin <antoine@FreeBSD.org> dumpv2
Christos Zoulas [Wed, 6 Feb 2008 20:46:48 +0000 (20:46 +0000)]
From: Antoine Brodin <antoine@FreeBSD.org> dumpv2

16 years agomore build fixes:
Christos Zoulas [Tue, 5 Feb 2008 19:53:16 +0000 (19:53 +0000)]
more build fixes:
- add missing files to .cvsignore [rrt@]
- kill zoulas.com -> astron.com
- remove configure

16 years agoupdate the build system per rrt@
Christos Zoulas [Tue, 5 Feb 2008 19:08:11 +0000 (19:08 +0000)]
update the build system per rrt@

16 years agospell mime correctly.
Christos Zoulas [Tue, 5 Feb 2008 13:59:03 +0000 (13:59 +0000)]
spell mime correctly.

16 years agoFixes from rrt@
Christos Zoulas [Tue, 5 Feb 2008 01:59:08 +0000 (01:59 +0000)]
Fixes from rrt@

16 years agofixes from rrt@; retain .In
Christos Zoulas [Tue, 5 Feb 2008 01:58:43 +0000 (01:58 +0000)]
fixes from rrt@; retain .In

16 years agoDebian Fixes via rrt@
Christos Zoulas [Mon, 4 Feb 2008 20:51:16 +0000 (20:51 +0000)]
Debian Fixes via rrt@

16 years agowe don't open .mime anything anymore.
Christos Zoulas [Mon, 4 Feb 2008 19:11:03 +0000 (19:11 +0000)]
we don't open .mime anything anymore.

16 years agodocument !mime: entries from rrt@
Christos Zoulas [Mon, 4 Feb 2008 18:49:43 +0000 (18:49 +0000)]
document !mime: entries from rrt@

16 years agofix bogus mimed lines from rrt@
Christos Zoulas [Mon, 4 Feb 2008 16:42:38 +0000 (16:42 +0000)]
fix bogus mimed lines from rrt@

16 years agoremove unneeded files
Christos Zoulas [Mon, 4 Feb 2008 16:34:55 +0000 (16:34 +0000)]
remove unneeded files

16 years agomagic merge from rrt@
Christos Zoulas [Mon, 4 Feb 2008 16:33:44 +0000 (16:33 +0000)]
magic merge from rrt@

16 years agoimprove the sentence
Christos Zoulas [Mon, 4 Feb 2008 01:40:53 +0000 (01:40 +0000)]
improve the sentence