Accepting request 419961 from Base:System

- Add patch file-5.28-compress.patch
  to fix crash as found in build system

- Update to file version 5.28
  * fix leak on allocation failure
  * PR/555: Avoid overflow for offset > nbytes
  * PR/550: Segv on DER parsing:
      - use the correct variable for length
      - set offset to 0 on failure.
- Port patches to 5.28
  file-4.24-autoconf.dif
  file-5.15-clear-invalid.patch
  file-5.16-ocloexec.patch
  file-5.19-biorad.dif
  file-5.23-endian.patch
  file-5.24-nitpick.dif
  file-secure_getenv.patch
- Remove patches now upstream
  file-5.26-revert-close.patch
- Rename patches
  file-5.26.dif becomes file-5.28.dif

- Update to file version 5.27
  * Errors comparing DER entries or computing offsets
    are just indications of malformed non-DER files.
    Don't print them.
  * Offset comparison was off-by-one.
  * Fix compression code (Werner Fink)
  * Put new bytes constant in the right file (not the generated one)
- Remove patches

OBS-URL: https://build.opensuse.org/request/show/419961
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/file?expand=0&rev=94
This commit is contained in:
Dominique Leuenberger 2016-08-22 08:50:15 +00:00 committed by Git OBS Bridge
commit ca4132142d
27 changed files with 362 additions and 306 deletions

View File

@ -1,3 +1,6 @@
libmagic1
obsoletes "file-<targettype> < <version>"
provides "file-<targettype> = <version>"
requires "file-magic-<targettype> = <version>"
file-devel
requires -file-<targettype>
requires "libmagic1-<targettype> = <version>"
file-magic

View File

