SHA256
1
0
forked from pool/file
Dr. Werner Fink 2016-04-18 13:32:24 +00:00 committed by Git OBS Bridge
parent cdd247fd26
commit 22277e3619
21 changed files with 245 additions and 271 deletions

View File

@ -1,92 +0,0 @@
--- magic/Magdir/elf
+++ magic/Magdir/elf 2008-04-14 16:57:32.740393508 +0200
@@ -51,26 +51,26 @@
>>18 leshort 8
# only for 32-bit
>>>4 byte 1
->>>>36 lelong&0xf0000000 0x00000000 MIPS-I
->>>>36 lelong&0xf0000000 0x10000000 MIPS-II
->>>>36 lelong&0xf0000000 0x20000000 MIPS-III
->>>>36 lelong&0xf0000000 0x30000000 MIPS-IV
->>>>36 lelong&0xf0000000 0x40000000 MIPS-V
->>>>36 lelong&0xf0000000 0x50000000 MIPS32
->>>>36 lelong&0xf0000000 0x60000000 MIPS64
->>>>36 lelong&0xf0000000 0x70000000 MIPS32 rel2
->>>>36 lelong&0xf0000000 0x80000000 MIPS64 rel2
+#>>>>36 lelong&0xf0000000 0x00000000 MIPS-I
+#>>>>36 lelong&0xf0000000 0x10000000 MIPS-II
+#>>>>36 lelong&0xf0000000 0x20000000 MIPS-III
+#>>>>36 lelong&0xf0000000 0x30000000 MIPS-IV
+#>>>>36 lelong&0xf0000000 0x40000000 MIPS-V
+#>>>>36 lelong&0xf0000000 0x50000000 MIPS32
+#>>>>36 lelong&0xf0000000 0x60000000 MIPS64
+#>>>>36 lelong&0xf0000000 0x70000000 MIPS32 rel2
+#>>>>36 lelong&0xf0000000 0x80000000 MIPS64 rel2
# only for 64-bit
>>>4 byte 2
->>>>48 lelong&0xf0000000 0x00000000 MIPS-I
->>>>48 lelong&0xf0000000 0x10000000 MIPS-II
->>>>48 lelong&0xf0000000 0x20000000 MIPS-III
->>>>48 lelong&0xf0000000 0x30000000 MIPS-IV
->>>>48 lelong&0xf0000000 0x40000000 MIPS-V
->>>>48 lelong&0xf0000000 0x50000000 MIPS32
->>>>48 lelong&0xf0000000 0x60000000 MIPS64
->>>>48 lelong&0xf0000000 0x70000000 MIPS32 rel2
->>>>48 lelong&0xf0000000 0x80000000 MIPS64 rel2
+#>>>>48 lelong&0xf0000000 0x00000000 MIPS-I
+#>>>>48 lelong&0xf0000000 0x10000000 MIPS-II
+#>>>>48 lelong&0xf0000000 0x20000000 MIPS-III
+#>>>>48 lelong&0xf0000000 0x30000000 MIPS-IV
+#>>>>48 lelong&0xf0000000 0x40000000 MIPS-V
+#>>>>48 lelong&0xf0000000 0x50000000 MIPS32
+#>>>>48 lelong&0xf0000000 0x60000000 MIPS64
+#>>>>48 lelong&0xf0000000 0x70000000 MIPS32 rel2
+#>>>>48 lelong&0xf0000000 0x80000000 MIPS64 rel2
>>18 leshort 9 Amdahl - invalid byte order,
>>18 leshort 10 MIPS (deprecated),
>>18 leshort 11 RS6000 - invalid byte order,
@@ -181,26 +181,26 @@
>>18 beshort 8
# only for 32-bit
>>>4 byte 1
->>>>36 belong&0xf0000000 0x00000000 MIPS-I
->>>>36 belong&0xf0000000 0x10000000 MIPS-II
->>>>36 belong&0xf0000000 0x20000000 MIPS-III
->>>>36 belong&0xf0000000 0x30000000 MIPS-IV
->>>>36 belong&0xf0000000 0x40000000 MIPS-V
->>>>36 belong&0xf0000000 0x50000000 MIPS32
->>>>36 belong&0xf0000000 0x60000000 MIPS64
->>>>36 belong&0xf0000000 0x70000000 MIPS32 rel2
->>>>36 belong&0xf0000000 0x80000000 MIPS64 rel2
+#>>>>36 belong&0xf0000000 0x00000000 MIPS-I
+#>>>>36 belong&0xf0000000 0x10000000 MIPS-II
+#>>>>36 belong&0xf0000000 0x20000000 MIPS-III
+#>>>>36 belong&0xf0000000 0x30000000 MIPS-IV
+#>>>>36 belong&0xf0000000 0x40000000 MIPS-V
+#>>>>36 belong&0xf0000000 0x50000000 MIPS32
+#>>>>36 belong&0xf0000000 0x60000000 MIPS64
+#>>>>36 belong&0xf0000000 0x70000000 MIPS32 rel2
+#>>>>36 belong&0xf0000000 0x80000000 MIPS64 rel2
# only for 64-bit
>>>4 byte 2
->>>>48 belong&0xf0000000 0x00000000 MIPS-I
->>>>48 belong&0xf0000000 0x10000000 MIPS-II
->>>>48 belong&0xf0000000 0x20000000 MIPS-III
->>>>48 belong&0xf0000000 0x30000000 MIPS-IV
->>>>48 belong&0xf0000000 0x40000000 MIPS-V
->>>>48 belong&0xf0000000 0x50000000 MIPS32
->>>>48 belong&0xf0000000 0x60000000 MIPS64
->>>>48 belong&0xf0000000 0x70000000 MIPS32 rel2
->>>>48 belong&0xf0000000 0x80000000 MIPS64 rel2
+#>>>>48 belong&0xf0000000 0x00000000 MIPS-I
+#>>>>48 belong&0xf0000000 0x10000000 MIPS-II
+#>>>>48 belong&0xf0000000 0x20000000 MIPS-III
+#>>>>48 belong&0xf0000000 0x30000000 MIPS-IV
+#>>>>48 belong&0xf0000000 0x40000000 MIPS-V
+#>>>>48 belong&0xf0000000 0x50000000 MIPS32
+#>>>>48 belong&0xf0000000 0x60000000 MIPS64
+#>>>>48 belong&0xf0000000 0x70000000 MIPS32 rel2
+#>>>>48 belong&0xf0000000 0x80000000 MIPS64 rel2
>>18 beshort 9 Amdahl,
>>18 beshort 10 MIPS (deprecated),
>>18 beshort 11 RS6000,

View File

@ -1,22 +1,32 @@
---
magic/Magdir/archive | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
--- magic/Magdir/archive
+++ magic/Magdir/archive 2013-09-30 00:00:00.000000000 +0000
@@ -589,6 +589,19 @@
# Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
0 string PK\005\006 Zip archive data (empty)
+++ magic/Magdir/archive 2016-04-18 11:37:48.369637727 +0000
@@ -776,6 +776,25 @@
!:mime application/zip
!:ext zip/cbz
0 string PK\003\004
+>30 ubelong !0x6d696d65
+>>4 byte 0x00 Zip archive data
+!:mime application/zip
+!:ext zip/cbz
+>>4 byte 0x09 Zip archive data, at least v0.9 to extract
+!:mime application/zip
+!:ext zip/cbz
+>>4 byte 0x0a Zip archive data, at least v1.0 to extract
+!:mime application/zip
+!:ext zip/cbz
+>>4 byte 0x0b Zip archive data, at least v1.1 to extract
+!:mime application/zip
+!:ext zip/cbz
+>>0x161 string WINZIP Zip archive data, WinZIP self-extracting
+!:mime application/zip
+!:ext zip/cbz
+>>4 byte 0x14 Zip archive data, at least v2.0 to extract
+!:mime application/zip
+!:ext zip/cbz
# Specialised zip formats which start with a member named 'mimetype'
# (stored uncompressed, with no 'extra field') containing the file's MIME type.

View File