@ -1,5 +1,10 @@
---
doc/Makefile.am | 6 ++++--
src/readelf.h | 4 ++++
2 files changed, 8 insertions(+), 2 deletions(-)
--- doc/Makefile.am
+++ doc/Makefile.am 2013-09-30 00:00:00.000000000 +0000
+++ doc/Makefile.am 2016-08-16 11:45:43.001478793 +0000
@@ -5,7 +5,8 @@ else
man_MAGIC = magic.4
endif
@ -21,7 +26,7 @@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
--- src/readelf.h
+++ src/readelf.h 2013-09-30 00:00:00.000000000 +0000
+++ src/readelf.h 2016-08-16 11:45:43.001478793 +0000
@@ -34,7 +34,10 @@
#ifndef __fake_elf_h__
#define __fake_elf_h__
@ -33,7 +38,7 @@
#include <stdint.h>
#endif
@@ -339,4 +342,5 @@ typedef struct {
@@ -398,4 +401,5 @@ typedef struct {
#define AV_386_SSE4_1 0x00800000
#define AV_386_SSE4_2 0x01000000

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

@ -8,14 +8,12 @@ fixed build warning:
[ 205s] /usr/share/misc/magic, 5352: Warning: type `clear x' invalid
---
magic/Magdir/elf | 1 -
file-5.28/magic/Magdir/elf | 1 -
1 file changed, 1 deletion(-)
Index: file-5.15/magic/Magdir/elf
===================================================================
--- file-5.15.orig/magic/Magdir/elf 2013-09-29 01:42:19.000000000 +0100
+++ file-5.15/magic/Magdir/elf 2013-09-29 01:43:25.000000000 +0100
@@ -30,7 +30,6 @@
--- file-5.28/magic/Magdir/elf
+++ file-5.28/magic/Magdir/elf 2016-08-16 11:50:06.748513191 +0000
@@ -56,7 +56,6 @@
#>>>(0x38+0xcc) string >\0 of '%s'
#>>>(0x38+0x10) lelong >0 (signal %d),
>16 leshort &0xff00 processor-specific,

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-08-16 11:47:57.766941986 +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-08-16 11:47:57.766941986 +0000
@@ -389,7 +389,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-08-16 11:47:57.766941986 +0000
@@ -467,7 +467,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-08-16 11:47:57.766941986 +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/file.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- src/file.c
+++ src/file.c 2014-02-18 08:50:59.990452075 +0000
@@ -198,6 +198,8 @@ main(int argc, char *argv[])
+++ src/file.c 2016-06-01 10:13:21.169126906 +0000
@@ -225,6 +225,8 @@ main(int argc, char *argv[])
flags |= MAGIC_ERROR;
break;
case 'e':
@ -9,7 +13,7 @@
for (i = 0; i < sizeof(nv) / sizeof(nv[0]); i++)
if (strcmp(nv[i].name, optarg) == 0)
break;
@@ -209,7 +211,7 @@ main(int argc, char *argv[])
@@ -236,7 +238,7 @@ main(int argc, char *argv[])
break;
case 'f':
@ -18,7 +22,7 @@
usage();
if (magic == NULL)
if ((magic = load(magicfile, flags)) == NULL)
@@ -218,6 +220,8 @@ main(int argc, char *argv[])
@@ -246,6 +248,8 @@ main(int argc, char *argv[])
++didsomefiles;
break;
case 'F':
@ -27,7 +31,7 @@
separator = optarg;
break;
case 'i':
@@ -230,6 +234,8 @@ main(int argc, char *argv[])
@@ -258,6 +262,8 @@ main(int argc, char *argv[])
action = FILE_LIST;
break;
case 'm':

View File

@ -1,6 +1,10 @@
---
magic/Magdir/images | 2 ++
1 file changed, 2 insertions(+)
--- magic/Magdir/images
+++ magic/Magdir/images 2014-06-24 16:36:26.658235329 +0000
@@ -655,6 +655,8 @@
+++ magic/Magdir/images 2016-08-16 11:46:27.356644029 +0000
@@ -996,6 +996,8 @@
# http://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
# Samples: http://www.loci.wisc.edu/software/sample-data
14 leshort <2

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-08-16 11:48:47.694001873 +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
@@ -3176,67 +3179,6 @@ byteswap(struct magic *magic, uint32_t n
}
/*
@ -97,8 +97,8 @@
*/
private void
--- src/cdf.c
+++ src/cdf.c 2015-06-11 15:12:51.017518448 +0000
@@ -50,6 +50,7 @@ FILE_RCSID("@(#)$File: cdf.c,v 1.76 2015
+++ src/cdf.c 2016-08-16 11:48:47.694001873 +0000
@@ -50,6 +50,7 @@ FILE_RCSID("@(#)$File: cdf.c,v 1.82 2016
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif

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-08-16 11:49:23.481327975 +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)
@@ -617,6 +619,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) \
@@ -624,11 +627,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-08-16 11:49:23.481327975 +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

41
file-5.28-compress.patch Normal file
View File

@ -0,0 +1,41 @@
-- Subject: Crash with file-5.28/libmagic and rpmbuild
| Hi,
|
| interesting crash with libmagic from file-5.28 used by rpmbuild or better
| its librpmbuild.so.3. See attached backtrace. It looks like strlcpy()
| runs on a NULL pointer as source. As well as it is not clrear why an
| ascii file like apefooter_8h__incl.md5 with a MD5 sum without line terminat=
| or
| does cause the libmagic to do an uncompress:
|
| file /home/abuild/rpmbuild/BUILDROOT/taglib-1.11-0.x86_64/usr/share/doc/pa=
| ckages/libtag-devel/html/apefooter_8h__incl.md5
| /home/abuild/rpmbuild/BUILDROOT/taglib-1.11-0.x86_64/usr/share/doc/package=
| s/libtag-devel/html/apefooter_8h__incl.md5: ASCII text, with no line termin=
| ators
|
It has been fixed on HEAD:
Best,
christos
Index: src/compress.c
===================================================================
RCS file: /p/file/cvsroot/file/src/compress.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- src/compress.c 13 May 2016 23:02:28 -0000 1.97
+++ src/compress.c 28 Jun 2016 16:38:26 -0000 1.98
@@ -517,7 +517,7 @@
return OKDATA;
err:
- strlcpy((char *)*newch, z.msg, bytes_max);
+ strlcpy((char *)*newch, z.msg ? z.msg : zError(rc), bytes_max);
*n = strlen((char *)*newch);
return ERRDATA;
}

View File

@ -10,7 +10,7 @@
8 files changed, 311 insertions(+), 66 deletions(-)
--- magic/Magdir/elf
+++ magic/Magdir/elf 2013-09-30 00:00:00.000000000 +0000
+++ magic/Magdir/elf 2016-08-16 11:53:22.408828154 +0000
@@ -128,7 +128,7 @@
>18 leshort 47 Renesas H8/300H,
>18 leshort 48 Renesas H8S,
@ -21,7 +21,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-08-16 11:53:22.408828154 +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 +67,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-08-16 11:53:22.408828154 +0000
@@ -0,0 +1,5 @@
+#------------------------------------------------------------------------------
+# msad: file(1) magic for msad
@ -75,8 +75,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-08-16 11:53:22.408828154 +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 +89,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-08-16 11:53:22.408828154 +0000
@@ -5,7 +5,7 @@ MAGIC_FRAGMENT_BASE = Magdir
MAGIC_DIR = $(top_srcdir)/magic
MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE)
@ -107,15 +107,15 @@
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/archive \
$(MAGIC_FRAGMENT_DIR)/assembler \
@@ -77,7 +76,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
@@ -82,7 +81,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 \
@@ -122,6 +120,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
$(MAGIC_FRAGMENT_DIR)/java \
$(MAGIC_FRAGMENT_DIR)/javascript \
$(MAGIC_FRAGMENT_DIR)/jpeg \
@ -124,7 +124,7 @@
$(MAGIC_FRAGMENT_DIR)/karma \
$(MAGIC_FRAGMENT_DIR)/kde \
$(MAGIC_FRAGMENT_DIR)/keepass \
@@ -123,7 +123,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
@@ -130,7 +130,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
$(MAGIC_FRAGMENT_DIR)/lecter \
$(MAGIC_FRAGMENT_DIR)/lex \
$(MAGIC_FRAGMENT_DIR)/lif \
@ -132,7 +132,7 @@
$(MAGIC_FRAGMENT_DIR)/lisp \
$(MAGIC_FRAGMENT_DIR)/llvm \
$(MAGIC_FRAGMENT_DIR)/lua \
@@ -131,7 +130,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
@@ -138,7 +137,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
$(MAGIC_FRAGMENT_DIR)/m4 \
$(MAGIC_FRAGMENT_DIR)/mach \
$(MAGIC_FRAGMENT_DIR)/macos \
@ -140,7 +140,7 @@
$(MAGIC_FRAGMENT_DIR)/magic \
$(MAGIC_FRAGMENT_DIR)/mail.news \
$(MAGIC_FRAGMENT_DIR)/make \
@@ -152,10 +150,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
@@ -160,10 +158,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
$(MAGIC_FRAGMENT_DIR)/mkid \
$(MAGIC_FRAGMENT_DIR)/mlssa \
$(MAGIC_FRAGMENT_DIR)/mmdf \
@ -152,7 +152,7 @@
$(MAGIC_FRAGMENT_DIR)/msooxml \
$(MAGIC_FRAGMENT_DIR)/msx \
$(MAGIC_FRAGMENT_DIR)/msvc \
@@ -203,6 +201,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
@@ -214,6 +212,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
$(MAGIC_FRAGMENT_DIR)/qt \
$(MAGIC_FRAGMENT_DIR)/revision \
$(MAGIC_FRAGMENT_DIR)/riff \
@ -161,7 +161,7 @@
$(MAGIC_FRAGMENT_DIR)/rpm \
$(MAGIC_FRAGMENT_DIR)/rtf \
$(MAGIC_FRAGMENT_DIR)/ruby \
@@ -272,8 +272,20 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
@@ -285,8 +285,20 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
$(MAGIC_FRAGMENT_DIR)/zilog \
$(MAGIC_FRAGMENT_DIR)/zyxel
@ -183,7 +183,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$
@@ -298,19 +310,22 @@ FILE_COMPILE = $(top_builddir)/src/file$
FILE_COMPILE_DEP = $(FILE_COMPILE)
endif
@ -193,7 +193,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 +212,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 +223,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-08-16 11:53:22.408828154 +0000
@@ -278,7 +278,7 @@ top_srcdir = @top_srcdir@
MAGIC_FRAGMENT_BASE = Magdir
MAGIC_DIR = $(top_srcdir)/magic
@ -241,15 +241,15 @@
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/archive \
$(MAGIC_FRAGMENT_DIR)/assembler \
@@ -349,7 +348,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
@@ -354,7 +353,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 \
@@ -394,6 +392,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
$(MAGIC_FRAGMENT_DIR)/java \
$(MAGIC_FRAGMENT_DIR)/javascript \
$(MAGIC_FRAGMENT_DIR)/jpeg \
@ -258,7 +258,7 @@
$(MAGIC_FRAGMENT_DIR)/karma \
$(MAGIC_FRAGMENT_DIR)/kde \
$(MAGIC_FRAGMENT_DIR)/keepass \
@@ -395,7 +395,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
@@ -402,7 +402,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
$(MAGIC_FRAGMENT_DIR)/lecter \
$(MAGIC_FRAGMENT_DIR)/lex \
$(MAGIC_FRAGMENT_DIR)/lif \
@ -266,7 +266,7 @@
$(MAGIC_FRAGMENT_DIR)/lisp \
$(MAGIC_FRAGMENT_DIR)/llvm \
$(MAGIC_FRAGMENT_DIR)/lua \
@@ -403,7 +402,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
@@ -410,7 +409,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
$(MAGIC_FRAGMENT_DIR)/m4 \
$(MAGIC_FRAGMENT_DIR)/mach \
$(MAGIC_FRAGMENT_DIR)/macos \
@ -274,7 +274,7 @@
$(MAGIC_FRAGMENT_DIR)/magic \
$(MAGIC_FRAGMENT_DIR)/mail.news \
$(MAGIC_FRAGMENT_DIR)/make \
@@ -424,10 +422,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
@@ -432,10 +430,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
$(MAGIC_FRAGMENT_DIR)/mkid \
$(MAGIC_FRAGMENT_DIR)/mlssa \
$(MAGIC_FRAGMENT_DIR)/mmdf \
@ -286,7 +286,7 @@
$(MAGIC_FRAGMENT_DIR)/msooxml \
$(MAGIC_FRAGMENT_DIR)/msx \
$(MAGIC_FRAGMENT_DIR)/msvc \
@@ -475,6 +473,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
@@ -486,6 +484,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
$(MAGIC_FRAGMENT_DIR)/qt \
$(MAGIC_FRAGMENT_DIR)/revision \
$(MAGIC_FRAGMENT_DIR)/riff \
@ -295,7 +295,7 @@
$(MAGIC_FRAGMENT_DIR)/rpm \
$(MAGIC_FRAGMENT_DIR)/rtf \
$(MAGIC_FRAGMENT_DIR)/ruby \
@@ -544,10 +544,22 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
@@ -557,10 +557,22 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
$(MAGIC_FRAGMENT_DIR)/zilog \
$(MAGIC_FRAGMENT_DIR)/zyxel
@ -319,7 +319,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
@@ -782,23 +794,25 @@ uninstall-am: uninstall-pkgdataDATA
.PRECIOUS: Makefile
@ -332,7 +332,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 +348,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,15 +362,15 @@
# 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-08-16 11:54:33.947480617 +0000
@@ -1,4 +1,4 @@
-MAGIC = $(pkgdatadir)/magic
+MAGIC = $(sysconfdir)/magic:$(pkgdatadir)/magic
lib_LTLIBRARIES = libmagic.la
include_HEADERS = magic.h
nodist_include_HEADERS = magic.h
--- src/dcore.c
+++ src/dcore.c 2013-09-30 00:00:00.000000000 +0000
+++ src/dcore.c 2016-08-16 11:53:22.424827851 +0000
@@ -0,0 +1,207 @@
+/*
+ * Show goo about ELF core files

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

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

View File

@ -1,4 +1,4 @@
addFilter(".*Warning:.*using.*regular.*magic.*file.*/usr/share/misc/magic.*")
addFilter(".*E:.*shlib-fixed-dependency.*")
addFilter(".*W:.*no-dependency-on.*")
addFilter(".*W:.*no-dependency-on file.*/file-libs/libfile.*")
addFilter(".*W:.*name-repeated-in-summary.*")
addFilter(".*E:.*shlib-fixed-dependency.*")

View File

@ -1,13 +1,13 @@
---
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.28/configure.ac | 2 ++
file-5.28/src/file.c | 2 +-
file-5.28/src/file.h | 8 ++++++++
file-5.28/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
@@ -90,6 +90,8 @@ AC_CHECK_TYPE([sig_t],[AC_DEFINE([HAVE_S
--- file-5.28/configure.ac
+++ file-5.28/configure.ac 2016-08-16 11:51:12.795269362 +0000
@@ -97,6 +97,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.28/src/file.c
+++ file-5.28/src/file.c 2016-08-16 11:51:12.795269362 +0000
@@ -619,7 +619,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.28/src/file.h
+++ file-5.28/src/file.h 2016-08-16 11:51:12.795269362 +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.28/src/magic.c
+++ file-5.28/src/magic.c 2016-08-16 11:51:12.795269362 +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,110 @@
-------------------------------------------------------------------
Thu Aug 18 12:24:36 UTC 2016 - werner@suse.de
- Add patch file-5.28-compress.patch
to fix crash as found in build system
-------------------------------------------------------------------
Tue Aug 16 11:59:36 UTC 2016 - werner@suse.de
- Update to file version 5.28
* fix leak on allocation failure
* PR/555: Avoid overflow for offset > nbytes
* PR/550: Segv on DER parsing:
- use the correct variable for length
- set offset to 0 on failure.
- Port patches to 5.28
file-4.24-autoconf.dif
file-5.15-clear-invalid.patch
file-5.16-ocloexec.patch
file-5.19-biorad.dif
file-5.23-endian.patch
file-5.24-nitpick.dif
file-secure_getenv.patch
- Remove patches now upstream
file-5.26-revert-close.patch
- Rename patches
file-5.26.dif becomes file-5.28.dif
-------------------------------------------------------------------
Wed Jun 1 10:17:08 UTC 2016 - werner@suse.de
- Update to file version 5.27
* Errors comparing DER entries or computing offsets
are just indications of malformed non-DER files.
Don't print them.
* Offset comparison was off-by-one.
* Fix compression code (Werner Fink)
* Put new bytes constant in the right file (not the generated one)
- Remove patches
file-5.26-version.patch
file-5.26-downgrade_DER.patch
file-5.26-console.diff
file-5.26-zmagic.patch
as now upstream
- Disable patch file-5.26-revert-close.patch for test
- Modify patches
file-5.17-option.dif
file-5.26.dif
-------------------------------------------------------------------
Wed Apr 20 07:14:15 UTC 2016 - werner@suse.de
- Add and revert upstream patch file-5.26-revert-close.patch
(commit 0177f6dd30e1f8c5639c058dcdf1d9edd9f8528c) to help
rpmbuild not to loose stdin
-------------------------------------------------------------------
Tue Apr 19 11:52:49 UTC 2016 - werner@suse.de
- Add patch file-5.26-zmagic.patch
to fix detection chain if for compresses files are expanded
-------------------------------------------------------------------
Tue Apr 19 09:38:07 UTC 2016 - werner@suse.de
- Add upstream patch file-5.26-console.diff
to fix wrong detection of UNIF edb files
-------------------------------------------------------------------
Tue Apr 19 09:35:28 UTC 2016 - werner@suse.de
- Add upstream patch file-5.26-downgrade_DER.patch
to fix DER error messages as well oas offset handling
-------------------------------------------------------------------
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.28
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.28.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.28-compress.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%global _sysconfdir /etc
%global _miscdir %{_datadir}/misc
@ -75,31 +74,33 @@ specified file. File type recognition is controlled by the file
/etc/magic, which contains the classification criteria. This command is
used by apsfilter to permit automatic printing of different file types.
%package -n file-magic
%package magic
Summary: The magic files for libmagic to use
Group: Productivity/File utilities
Obsoletes: libmagic-data
Obsoletes: libmagic-data < %{version}
Provides: libmagic-data = %{version}
%description -n file-magic
%description magic
This package contains the basic magic files that libmagic reads and uses
to estimate a file's type.
%package -n %libname
Summary: Library with file's functionality
Group: System/Libraries
Provides: file:%{_libdir}/libmagic.so.%{somajor}
Requires: file-magic = %{version}
%description -n %libname
This library reads magic files and detects file types. Used by file command
%package -n file-devel
%package devel
Summary: Include Files and Libraries mandatory for Development
Group: Development/Libraries/C and C++
Provides: file:/usr/include/magic.h
Requires: %libname = %{version}
Requires: glibc-devel
%description -n file-devel
%description devel
This package contains all necessary include files and libraries needed
to develop applications that require the magic "file" interface.
@ -116,9 +117,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 +128,11 @@ 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
# PATCH-FIX-UPSTREAM -- fix crash as found in build system
%patch38 -p0 -b .rpmbuild
%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
@ -157,7 +157,10 @@ make DESTDIR=%{buildroot} install pkgdatadir='$(datadir)'
rm -vf %{buildroot}%{_sysconfdir}/magic
echo '# Localstuff: file(1) magic(5) for locally observed files' > %{buildroot}%{_sysconfdir}/magic
echo '# global magic file is %{_miscdir}/magic(.mgc)' >> %{buildroot}%{_sysconfdir}/magic
%{nil install -s dcore %{buildroot}%{_bindir}}
# Does not build
%if %{with decore}
install -s dcore %{buildroot}%{_bindir}
%endif
# Check out that the binary does not bail out:
LD_LIBRARY_PATH=%{buildroot}%{_libdir}
export LD_LIBRARY_PATH
@ -171,25 +174,27 @@ unset LD_LIBRARY_PATH
%postun -n %libname -p /sbin/ldconfig
%files -n %libname
%defattr (644,root,root,755)
%defattr (-,root,root)
%{_libdir}/lib*.so.*
%files -n file-magic
%defattr (644,root,root,755)
%files magic
%defattr (-,root,root)
%config(noreplace) %{_sysconfdir}/magic
%{_miscdir}/magic
%{_miscdir}/magic.mgc
%doc %{_mandir}/man5/magic.5.gz
%files
%defattr (644,root,root,755)
%{nil %{_bindir}/dcore}
%defattr (-,root,root)
%if %{with decore}
%attr(755,root,root) %{_bindir}/dcore
%endif
%attr(755,root,root) %{_bindir}/file
%doc %{_mandir}/man1/file.1.gz
%doc COPYING AUTHORS NEWS ChangeLog
%files -n file-devel
%defattr (644,root,root,755)
%files devel
%defattr (-,root,root)
%{_libdir}/lib*.so
%{_includedir}/magic.h
%doc %{_mandir}/man3/libmagic.3.gz

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,13 @@
-------------------------------------------------------------------
Wed Apr 20 08:49:18 UTC 2016 - werner@suse.de
- Add Build Require python-setuptools
-------------------------------------------------------------------
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

@ -25,9 +25,10 @@ Name: python-magic
BuildRequires: findutils
BuildRequires: libtool
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: zlib-devel
Url: http://www.darwinsys.com/file/
Version: 5.25
Version: 5.28
Release: 0
Summary: Python module to use libmagic
License: BSD-3-Clause and BSD-4-Clause

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Apr 20 08:49:18 UTC 2016 - werner@suse.de
- Add Build Require python3-setuptools
-------------------------------------------------------------------
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

@ -25,9 +25,10 @@ Name: python3-magic
BuildRequires: findutils
BuildRequires: libtool
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: zlib-devel
Url: http://www.darwinsys.com/file/
Version: 5.25
Version: 5.28
Release: 0
Summary: Python module to use libmagic
License: BSD-3-Clause and BSD-4-Clause