@ -1,6 +1,13 @@
---
src/apprentice.c | 6 +++---
src/compress.c | 2 +-
src/file.c | 2 +-
src/magic.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
--- src/apprentice.c
+++ src/apprentice.c 2013-09-30 00:00:00.000000000 +0000
@@ -944,7 +944,7 @@ load_1(struct magic_set *ms, int action,
+++ src/apprentice.c 2016-04-18 11:41:01.798059916 +0000
@@ -1106,7 +1106,7 @@ load_1(struct magic_set *ms, int action,
ssize_t len;
struct magic_entry me;
@ -9,7 +16,7 @@
if (f == NULL) {
if (errno != ENOENT)
file_error(ms, errno, "cannot read magic file `%s'",
@@ -2605,7 +2605,7 @@ apprentice_map(struct magic_set *ms, con
@@ -2950,7 +2950,7 @@ apprentice_map(struct magic_set *ms, con
if (dbname == NULL)
goto error;
@ -18,7 +25,7 @@
goto error;
if (fstat(fd, &st) == -1) {
@@ -2717,7 +2717,7 @@ apprentice_compile(struct magic_set *ms,
@@ -3085,7 +3085,7 @@ apprentice_compile(struct magic_set *ms,
if (dbname == NULL)
goto out;
@ -28,8 +35,8 @@
file_error(ms, errno, "cannot open `%s'", dbname);
goto out;
--- src/compress.c
+++ src/compress.c 2013-09-30 00:00:00.000000000 +0000
@@ -250,7 +250,7 @@ file_pipe2file(struct magic_set *ms, int
+++ src/compress.c 2016-04-18 11:41:01.798059916 +0000
@@ -382,7 +382,7 @@ file_pipe2file(struct magic_set *ms, int
#else
{
int te;
@ -39,8 +46,8 @@
(void)unlink(buf);
errno = te;
--- src/file.c
+++ src/file.c 2013-09-30 00:00:00.000000000 +0000
@@ -390,7 +390,7 @@ unwrap(struct magic_set *ms, const char
+++ src/file.c 2016-04-18 11:41:01.798059916 +0000
@@ -465,7 +465,7 @@ unwrap(struct magic_set *ms, const char
f = stdin;
wid = 1;
} else {
@ -50,8 +57,8 @@
progname, fn, strerror(errno));
return 1;
--- src/magic.c
+++ src/magic.c 2013-12-02 10:36:33.334786103 +0000
@@ -372,7 +372,7 @@ file_or_fd(struct magic_set *ms, const c
+++ src/magic.c 2016-04-18 11:41:01.798059916 +0000
@@ -442,7 +442,7 @@ file_or_fd(struct magic_set *ms, const c
else
pos = lseek(fd, (off_t)0, SEEK_CUR);
} else {

View File

@ -1,6 +1,10 @@
---
src/apprentice.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- src/apprentice.c
+++ src/apprentice.c 2014-06-24 16:33:48.770235732 +0000
@@ -2173,8 +2173,16 @@ check_format_type(const char *ptr, int t
+++ src/apprentice.c 2016-04-18 11:33:37.966264194 +0000
@@ -2350,8 +2350,16 @@ check_format_type(const char *ptr, int t
}
} else
h = 0;
@ -16,4 +20,4 @@
+ ptr++;
if (*ptr == '.')
ptr++;
while (isdigit((unsigned char)*ptr)) ptr++;
#define CHECKLEN() do { \

View File

@ -1,13 +1,18 @@
---
magic/Magdir/archive | 5 +++++
1 file changed, 5 insertions(+)
--- magic/Magdir/archive
+++ magic/Magdir/archive 2014-06-25 08:56:37.758234870 +0000
@@ -586,6 +586,10 @@
# PKZIP multi-volume archive
+++ magic/Magdir/archive 2016-04-18 11:39:51.791354756 +0000
@@ -770,6 +770,11 @@
0 string PK\x07\x08PK\x03\x04 Zip multi-volume archive data, at least PKZIP v2.50 to extract
!:mime application/zip
!:ext zip/cbz
+>30 ubelong 0x6d696d65 Zip archive data, at least v2.0 to extract
+>>34 ubelong 0x74797065 \b, mime type
+>>>38 regex application/[a-z+-]+ \b %s
+!:mime application/unknown+zip
+!:ext zip/cbz
# Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
0 string PK\005\006 Zip archive data (empty)

View File

@ -3,8 +3,8 @@
1 file changed, 4 insertions(+), 2 deletions(-)
--- src/readelf.c
+++ src/readelf.c 2015-01-19 10:25:08.749519408 +0000
@@ -706,7 +706,7 @@ do_core_note(struct magic_set *ms, unsig
+++ src/readelf.c 2016-04-18 11:25:34.395199288 +0000
@@ -728,7 +728,7 @@ do_core_note(struct magic_set *ms, unsig
default:
if (type == NT_PRPSINFO && *flags & FLAGS_IS_CORE) {
@ -13,7 +13,7 @@
unsigned char c;
/*
* Extract the program name. We assume
@@ -718,7 +718,9 @@ do_core_note(struct magic_set *ms, unsig
@@ -740,7 +740,9 @@ do_core_note(struct magic_set *ms, unsig
* If the characters aren't all printable,
* reject it.
*/

View File

@ -4,7 +4,7 @@
2 files changed, 10 insertions(+), 114 deletions(-)
--- src/apprentice.c
+++ src/apprentice.c 2014-10-13 11:02:16.000000000 +0000
+++ src/apprentice.c 2016-04-18 11:44:13.254519084 +0000
@@ -54,6 +54,7 @@ FILE_RCSID("@(#)$File: apprentice.c,v 1.
#if defined(HAVE_LIMITS_H)
#include <limits.h>
@ -28,7 +28,7 @@
private char *mkdbname(struct magic_set *, const char *, int);
private struct magic_map *apprentice_buf(struct magic_set *, struct magic *,
size_t);
@@ -3119,67 +3122,6 @@ byteswap(struct magic *magic, uint32_t n
@@ -3175,67 +3178,6 @@ byteswap(struct magic *magic, uint32_t n
}
/*
@ -97,7 +97,7 @@
*/
private void
--- src/cdf.c
+++ src/cdf.c 2015-06-11 15:12:51.017518448 +0000
+++ src/cdf.c 2016-04-18 11:44:13.254519084 +0000
@@ -50,6 +50,7 @@ FILE_RCSID("@(#)$File: cdf.c,v 1.76 2015
#ifdef HAVE_LIMITS_H
#include <limits.h>

View File

@ -4,13 +4,13 @@
2 files changed, 10 insertions(+), 2 deletions(-)
--- src/file.c
+++ src/file.c 2015-07-14 11:45:26.449520700 +0000
+++ src/file.c 2016-04-18 12:12:46.470850980 +0000
@@ -96,10 +96,12 @@ private const struct option long_options
#define OPT_MIME_ENCODING 5
#define OPT(shortname, longname, opt, doc) \
#define OPT(shortname, longname, opt, def, doc) \
{longname, opt, NULL, shortname},
+#define OPT_POSIX OPT
#define OPT_LONGONLY(longname, opt, doc, id) \
#define OPT_LONGONLY(longname, opt, def, doc, id) \
{longname, opt, NULL, id},
#include "file_opts.h"
#undef OPT
@ -18,7 +18,7 @@
#undef OPT_LONGONLY
{0, 0, NULL, 0}
};
@@ -595,6 +597,7 @@ docprint(const char *opts)
@@ -615,6 +617,7 @@ docprint(const char *opts, int def)
private void
help(void)
{
@ -26,17 +26,17 @@
(void)fputs(
"Usage: file [OPTION...] [FILE...]\n"
"Determine type of FILEs.\n"
@@ -602,11 +605,16 @@ help(void)
#define OPT(shortname, longname, opt, doc) \
@@ -622,11 +625,16 @@ help(void)
#define OPT(shortname, longname, opt, def, doc) \
fprintf(stdout, " -%c, --" longname, shortname), \
docprint(doc);
+#define OPT_POSIX(shortname, longname, opt, doc) \
docprint(doc, def);
+#define OPT_POSIX(shortname, longname, opt, def, doc) \
+ fprintf(stdout, " -%c, --" longname "%s", shortname, \
+ (shortname == 'L') ? (posix ? " (default)" : "") : (posix ? "" : " (default)")), \
+ docprint(doc);
#define OPT_LONGONLY(longname, opt, doc, id) \
+ docprint(doc, def);
#define OPT_LONGONLY(longname, opt, def, doc, id) \
fprintf(stdout, " --" longname), \
docprint(doc);
docprint(doc, def);
#include "file_opts.h"
#undef OPT
+#undef OPT_POSIX
@ -44,15 +44,15 @@
fprintf(stdout, "\nReport bugs to http://bugs.gw.com/\n");
exit(0);
--- src/file_opts.h
+++ src/file_opts.h 2013-09-30 13:44:17.000000000 +0000
@@ -36,8 +36,8 @@ OPT_LONGONLY("mime-encoding", 0, "
OPT('k', "keep-going", 0, " don't stop at the first match\n")
OPT('l', "list", 0, " list magic strength\n")
+++ src/file_opts.h 2016-04-18 12:11:21.024431447 +0000
@@ -36,8 +36,8 @@ OPT_LONGONLY("mime-encoding", 0, 0, "
OPT('k', "keep-going", 0, 0, " don't stop at the first match\n")
OPT('l', "list", 0, 0, " list magic strength\n")
#ifdef S_IFLNK
-OPT('L', "dereference", 0, " follow symlinks (default)\n")
-OPT('h', "no-dereference", 0, " don't follow symlinks\n")
+OPT_POSIX('L', "dereference", 0, " follow symlinks\n")
+OPT_POSIX('h', "no-dereference", 0, " don't follow symlinks\n")
-OPT('L', "dereference", 0, 1, " follow symlinks")
-OPT('h', "no-dereference", 0, 2, " don't follow symlinks")
+OPT_POSIX('L', "dereference", 0, 0, " follow symlinks")
+OPT_POSIX('h', "no-dereference", 0, 0, " don't follow symlinks")
#endif
OPT('n', "no-buffer", 0, " do not buffer output\n")
OPT('N', "no-pad", 0, " do not pad output\n")
OPT('n', "no-buffer", 0, 0, " do not buffer output\n")
OPT('N', "no-pad", 0, 0, " do not pad output\n")

View File

@ -1,68 +0,0 @@
From f0adf3e6811aafde00dba8ba236609869a973769 Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Thu, 29 Oct 2015 19:23:42 +0000
Subject: [PATCH] PR/489: Avoid evaluating things twice.
---
python/magic.py | 35 +++++++++++++++++++----------------
1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/python/magic.py b/python/magic.py
index a17e8da..2c1c012 100644
--- a/python/magic.py
+++ b/python/magic.py
@@ -118,14 +118,15 @@ def file(self, filename):
as a filename or None if an error occurred and the MAGIC_ERROR flag
is set. A call to errno() will return the numeric error code.
"""
- try: # attempt python3 approach first
- if isinstance(filename, bytes):
- bi = filename
- else:
- bi = bytes(filename, 'utf-8')
- return str(_file(self._magic_t, bi), 'utf-8')
- except:
- return _file(self._magic_t, filename.encode('utf-8'))
+ if isinstance(filename, bytes):
+ bi = filename
+ else:
+ bi = bytes(filename, 'utf-8')
+ r = _file(self._magic_t, bi)
+ if isinstance(r, str):
+ return r
+ else:
+ return str(r, 'utf-8')
def descriptor(self, fd):
"""
@@ -139,20 +140,22 @@ def buffer(self, buf):
as a buffer or None if an error occurred and the MAGIC_ERROR flag
is set. A call to errno() will return the numeric error code.
"""
- try: # attempt python3 approach first
- return str(_buffer(self._magic_t, buf, len(buf)), 'utf-8')
- except:
- return _buffer(self._magic_t, buf, len(buf))
+ r = _buffer(self._magic_t, buf, len(buf))
+ if isinstance(r, str):
+ return r
+ else:
+ return str(r, 'utf-8')
def error(self):
"""
Returns a textual explanation of the last error or None
if there was no error.
"""
- try: # attempt python3 approach first
- return str(_error(self._magic_t), 'utf-8')
- except:
- return _error(self._magic_t)
+ e = _error(self._magic_t)
+ if isinstance(e, str):
+ return e
+ else:
+ return str(e, 'utf-8')
def setflags(self, flags):
"""

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3735381563f69fb4239470b8c51b876a80425348b8285a7cded8b61d6b890eca
size 739485

55
file-5.26-version.patch Normal file
View File

@ -0,0 +1,55 @@
On Apr 17, 12:37pm, Jens.Schleusener@t-online.de ("Schleusener, Jens") wrote:
-- Subject: Re: file 5.26 is now available
| Hi Christos,
|
| > File 5.26 is now available from:
| >
| > ftp://ftp.astron.com/pub/file/file-5.26.tar.gz
|
| I just compiled and installed the new version but found that "file" has at
| least now problems with PHP files.
|
| Calling "file" for e.g. for the file wordpress/wp-admin/about.php of
| the tarball wordpress-4.5.tar.gz I got the following results:
|
| file 5.26: , version .
|
| file 5.25: PHP script, ASCII text, with very long lines
|
| Checking other PHP files (also from other packages) I got mostly similar
| results. In very rare cases "file 5.26" issues correctly as before "PHP
| script, ASCII text", in some rare other cases incorrectly "C++ source,
| ASCII text" instead of the correct "PHP script, ASCII text".
|
| No idea if I did something wrong or it's a bug.
|
| Regards
|
| Jens
|
| P.S.: Just for info: The above mentioned "arbitrary" file is directly
| available for e.g. under
|
| http://fossies.org/linux/www/wordpress-4.5.tar.gz/wordpress/wp-admin/about.php?m=b
Unfortunately some new magic is problematic; here's a patch.
christo
Index: commands
===================================================================
RCS file: /p/file/cvsroot/file/magic/Magdir/commands,v
retrieving revision 1.53
diff -u -u -r1.53 commands
--- file-5.26/magic/Magdir/commands 23 Feb 2016 12:35:20 -0000 1.53
+++ file-5.26/magic/Magdir/commands 17 Apr 2016 13:51:29 -0000
@@ -101,7 +101,7 @@
0 string =<?php
>5 regex [\ \n]
>>6 string /*\ Smarty\ version Smarty compiled template
->24 regex [0-9.]+ \b, version %s
+>>>24 regex [0-9.]+ \b, version %s
!:mime text/x-php
0 string Zend\x00 PHP script Zend Optimizer data

View File

@ -7,10 +7,11 @@
magic/Makefile.in | 60 +++++++++------
src/Makefile.am | 2
src/dcore.c | 207 +++++++++++++++++++++++++++++++++++++++++++++++++++++
8 files changed, 311 insertions(+), 66 deletions(-)
src/magic.h.in | 1
9 files changed, 312 insertions(+), 66 deletions(-)
--- magic/Magdir/elf
+++ magic/Magdir/elf 2013-09-30 00:00:00.000000000 +0000
+++ magic/Magdir/elf 2016-04-18 11:59:52.349157805 +0000
@@ -128,7 +128,7 @@
>18 leshort 47 Renesas H8/300H,
>18 leshort 48 Renesas H8S,
@ -21,7 +22,7 @@
>18 leshort 52 Motorola Coldfire,
>18 leshort 53 Motorola M68HC12,
--- magic/Magdir/linux
+++ magic/Magdir/linux 2013-12-02 11:09:39.000000000 +0000
+++ magic/Magdir/linux 2016-04-18 11:59:52.349157805 +0000
@@ -101,23 +101,27 @@
# and Nicolas Lichtmaier <nick@debian.org>
# All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
@ -67,7 +68,7 @@
0 belong 0xb8c0078e Linux kernel
>0x1e3 string Loading version 1.3.79 or older
--- magic/Magdir/msad
+++ magic/Magdir/msad 2013-09-30 00:00:00.000000000 +0000
+++ magic/Magdir/msad 2016-04-18 11:59:52.349157805 +0000
@@ -0,0 +1,5 @@
+#------------------------------------------------------------------------------
+# msad: file(1) magic for msad
@ -75,8 +76,8 @@
+# This must precede the heuristic for raw G3 data
+4 string Standard\ Jet\ DB Microsoft Access Database
--- magic/Magdir/msdos
+++ magic/Magdir/msdos 2013-09-30 00:00:00.000000000 +0000
@@ -100,9 +100,9 @@
+++ magic/Magdir/msdos 2016-04-18 11:59:52.349157805 +0000
@@ -104,9 +104,9 @@
>>>(0x3c.l+22) leshort&0x0200 >0 (stripped to external PDB)
>>>(0x3c.l+22) leshort&0x1000 >0 system file
>>>(0x3c.l+24) leshort 0x010b
@ -89,7 +90,7 @@
# hooray, there's a DOS extender using the PE format, with a valid PE
# executable inside (which just prints a message and exits if run in win)
--- magic/Makefile.am
+++ magic/Makefile.am 2015-01-19 10:35:17.000000000 +0000
+++ magic/Makefile.am 2016-04-18 12:02:09.262627467 +0000
@@ -5,7 +5,7 @@ MAGIC_FRAGMENT_BASE = Magdir
MAGIC_DIR = $(top_srcdir)/magic
MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE)
@ -107,15 +108,15 @@
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/archive \
$(MAGIC_FRAGMENT_DIR)/assembler \
@@ -77,7 +76,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
@@ -80,7 +79,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
$(MAGIC_FRAGMENT_DIR)/erlang \
$(MAGIC_FRAGMENT_DIR)/esri \
$(MAGIC_FRAGMENT_DIR)/fcs \
-$(MAGIC_FRAGMENT_DIR)/filesystems \
$(MAGIC_FRAGMENT_DIR)/finger \
$(MAGIC_FRAGMENT_DIR)/flash \
$(MAGIC_FRAGMENT_DIR)/fonts \
$(MAGIC_FRAGMENT_DIR)/fortran \
@@ -115,6 +113,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
$(MAGIC_FRAGMENT_DIR)/flif \
@@ -120,6 +118,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
$(MAGIC_FRAGMENT_DIR)/java \
$(MAGIC_FRAGMENT_DIR)/javascript \
$(MAGIC_FRAGMENT_DIR)/jpeg \
@ -124,7 +125,7 @@
$(MAGIC_FRAGMENT_DIR)/karma \
$(MAGIC_FRAGMENT_DIR)/kde \
$(MAGIC_FRAGMENT_DIR)/keepass \
@@ -123,7 +123,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
@@ -128,7 +128,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
$(MAGIC_FRAGMENT_DIR)/lecter \
$(MAGIC_FRAGMENT_DIR)/lex \
$(MAGIC_FRAGMENT_DIR)/lif \
@ -132,7 +133,7 @@
$(MAGIC_FRAGMENT_DIR)/lisp \
$(MAGIC_FRAGMENT_DIR)/llvm \
$(MAGIC_FRAGMENT_DIR)/lua \
@@ -131,7 +130,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
@@ -136,7 +135,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
$(MAGIC_FRAGMENT_DIR)/m4 \
$(MAGIC_FRAGMENT_DIR)/mach \
$(MAGIC_FRAGMENT_DIR)/macos \
@ -140,7 +141,7 @@
$(MAGIC_FRAGMENT_DIR)/magic \
$(MAGIC_FRAGMENT_DIR)/mail.news \
$(MAGIC_FRAGMENT_DIR)/make \
@@ -152,10 +150,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
@@ -158,10 +156,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
$(MAGIC_FRAGMENT_DIR)/mkid \
$(MAGIC_FRAGMENT_DIR)/mlssa \
$(MAGIC_FRAGMENT_DIR)/mmdf \
@ -152,7 +153,7 @@
$(MAGIC_FRAGMENT_DIR)/msooxml \
$(MAGIC_FRAGMENT_DIR)/msx \
$(MAGIC_FRAGMENT_DIR)/msvc \
@@ -203,6 +201,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
@@ -210,6 +208,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
$(MAGIC_FRAGMENT_DIR)/qt \
$(MAGIC_FRAGMENT_DIR)/revision \
$(MAGIC_FRAGMENT_DIR)/riff \
@ -161,7 +162,7 @@
$(MAGIC_FRAGMENT_DIR)/rpm \
$(MAGIC_FRAGMENT_DIR)/rtf \
$(MAGIC_FRAGMENT_DIR)/ruby \
@@ -272,8 +272,20 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
@@ -280,8 +280,20 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
$(MAGIC_FRAGMENT_DIR)/zilog \
$(MAGIC_FRAGMENT_DIR)/zyxel
@ -183,7 +184,7 @@
# FIXME: Build file natively as well so that it can be used to compile
# the target's magic file; for now we bail if the local version does not match
@@ -285,19 +297,22 @@ FILE_COMPILE = $(top_builddir)/src/file$
@@ -293,19 +305,22 @@ FILE_COMPILE = $(top_builddir)/src/file$
FILE_COMPILE_DEP = $(FILE_COMPILE)
endif
@ -193,7 +194,7 @@
- @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \
- echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \
- else \
- v=$$(file --version | sed -e s/file-// -e q); \
- v=$$(${FILE_COMPILE} --version | sed -e s/file-// -e q); \
- if [ "$$v" != "${PACKAGE_VERSION}" ]; then \
- echo "Cannot use the installed version of file ($$v) to"; \
- echo "cross-compile file ${PACKAGE_VERSION}"; \
@ -212,7 +213,7 @@
+# @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \
+# echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \
+# else \
+# v=$$(file --version | sed -e s/file-// -e q); \
+# v=$$(${FILE_COMPILE} --version | sed -e s/file-// -e q); \
+# if [ "$$v" != "${PACKAGE_VERSION}" ]; then \
+# echo "Cannot use the installed version of file ($$v) to"; \
+# echo "cross-compile file ${PACKAGE_VERSION}"; \
@ -223,7 +224,7 @@
+# $(FILE_COMPILE) -C -m magic
+# @rm -fr magic
--- magic/Makefile.in
+++ magic/Makefile.in 2015-06-11 15:26:03.753518322 +0000
+++ magic/Makefile.in 2016-04-18 12:03:07.113558364 +0000
@@ -278,7 +278,7 @@ top_srcdir = @top_srcdir@
MAGIC_FRAGMENT_BASE = Magdir
MAGIC_DIR = $(top_srcdir)/magic
@ -241,15 +242,15 @@
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/archive \
$(MAGIC_FRAGMENT_DIR)/assembler \
@@ -349,7 +348,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
@@ -352,7 +351,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
$(MAGIC_FRAGMENT_DIR)/erlang \
$(MAGIC_FRAGMENT_DIR)/esri \
$(MAGIC_FRAGMENT_DIR)/fcs \
-$(MAGIC_FRAGMENT_DIR)/filesystems \
$(MAGIC_FRAGMENT_DIR)/finger \
$(MAGIC_FRAGMENT_DIR)/flash \
$(MAGIC_FRAGMENT_DIR)/fonts \
$(MAGIC_FRAGMENT_DIR)/fortran \
@@ -387,6 +385,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
$(MAGIC_FRAGMENT_DIR)/flif \
@@ -392,6 +390,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
$(MAGIC_FRAGMENT_DIR)/java \
$(MAGIC_FRAGMENT_DIR)/javascript \
$(MAGIC_FRAGMENT_DIR)/jpeg \
@ -258,7 +259,7 @@
$(MAGIC_FRAGMENT_DIR)/karma \
$(MAGIC_FRAGMENT_DIR)/kde \
$(MAGIC_FRAGMENT_DIR)/keepass \
@@ -395,7 +395,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
@@ -400,7 +400,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
$(MAGIC_FRAGMENT_DIR)/lecter \
$(MAGIC_FRAGMENT_DIR)/lex \
$(MAGIC_FRAGMENT_DIR)/lif \
@ -266,7 +267,7 @@
$(MAGIC_FRAGMENT_DIR)/lisp \
$(MAGIC_FRAGMENT_DIR)/llvm \
$(MAGIC_FRAGMENT_DIR)/lua \
@@ -403,7 +402,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
@@ -408,7 +407,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
$(MAGIC_FRAGMENT_DIR)/m4 \
$(MAGIC_FRAGMENT_DIR)/mach \
$(MAGIC_FRAGMENT_DIR)/macos \
@ -274,7 +275,7 @@
$(MAGIC_FRAGMENT_DIR)/magic \
$(MAGIC_FRAGMENT_DIR)/mail.news \
$(MAGIC_FRAGMENT_DIR)/make \
@@ -424,10 +422,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
@@ -430,10 +428,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
$(MAGIC_FRAGMENT_DIR)/mkid \
$(MAGIC_FRAGMENT_DIR)/mlssa \
$(MAGIC_FRAGMENT_DIR)/mmdf \
@ -286,7 +287,7 @@
$(MAGIC_FRAGMENT_DIR)/msooxml \
$(MAGIC_FRAGMENT_DIR)/msx \
$(MAGIC_FRAGMENT_DIR)/msvc \
@@ -475,6 +473,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
@@ -482,6 +480,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
$(MAGIC_FRAGMENT_DIR)/qt \
$(MAGIC_FRAGMENT_DIR)/revision \
$(MAGIC_FRAGMENT_DIR)/riff \
@ -295,7 +296,7 @@
$(MAGIC_FRAGMENT_DIR)/rpm \
$(MAGIC_FRAGMENT_DIR)/rtf \
$(MAGIC_FRAGMENT_DIR)/ruby \
@@ -544,10 +544,22 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
@@ -552,10 +552,22 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
$(MAGIC_FRAGMENT_DIR)/zilog \
$(MAGIC_FRAGMENT_DIR)/zyxel
@ -319,7 +320,7 @@
# FIXME: Build file natively as well so that it can be used to compile
# the target's magic file; for now we bail if the local version does not match
@IS_CROSS_COMPILE_TRUE@FILE_COMPILE = file${EXEEXT}
@@ -769,23 +781,25 @@ uninstall-am: uninstall-pkgdataDATA
@@ -777,23 +789,25 @@ uninstall-am: uninstall-pkgdataDATA
.PRECIOUS: Makefile
@ -332,7 +333,7 @@
- @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \
- echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \
- else \
- v=$$(file --version | sed -e s/file-// -e q); \
- v=$$(${FILE_COMPILE} --version | sed -e s/file-// -e q); \
- if [ "$$v" != "${PACKAGE_VERSION}" ]; then \
- echo "Cannot use the installed version of file ($$v) to"; \
- echo "cross-compile file ${PACKAGE_VERSION}"; \
@ -348,7 +349,7 @@
+# @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \
+# echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \
+# else \
+# v=$$(file --version | sed -e s/file-// -e q); \
+# v=$$(${FILE_COMPILE} --version | sed -e s/file-// -e q); \
+# if [ "$$v" != "${PACKAGE_VERSION}" ]; then \
+# echo "Cannot use the installed version of file ($$v) to"; \
+# echo "cross-compile file ${PACKAGE_VERSION}"; \
@ -362,7 +363,7 @@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
--- src/Makefile.am
+++ src/Makefile.am 2013-09-30 00:00:00.000000000 +0000
+++ src/Makefile.am 2016-04-18 11:59:52.381157214 +0000
@@ -1,4 +1,4 @@
-MAGIC = $(pkgdatadir)/magic
+MAGIC = $(sysconfdir)/magic:$(pkgdatadir)/magic
@ -370,7 +371,7 @@
include_HEADERS = magic.h
--- src/dcore.c
+++ src/dcore.c 2013-09-30 00:00:00.000000000 +0000
+++ src/dcore.c 2016-04-18 11:59:52.381157214 +0000
@@ -0,0 +1,207 @@
+/*
+ * Show goo about ELF core files
@ -579,3 +580,13 @@
+ exit(0);
+}
+
--- src/magic.h.in
+++ src/magic.h.in 2016-04-18 12:56:55.450019121 +0000
@@ -114,6 +114,7 @@ int magic_errno(magic_t);
#define MAGIC_PARAM_ELF_SHNUM_MAX 3
#define MAGIC_PARAM_ELF_NOTES_MAX 4
#define MAGIC_PARAM_REGEX_MAX 5
+#define MAGIC_PARAM_BYTES_MAX 6
int magic_setparam(magic_t, int, const void *);
int magic_getparam(magic_t, int, void *);

3
file-5.26.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2ef32b4ec936b0ff7b59a021dce56086a716663b6df1138c7ea597d396bf50cf
size 773061

View File

@ -1,12 +1,12 @@
---
file-5.23/configure.ac | 2 ++
file-5.23/src/file.c | 2 +-
file-5.23/src/file.h | 8 ++++++++
file-5.23/src/magic.c | 10 +++++-----
file-5.26/configure.ac | 2 ++
file-5.26/src/file.c | 2 +-
file-5.26/src/file.h | 8 ++++++++
file-5.26/src/magic.c | 10 +++++-----
4 files changed, 16 insertions(+), 6 deletions(-)
--- file-5.23/configure.ac
+++ file-5.23/configure.ac 2015-06-11 15:17:36.393695978 +0000
--- file-5.26/configure.ac
+++ file-5.26/configure.ac 2016-04-18 11:57:58.275266186 +0000
@@ -90,6 +90,8 @@ AC_CHECK_TYPE([sig_t],[AC_DEFINE([HAVE_S
#include <signal.h>
#endif])
@ -16,9 +16,9 @@
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
--- file-5.23/src/file.c
+++ file-5.23/src/file.c 2015-06-11 00:00:00.000000000 +0000
@@ -596,7 +596,7 @@ docprint(const char *opts)
--- file-5.26/src/file.c
+++ file-5.26/src/file.c 2016-04-18 11:57:58.275266186 +0000
@@ -617,7 +617,7 @@ docprint(const char *opts, int def)
private void
help(void)
{
@ -27,9 +27,9 @@
(void)fputs(
"Usage: file [OPTION...] [FILE...]\n"
"Determine type of FILEs.\n"
--- file-5.23/src/file.h
+++ file-5.23/src/file.h 2015-06-11 15:18:48.037518208 +0000
@@ -602,4 +602,12 @@ static const char *rcsid(const char *p)
--- file-5.26/src/file.h
+++ file-5.26/src/file.h 2016-04-18 11:57:58.275266186 +0000
@@ -615,4 +615,12 @@ static const char *rcsid(const char *p)
#define __RCSID(a)
#endif
@ -42,9 +42,9 @@
+#endif
+
#endif /* __file_h__ */
--- file-5.23/src/magic.c
+++ file-5.23/src/magic.c 2015-06-11 15:20:08.373518300 +0000
@@ -177,7 +177,7 @@ get_default_magic(void)
--- file-5.26/src/magic.c
+++ file-5.26/src/magic.c 2016-04-18 11:57:58.275266186 +0000
@@ -185,7 +185,7 @@ get_default_magic(void)
free(default_magic);
default_magic = NULL;
}
@ -53,7 +53,7 @@
return MAGIC;
if (asprintf(&hmagicpath, "%s/.magic.mgc", home) < 0)
@@ -214,16 +214,16 @@ out:
@@ -222,16 +222,16 @@ out:
}
/* First, try to get a magic file from user-application data */
@ -73,7 +73,7 @@
_w32_append_path(&hmagicpath, "%s%s", home, hmagic);
/* Fourth, try to get magic file relative to exe location */
@@ -244,7 +244,7 @@ magic_getpath(const char *magicfile, int
@@ -252,7 +252,7 @@ magic_getpath(const char *magicfile, int
if (magicfile != NULL)
return magicfile;

View File

@ -1,3 +1,36 @@
-------------------------------------------------------------------
Mon Apr 18 12:13:33 UTC 2016 - werner@suse.de
- Update to file version 5.26
* make the number of bytes read from files configurable.
* Add bounds checks for DER code (discovered by Thomas Jarosch)
* Change indirect recursion limit to indirect use count and
bump from 15 to 50 to prevent abuse.
* Add -00 which prints filename\0description\0
* Fix ID3 indirect parsing
* add DER parsing capability
* provide dprintf(3) for the OS's that don't have it.
* redo the compression code report decompression errors
* REG_STARTEND code is not working as expected, delete it.
* Add zlib support if we have it.
* PR/492: compression forking was broken with magic_buffer.
- Removed patches as upstream now
file-4.24-mips.dif
file-5.25-avoid-double-evaluation-in-python-bindings.dif
- Modified patches
file-5.12-zip.dif
file-5.16-ocloexec.patch
file-5.19-printf.dif
file-5.19-zip2.0.dif
file-5.22-elf.dif
file-5.23-endian.patch
file-5.24-nitpick.dif
file-secure_getenv.patch
- Renamed patches
file-5.23.dif becomes file-5.26.dif
- Added patch from upstream to fix version handling of PHP files
file-5.26-version.patch
-------------------------------------------------------------------
Tue Feb 16 12:40:33 UTC 2016 - rolf@rotkraut.de

View File

@ -32,7 +32,7 @@ Obsoletes: file-64bit
%endif
#
# Set Version also in python-magic.spec
Version: 5.25
Version: 5.26
Release: 0
Summary: A Tool to Determine File Types
License: BSD-2-Clause
@ -40,7 +40,7 @@ Group: Productivity/File utilities
Source: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz
Source2: baselibs.conf
Source3: file-rpmlintrc
Patch: file-5.23.dif
Patch: file-5.26.dif
Patch1: file-5.19-misc.dif
Patch4: file-4.24-autoconf.dif
Patch5: file-5.14-tex.dif
@ -52,7 +52,6 @@ Patch11: file-5.12-zip.dif
Patch12: file-5.17-option.dif
Patch13: file-4.21-scribus.dif
Patch15: file-4.21-xcursor.dif
Patch20: file-4.24-mips.dif
Patch22: file-5.19-cromfs.dif
Patch25: file-5.18-javacheck.dif
Patch26: file-5.19-solv.dif
@ -64,7 +63,7 @@ Patch34: file-5.23-endian.patch
Patch35: file-5.24-nitpick.dif
Patch36: file-5.15-clear-invalid.patch
Patch37: file-secure_getenv.patch
Patch38: file-5.25-avoid-double-evaluation-in-python-bindings.dif
Patch38: file-5.26-version.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%global _sysconfdir /etc
%global _miscdir %{_datadir}/misc
@ -116,9 +115,6 @@ to develop applications that require the magic "file" interface.
%patch12 -p0 -b .opt
%patch13 -p0 -b .scri
%patch15 -p0 -b .xcur
%ifarch mips
%patch20 -p0 -b .mips
%endif
%patch22 -p0 -b .cromfs
%patch25 -p0 -b .javacheck
%patch26 -p0 -b .solv
@ -130,9 +126,10 @@ to develop applications that require the magic "file" interface.
%patch35 -p0 -b .nitpick
%patch36 -p1 -b .clear
%patch37 -p1 -b .getenv
%patch38 -p1 -b .pythondouble
%patch38 -p1 -b .php
%patch -b .0
test -s src/magic.h.in || cp -p src/magic.h src/magic.h.in
rm -fv src/magic.h
%build
export LANG=POSIX
@ -162,6 +159,7 @@ echo '# global magic file is %{_miscdir}/magic(.mgc)' >> %{buildroot}%{_sysc
LD_LIBRARY_PATH=%{buildroot}%{_libdir}
export LD_LIBRARY_PATH
find %{buildroot}%{_bindir}/file %{_bindir}/ /%{_lib}/ %{_libdir}/ | \
grep -v tests/data/bom.py | \
xargs %{buildroot}%{_bindir}/file -m %{buildroot}%{_miscdir}/magic
unset LD_LIBRARY_PATH
%{__rm} -f %{buildroot}%{_libdir}/*.la

View File

@ -2,3 +2,4 @@
# This script is called automatically during autobuild checkin.
version=$(grep '^Version:.*' file.spec)
sed -ri "s,^Version:.*,$version," python-magic.spec
sed -ri "s,^Version:.*,$version," python3-magic.spec

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Apr 18 12:21:12 UTC 2016 - werner@suse.de
- Now it's file 5.26
-------------------------------------------------------------------
Tue Feb 16 12:41:14 UTC 2016 - rolf@rotkraut.de

View File

@ -27,7 +27,7 @@ BuildRequires: libtool
BuildRequires: python-devel
BuildRequires: zlib-devel
Url: http://www.darwinsys.com/file/
Version: 5.25
Version: 5.26
Release: 0
Summary: Python module to use libmagic
License: BSD-3-Clause and BSD-4-Clause

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Apr 18 12:21:42 UTC 2016 - werner@suse.de
- Now it's file 5.26
-------------------------------------------------------------------
Tue Feb 16 12:42:29 UTC 2016 - rolf@rotkraut.de

View File

@ -27,7 +27,7 @@ BuildRequires: libtool
BuildRequires: python3-devel
BuildRequires: zlib-devel
Url: http://www.darwinsys.com/file/
Version: 5.25
Version: 5.26
Release: 0
Summary: Python module to use libmagic
License: BSD-3-Clause and BSD-4-Clause