commit 7f58df534b1288e17a7698202b77472a690d7ebb Author: CentOS Sources Date: Tue Nov 15 02:05:50 2022 -0500 import file-5.39-10.el9 diff --git a/.file.metadata b/.file.metadata new file mode 100644 index 0000000..5589429 --- /dev/null +++ b/.file.metadata @@ -0,0 +1 @@ +a5a8941a8e4c436fe22933db6a71c5161c3fb10b SOURCES/file-5.39.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..16418f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/file-5.39.tar.gz diff --git a/SOURCES/file-4.17-rpm-name.patch b/SOURCES/file-4.17-rpm-name.patch new file mode 100644 index 0000000..d542b0c --- /dev/null +++ b/SOURCES/file-4.17-rpm-name.patch @@ -0,0 +1,12 @@ +diff --git a/magic/Magdir/rpm b/magic/Magdir/rpm +index 9a795f8..31db083 100644 +--- a/magic/Magdir/rpm ++++ b/magic/Magdir/rpm +@@ -29,6 +29,7 @@ + >>8 beshort 17 SuperH + >>8 beshort 18 Xtensa + >>8 beshort 255 noarch ++>>10 string x %s + + #delta RPM Daniel Novotny (dnovotny@redhat.com) + 0 string drpm Delta RPM diff --git a/SOURCES/file-5.04-volume_key.patch b/SOURCES/file-5.04-volume_key.patch new file mode 100644 index 0000000..b3c0860 --- /dev/null +++ b/SOURCES/file-5.04-volume_key.patch @@ -0,0 +1,10 @@ +diff --git a/magic/Magdir/securitycerts b/magic/Magdir/securitycerts +index 8785dd8..1c340be 100644 +--- a/magic/Magdir/securitycerts ++++ b/magic/Magdir/securitycerts +@@ -4,3 +4,5 @@ + 0 search/1 -----BEGIN\ CERTIFICATE------ RFC1421 Security Certificate text + 0 search/1 -----BEGIN\ NEW\ CERTIFICATE RFC1421 Security Certificate Signing Request text + 0 belong 0xedfeedfe Sun 'jks' Java Keystore File data ++ ++0 string \0volume_key volume_key escrow packet diff --git a/SOURCES/file-5.33-fix-compression.patch b/SOURCES/file-5.33-fix-compression.patch new file mode 100644 index 0000000..f5751b1 --- /dev/null +++ b/SOURCES/file-5.33-fix-compression.patch @@ -0,0 +1,45 @@ +diff --git a/src/compress.c b/src/compress.c +index ba1e3d7..6846d66 100644 +--- a/src/compress.c ++++ b/src/compress.c +@@ -932,23 +932,23 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, const unsigned char *old, + rv = OKDATA; + r = sread(fdp[STDOUT_FILENO][0], *newch, bytes_max, 0); + if (r <= 0) { +- DPRINTF("Read stdout failed %d (%s)\n", fdp[STDOUT_FILENO][0], +- r != -1 ? strerror(errno) : "no data"); +- +- rv = ERRDATA; +- if (r == 0 && +- (r = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0) +- { +- r = filter_error(*newch, r); +- goto ok; +- } +- free(*newch); +- if (r == 0) +- rv = makeerror(newch, n, "Read failed, %s", +- strerror(errno)); +- else +- rv = makeerror(newch, n, "No data"); +- goto err; ++ if (r < 0) { ++ rv = ERRDATA; ++ DPRINTF("Read stdout failed %d (%s)\n", fdp[STDOUT_FILENO][0], ++ strerror(errno)); ++ goto err; ++ } else if ((r = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0){ ++ rv = ERRDATA; ++ r = filter_error(*newch, r); ++ goto ok; ++ } ++ if (r == 0) ++ goto ok; ++ free(*newch); ++ rv = ERRDATA; ++ rv = makeerror(newch, n, "Read stderr failed, %s", ++ strerror(errno)); ++ goto err; + } + ok: + *n = r; diff --git a/SOURCES/file-5.39-CLOEXEC.patch b/SOURCES/file-5.39-CLOEXEC.patch new file mode 100644 index 0000000..648ef9b --- /dev/null +++ b/SOURCES/file-5.39-CLOEXEC.patch @@ -0,0 +1,201 @@ +diff --git a/ChangeLog b/ChangeLog +index d46caaa0d..41d6e99d9 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2020-12-08 16:24 Christos Zoulas ++ ++ * fix multithreaded decompression file descriptor issue ++ by using close-on-exec (Denys Vlasenko) ++ + 2020-06-14 20:02 Christos Zoulas + + * release 5.39 +diff --git a/configure.ac b/configure.ac +index 64c9f42e3..521dc12db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -166,7 +166,7 @@ else + fi]) + + dnl Checks for functions +-AC_CHECK_FUNCS(strndup mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale memmem) ++AC_CHECK_FUNCS(strndup mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale memmem pipe2) + + dnl Provide implementation of some required functions if necessary + AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck dprintf) +diff --git a/src/compress.c b/src/compress.c +index cbc2ce19b..9f65e4fa1 100644 +--- a/src/compress.c ++++ b/src/compress.c +@@ -35,7 +35,7 @@ + #include "file.h" + + #ifndef lint +-FILE_RCSID("@(#)$File: compress.c,v 1.127 2020/05/31 00:11:06 christos Exp $") ++FILE_RCSID("@(#)$File: compress.c,v 1.129 2020/12/08 21:26:00 christos Exp $") + #endif + + #include "magic.h" +@@ -844,8 +844,23 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, const unsigned char *old, + for (i = 0; i < __arraycount(fdp); i++) + fdp[i][0] = fdp[i][1] = -1; + +- if ((fd == -1 && pipe(fdp[STDIN_FILENO]) == -1) || +- pipe(fdp[STDOUT_FILENO]) == -1 || pipe(fdp[STDERR_FILENO]) == -1) { ++ /* ++ * There are multithreaded users who run magic_file() ++ * from dozens of threads. If two parallel magic_file() calls ++ * analyze two large compressed files, both will spawn ++ * an uncompressing child here, which writes out uncompressed data. ++ * We read some portion, then close the pipe, then waitpid() the child. ++ * If uncompressed data is larger, child shound get EPIPE and exit. ++ * However, with *parallel* calls OTHER child may unintentionally ++ * inherit pipe fds, thus keeping pipe open and making writes in ++ * our child block instead of failing with EPIPE! ++ * (For the bug to occur, two threads must mutually inherit their pipes, ++ * and both must have large outputs. Thus it happens not that often). ++ * To avoid this, be sure to create pipes with O_CLOEXEC. ++ */ ++ if ((fd == -1 && file_pipe_closexec(fdp[STDIN_FILENO]) == -1) || ++ file_pipe_closexec(fdp[STDOUT_FILENO]) == -1 || ++ file_pipe_closexec(fdp[STDERR_FILENO]) == -1) { + closep(fdp[STDIN_FILENO]); + closep(fdp[STDOUT_FILENO]); + return makeerror(newch, n, "Cannot create pipe, %s", +@@ -876,16 +891,20 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, const unsigned char *old, + if (fdp[STDIN_FILENO][1] > 2) + (void) close(fdp[STDIN_FILENO][1]); + } ++ file_clear_closexec(STDIN_FILENO); ++ + ///FIXME: if one of the fdp[i][j] is 0 or 1, this can bomb spectacularly + if (copydesc(STDOUT_FILENO, fdp[STDOUT_FILENO][1])) + (void) close(fdp[STDOUT_FILENO][1]); + if (fdp[STDOUT_FILENO][0] > 2) + (void) close(fdp[STDOUT_FILENO][0]); ++ file_clear_closexec(STDOUT_FILENO); + + if (copydesc(STDERR_FILENO, fdp[STDERR_FILENO][1])) + (void) close(fdp[STDERR_FILENO][1]); + if (fdp[STDERR_FILENO][0] > 2) + (void) close(fdp[STDERR_FILENO][0]); ++ file_clear_closexec(STDERR_FILENO); + + (void)execvp(compr[method].argv[0], + RCAST(char *const *, RCAST(intptr_t, compr[method].argv))); +diff --git a/src/file.h b/src/file.h +index f00e8010b..6c3900479 100644 +--- a/src/file.h ++++ b/src/file.h +@@ -27,7 +27,7 @@ + */ + /* + * file.h - definitions for file(1) program +- * @(#)$File: file.h,v 1.220 2020/06/08 17:38:27 christos Exp $ ++ * @(#)$File: file.h,v 1.223 2020/12/08 21:26:00 christos Exp $ + */ + + #ifndef __file_h__ +@@ -143,6 +143,14 @@ + #define MAX(a,b) (((a) > (b)) ? (a) : (b)) + #endif + ++#ifndef O_CLOEXEC ++# define O_CLOEXEC 0 ++#endif ++ ++#ifndef FD_CLOEXEC ++# define FD_CLOEXEC 1 ++#endif ++ + #define FILE_BADSIZE CAST(size_t, ~0ul) + #define MAXDESC 64 /* max len of text description/MIME type */ + #define MAXMIME 80 /* max len of text MIME type */ +@@ -540,6 +548,8 @@ protected char * file_printable(char *, size_t, const char *, size_t); + protected int file_os2_apptype(struct magic_set *, const char *, const void *, + size_t); + #endif /* __EMX__ */ ++protected int file_pipe_closexec(int *); ++protected int file_clear_closexec(int); + + protected void buffer_init(struct buffer *, int, const struct stat *, + const void *, size_t); +diff --git a/src/funcs.c b/src/funcs.c +index ecbfa28c5..bcf9ddaae 100644 +--- a/src/funcs.c ++++ b/src/funcs.c +@@ -27,7 +27,7 @@ + #include "file.h" + + #ifndef lint +-FILE_RCSID("@(#)$File: funcs.c,v 1.115 2020/02/20 15:50:20 christos Exp $") ++FILE_RCSID("@(#)$File: funcs.c,v 1.118 2020/12/08 21:26:00 christos Exp $") + #endif /* lint */ + + #include "magic.h" +@@ -36,6 +36,9 @@ FILE_RCSID("@(#)$File: funcs.c,v 1.117 2020/06/25 16:52:48 christos Exp $") + #include + #include + #include ++#ifdef HAVE_UNISTD_H ++#include /* for pipe2() */ ++#endif + #if defined(HAVE_WCHAR_H) + #include + #endif +@@ -784,3 +787,22 @@ file_print_guid(char *str, size_t len, const uint64_t *guid) + g->data4[2], g->data4[3], g->data4[4], g->data4[5], + g->data4[6], g->data4[7]); + } ++ ++protected int ++file_pipe_closexec(int *fds) ++{ ++#ifdef HAVE_PIPE2 ++ return pipe2(fds, O_CLOEXEC); ++#else ++ if (pipe(fds) == -1) ++ return -1; ++ (void)fcntl(fds[0], F_SETFD, FD_CLOEXEC); ++ (void)fcntl(fds[1], F_SETFD, FD_CLOEXEC); ++ return 0; ++#endif ++} ++ ++protected int ++file_clear_closexec(int fd) { ++ return fcntl(fd, F_SETFD, 0); ++} +diff --git a/src/magic.c b/src/magic.c +index 17a7077d8..89f4e16c0 100644 +--- a/src/magic.c ++++ b/src/magic.c +@@ -33,7 +33,7 @@ + #include "file.h" + + #ifndef lint +-FILE_RCSID("@(#)$File: magic.c,v 1.112 2020/06/08 19:44:10 christos Exp $") ++FILE_RCSID("@(#)$File: magic.c,v 1.113 2020/12/08 21:26:00 christos Exp $") + #endif /* lint */ + + #include "magic.h" +@@ -436,7 +436,7 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd) + _setmode(STDIN_FILENO, O_BINARY); + #endif + if (inname != NULL) { +- int flags = O_RDONLY|O_BINARY|O_NONBLOCK; ++ int flags = O_RDONLY|O_BINARY|O_NONBLOCK|O_CLOEXEC; + errno = 0; + if ((fd = open(inname, flags)) < 0) { + okstat = stat(inname, &sb) == 0; +@@ -460,6 +460,9 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd) + rv = 0; + goto done; + } ++#if O_CLOEXEC == 0 ++ (void)fcntl(fd, F_SETFD, FD_CLOEXEC); ++#endif + } + + if (fd != -1) { diff --git a/SOURCES/file-5.39-regex-caching-1.patch b/SOURCES/file-5.39-regex-caching-1.patch new file mode 100644 index 0000000..f1738fe --- /dev/null +++ b/SOURCES/file-5.39-regex-caching-1.patch @@ -0,0 +1,377 @@ +diff --git a/src/apprentice.c b/src/apprentice.c +index b609dd1..21eac1e 100644 +--- a/src/apprentice.c ++++ b/src/apprentice.c +@@ -423,7 +423,15 @@ add_mlist(struct mlist *mlp, struct magic_map *map, size_t idx) + ml->map = idx == 0 ? map : NULL; + ml->magic = map->magic[idx]; + ml->nmagic = map->nmagic[idx]; +- ++ if (ml->nmagic) { ++ ml->magic_rxcomp = CAST(file_regex_t **, ++ calloc(ml->nmagic, sizeof(*ml->magic_rxcomp))); ++ if (ml->magic_rxcomp == NULL) { ++ free(ml); ++ return -1; ++ } ++ } else ++ ml->magic_rxcomp = NULL; + mlp->prev->next = ml; + ml->prev = mlp->prev; + ml->next = mlp; +@@ -607,8 +615,19 @@ mlist_free_all(struct magic_set *ms) + private void + mlist_free_one(struct mlist *ml) + { ++ size_t i; ++ + if (ml->map) + apprentice_unmap(CAST(struct magic_map *, ml->map)); ++ ++ for (i = 0; i < ml->nmagic; ++i) { ++ if (ml->magic_rxcomp[i]) { ++ file_regfree(ml->magic_rxcomp[i]); ++ free(ml->magic_rxcomp[i]); ++ } ++ } ++ free(ml->magic_rxcomp); ++ ml->magic_rxcomp = NULL; + free(ml); + } + +@@ -3492,16 +3511,16 @@ file_magicfind(struct magic_set *ms, const char *name, struct mlist *v) + + for (ml = mlist->next; ml != mlist; ml = ml->next) { + struct magic *ma = ml->magic; +- uint32_t nma = ml->nmagic; +- for (i = 0; i < nma; i++) { ++ for (i = 0; i < ml->nmagic; i++) { + if (ma[i].type != FILE_NAME) + continue; + if (strcmp(ma[i].value.s, name) == 0) { + v->magic = &ma[i]; +- for (j = i + 1; j < nma; j++) ++ for (j = i + 1; j < ml->nmagic; j++) + if (ma[j].cont_level == 0) + break; + v->nmagic = j - i; ++ v->magic_rxcomp = ml->magic_rxcomp; + return 0; + } + } +diff --git a/src/file.h b/src/file.h +index 48f4b69..c0b5a7c 100644 +--- a/src/file.h ++++ b/src/file.h +@@ -88,6 +88,10 @@ + /* Do this here and now, because struct stat gets re-defined on solaris */ + #include + #include ++#include ++#if defined(HAVE_XLOCALE_H) ++#include ++#endif + + #define ENABLE_CONDITIONALS + +@@ -167,6 +171,19 @@ + #define FILE_COMPILE 2 + #define FILE_LIST 3 + ++typedef struct { ++ const char *pat; ++#if defined(HAVE_NEWLOCALE) && defined(HAVE_USELOCALE) && defined(HAVE_FREELOCALE) ++#define USE_C_LOCALE ++ locale_t old_lc_ctype; ++ locale_t c_lc_ctype; ++#else ++ char *old_lc_ctype; ++#endif ++ int rc; ++ regex_t rx; ++} file_regex_t; ++ + struct buffer { + int fd; + struct stat st; +@@ -394,7 +411,8 @@ struct magic { + /* list of magic entries */ + struct mlist { + struct magic *magic; /* array of magic entries */ +- uint32_t nmagic; /* number of entries in array */ ++ file_regex_t **magic_rxcomp; /* array of compiled regexps */ ++ size_t nmagic; /* number of entries in array */ + void *map; /* internal resources used by entry */ + struct mlist *next, *prev; + }; +@@ -554,23 +572,7 @@ protected void buffer_init(struct buffer *, int, const struct stat *, + protected void buffer_fini(struct buffer *); + protected int buffer_fill(const struct buffer *); + +-#include +-#if defined(HAVE_XLOCALE_H) +-#include +-#endif + +-typedef struct { +- const char *pat; +-#if defined(HAVE_NEWLOCALE) && defined(HAVE_USELOCALE) && defined(HAVE_FREELOCALE) +-#define USE_C_LOCALE +- locale_t old_lc_ctype; +- locale_t c_lc_ctype; +-#else +- char *old_lc_ctype; +-#endif +- int rc; +- regex_t rx; +-} file_regex_t; + + protected int file_regcomp(file_regex_t *, const char *, int); + protected int file_regexec(file_regex_t *, const char *, size_t, regmatch_t *, +diff --git a/src/softmagic.c b/src/softmagic.c +index 95061e5..834dfe3 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -43,7 +43,7 @@ FILE_RCSID("@(#)$File: softmagic.c,v 1.299 2020/06/07 21:58:01 christos Exp $") + #include + #include "der.h" + +-private int match(struct magic_set *, struct magic *, uint32_t, ++private int match(struct magic_set *, struct magic *, file_regex_t **, uint32_t, + const struct buffer *, size_t, int, int, int, uint16_t *, + uint16_t *, int *, int *, int *, int *); + private int mget(struct magic_set *, struct magic *, const struct buffer *, +@@ -52,7 +52,7 @@ private int mget(struct magic_set *, struct magic *, const struct buffer *, + uint16_t *, int *, int *, int *, int *); + private int msetoffset(struct magic_set *, struct magic *, struct buffer *, + const struct buffer *, size_t, unsigned int); +-private int magiccheck(struct magic_set *, struct magic *); ++private int magiccheck(struct magic_set *, struct magic *, file_regex_t **); + private int32_t mprint(struct magic_set *, struct magic *); + private int moffset(struct magic_set *, struct magic *, const struct buffer *, + int32_t *); +@@ -131,8 +131,8 @@ file_softmagic(struct magic_set *ms, const struct buffer *b, + } + + for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next) +- if ((rv = match(ms, ml->magic, ml->nmagic, b, 0, mode, +- text, 0, indir_count, name_count, ++ if ((rv = match(ms, ml->magic, ml->magic_rxcomp, ml->nmagic, b, ++ 0, mode, text, 0, indir_count, name_count, + &printed_something, &need_separator, NULL, NULL)) != 0) + return rv; + +@@ -191,8 +191,8 @@ file_fmtcheck(struct magic_set *ms, const char *desc, const char *def, + * so that higher-level continuations are processed. + */ + private int +-match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, +- const struct buffer *b, size_t offset, int mode, int text, ++match(struct magic_set *ms, struct magic *magic, file_regex_t **magic_rxcomp, ++ uint32_t nmagic, const struct buffer *b, size_t offset, int mode, int text, + int flip, uint16_t *indir_count, uint16_t *name_count, + int *printed_something, int *need_separator, int *returnval, + int *found_match) +@@ -220,6 +220,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, + for (magindex = 0; magindex < nmagic; magindex++) { + int flush = 0; + struct magic *m = &magic[magindex]; ++ file_regex_t **m_rxcomp = &magic_rxcomp[magindex]; + + if (m->type != FILE_NAME) + if ((IS_STRING(m->type) && +@@ -257,7 +258,7 @@ flush: + *returnval = 1; + } + +- switch (magiccheck(ms, m)) { ++ switch (magiccheck(ms, m, m_rxcomp)) { + case -1: + return -1; + case 0: +@@ -317,6 +318,7 @@ flush: + while (magindex + 1 < nmagic && + magic[magindex + 1].cont_level != 0) { + m = &magic[++magindex]; ++ m_rxcomp = &magic_rxcomp[magindex]; + ms->line = m->lineno; /* for messages */ + + if (cont_level < m->cont_level) +@@ -370,7 +372,7 @@ flush: + break; + } + +- switch (flush ? 1 : magiccheck(ms, m)) { ++ switch (flush ? 1 : magiccheck(ms, m, m_rxcomp)) { + case -1: + return -1; + case 0: +@@ -1880,8 +1882,8 @@ mget(struct magic_set *ms, struct magic *m, const struct buffer *b, + oneed_separator = *need_separator; + if (m->flag & NOSPACE) + *need_separator = 0; +- rv = match(ms, ml.magic, ml.nmagic, b, offset + o, +- mode, text, flip, indir_count, name_count, ++ rv = match(ms, ml.magic, ml.magic_rxcomp, ml.nmagic, b, ++ offset + o, mode, text, flip, indir_count, name_count, + printed_something, need_separator, returnval, found_match); + (*name_count)--; + if (rv != 1) +@@ -1989,8 +1991,31 @@ file_strncmp16(const char *a, const char *b, size_t len, size_t maxlen, + return file_strncmp(a, b, len, maxlen, flags); + } + ++private file_regex_t * ++alloc_regex(struct magic_set *ms, struct magic *m) ++{ ++ int rc; ++ file_regex_t *rx = CAST(file_regex_t *, malloc(sizeof(*rx))); ++ ++ if (rx == NULL) { ++ file_error(ms, errno, "can't allocate %" SIZE_T_FORMAT ++ "u bytes", sizeof(*rx)); ++ return NULL; ++ } ++ ++ rc = file_regcomp(rx, m->value.s, REG_EXTENDED | REG_NEWLINE | ++ ((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)); ++ if (rc == 0) ++ return rx; ++ ++ file_regerror(rx, rc, ms); ++ file_regfree(rx); ++ free(rx); ++ return NULL; ++} ++ + private int +-magiccheck(struct magic_set *ms, struct magic *m) ++magiccheck(struct magic_set *ms, struct magic *m, file_regex_t **m_cache) + { + uint64_t l = m->value.q; + uint64_t v; +@@ -2068,8 +2093,8 @@ magiccheck(struct magic_set *ms, struct magic *m) + break; + + default: +- file_magerror(ms, "cannot happen with float: invalid relation `%c'", +- m->reln); ++ file_magerror(ms, "cannot happen with float: " ++ "invalid relation `%c'", m->reln); + return -1; + } + return matched; +@@ -2101,7 +2126,8 @@ magiccheck(struct magic_set *ms, struct magic *m) + break; + + default: +- file_magerror(ms, "cannot happen with double: invalid relation `%c'", m->reln); ++ file_magerror(ms, "cannot happen with double: " ++ "invalid relation `%c'", m->reln); + return -1; + } + return matched; +@@ -2169,62 +2195,57 @@ magiccheck(struct magic_set *ms, struct magic *m) + } + case FILE_REGEX: { + int rc; +- file_regex_t rx; ++ file_regex_t *rx = *m_cache; + const char *search; ++ regmatch_t pmatch; ++ size_t slen = ms->search.s_len; ++ char *copy; + + if (ms->search.s == NULL) + return 0; + ++ if (rx == NULL) { ++ rx = *m_cache = alloc_regex(ms, m); ++ if (rx == NULL) ++ return -1; ++ } + l = 0; +- rc = file_regcomp(&rx, m->value.s, +- REG_EXTENDED|REG_NEWLINE| +- ((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)); +- if (rc) { +- file_regerror(&rx, rc, ms); +- v = CAST(uint64_t, -1); ++ if (slen != 0) { ++ copy = CAST(char *, malloc(slen)); ++ if (copy == NULL) { ++ file_error(ms, errno, ++ "can't allocate %" SIZE_T_FORMAT "u bytes", ++ slen); ++ return -1; ++ } ++ memcpy(copy, ms->search.s, slen); ++ copy[--slen] = '\0'; ++ search = copy; + } else { +- regmatch_t pmatch; +- size_t slen = ms->search.s_len; +- char *copy; +- if (slen != 0) { +- copy = CAST(char *, malloc(slen)); +- if (copy == NULL) { +- file_regfree(&rx); +- file_error(ms, errno, +- "can't allocate %" SIZE_T_FORMAT "u bytes", +- slen); +- return -1; +- } +- memcpy(copy, ms->search.s, slen); +- copy[--slen] = '\0'; +- search = copy; +- } else { +- search = CCAST(char *, ""); +- copy = NULL; +- } +- rc = file_regexec(&rx, RCAST(const char *, search), +- 1, &pmatch, 0); +- free(copy); +- switch (rc) { +- case 0: +- ms->search.s += CAST(int, pmatch.rm_so); +- ms->search.offset += CAST(size_t, pmatch.rm_so); +- ms->search.rm_len = CAST(size_t, +- pmatch.rm_eo - pmatch.rm_so); +- v = 0; +- break; ++ search = CCAST(char *, ""); ++ copy = NULL; ++ } ++ rc = file_regexec(rx, RCAST(const char *, search), ++ 1, &pmatch, 0); ++ free(copy); ++ switch (rc) { ++ case 0: ++ ms->search.s += CAST(int, pmatch.rm_so); ++ ms->search.offset += CAST(size_t, pmatch.rm_so); ++ ms->search.rm_len = CAST(size_t, ++ pmatch.rm_eo - pmatch.rm_so); ++ v = 0; ++ break; + +- case REG_NOMATCH: +- v = 1; +- break; ++ case REG_NOMATCH: ++ v = 1; ++ break; + +- default: +- file_regerror(&rx, rc, ms); +- v = CAST(uint64_t, -1); +- break; +- } ++ default: ++ file_regerror(rx, rc, ms); ++ v = CAST(uint64_t, -1); ++ break; + } +- file_regfree(&rx); + if (v == CAST(uint64_t, -1)) + return -1; + break; diff --git a/SOURCES/file-5.39-regex-caching-2.patch b/SOURCES/file-5.39-regex-caching-2.patch new file mode 100644 index 0000000..37d5339 --- /dev/null +++ b/SOURCES/file-5.39-regex-caching-2.patch @@ -0,0 +1,226 @@ +diff --git a/src/apprentice.c b/src/apprentice.c +index 21eac1e..781c5e1 100644 +--- a/src/apprentice.c ++++ b/src/apprentice.c +@@ -513,6 +513,9 @@ file_ms_free(struct magic_set *ms) + free(ms->o.pbuf); + free(ms->o.buf); + free(ms->c.li); ++#ifdef USE_C_LOCALE ++ freelocale(ms->c_lc_ctype); ++#endif + free(ms); + } + +@@ -551,6 +554,10 @@ file_ms_alloc(int flags) + ms->elf_notes_max = FILE_ELF_NOTES_MAX; + ms->regex_max = FILE_REGEX_MAX; + ms->bytes_max = FILE_BYTES_MAX; ++#ifdef USE_C_LOCALE ++ ms->c_lc_ctype = newlocale(LC_CTYPE_MASK, "C", 0); ++ assert(ms->c_lc_ctype != NULL); ++#endif + return ms; + free: + free(ms); +@@ -624,6 +631,7 @@ mlist_free_one(struct mlist *ml) + if (ml->magic_rxcomp[i]) { + file_regfree(ml->magic_rxcomp[i]); + free(ml->magic_rxcomp[i]); ++ ml->magic_rxcomp[i] = NULL; + } + } + free(ml->magic_rxcomp); +@@ -2714,7 +2722,8 @@ getvalue(struct magic_set *ms, struct magic *m, const char **p, int action) + } + if (m->type == FILE_REGEX) { + file_regex_t rx; +- int rc = file_regcomp(&rx, m->value.s, REG_EXTENDED); ++ int rc = file_regcomp(ms, &rx, m->value.s, ++ REG_EXTENDED); + if (rc) { + if (ms->flags & MAGIC_CHECK) + file_regerror(&rx, rc, ms); +diff --git a/src/file.h b/src/file.h +index c0b5a7c..f049446 100644 +--- a/src/file.h ++++ b/src/file.h +@@ -173,13 +173,6 @@ + + typedef struct { + const char *pat; +-#if defined(HAVE_NEWLOCALE) && defined(HAVE_USELOCALE) && defined(HAVE_FREELOCALE) +-#define USE_C_LOCALE +- locale_t old_lc_ctype; +- locale_t c_lc_ctype; +-#else +- char *old_lc_ctype; +-#endif + int rc; + regex_t rx; + } file_regex_t; +@@ -487,6 +480,10 @@ struct magic_set { + #define FILE_INDIR_MAX 50 + #define FILE_NAME_MAX 50 + #define FILE_REGEX_MAX 8192 ++#if defined(HAVE_NEWLOCALE) && defined(HAVE_USELOCALE) && defined(HAVE_FREELOCALE) ++#define USE_C_LOCALE ++ locale_t c_lc_ctype; ++#endif + }; + + /* Type for Unicode characters */ +@@ -574,9 +571,10 @@ protected int buffer_fill(const struct buffer *); + + + +-protected int file_regcomp(file_regex_t *, const char *, int); +-protected int file_regexec(file_regex_t *, const char *, size_t, regmatch_t *, ++protected int file_regcomp(struct magic_set *, file_regex_t *, const char *, + int); ++protected int file_regexec(struct magic_set *, file_regex_t *, const char *, ++ size_t, regmatch_t *, int); + protected void file_regfree(file_regex_t *); + protected void file_regerror(file_regex_t *, int, struct magic_set *); + +diff --git a/src/funcs.c b/src/funcs.c +index 6320cf2..1391a44 100644 +--- a/src/funcs.c ++++ b/src/funcs.c +@@ -613,13 +613,13 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep) + file_regex_t rx; + int rc, rv = -1; + +- rc = file_regcomp(&rx, pat, REG_EXTENDED); ++ rc = file_regcomp(ms, &rx, pat, REG_EXTENDED); + if (rc) { + file_regerror(&rx, rc, ms); + } else { + regmatch_t rm; + int nm = 0; +- while (file_regexec(&rx, ms->o.buf, 1, &rm, 0) == 0) { ++ while (file_regexec(ms, &rx, ms->o.buf, 1, &rm, 0) == 0) { + ms->o.buf[rm.rm_so] = '\0'; + if (file_printf(ms, "%s%s", rep, + rm.rm_eo != 0 ? ms->o.buf + rm.rm_eo : "") == -1) +@@ -634,34 +634,52 @@ out: + } + + protected int +-file_regcomp(file_regex_t *rx, const char *pat, int flags) ++file_regcomp(struct magic_set *ms, file_regex_t *rx, const char *pat, int flags) + { + #ifdef USE_C_LOCALE +- rx->c_lc_ctype = newlocale(LC_CTYPE_MASK, "C", 0); +- assert(rx->c_lc_ctype != NULL); +- rx->old_lc_ctype = uselocale(rx->c_lc_ctype); +- assert(rx->old_lc_ctype != NULL); ++ locale_t old = uselocale(ms->c_lc_ctype); ++ assert(old != NULL); + #else +- rx->old_lc_ctype = setlocale(LC_CTYPE, NULL); +- assert(rx->old_lc_ctype != NULL); +- rx->old_lc_ctype = strdup(rx->old_lc_ctype); +- assert(rx->old_lc_ctype != NULL); ++ char old[1024]; ++ strlcpy(old, setlocale(LC_CTYPE, NULL), sizeof(old)); + (void)setlocale(LC_CTYPE, "C"); + #endif + rx->pat = pat; + +- return rx->rc = regcomp(&rx->rx, pat, flags); ++ rx->rc = regcomp(&rx->rx, pat, flags); ++ ++#ifdef USE_C_LOCALE ++ uselocale(old); ++#else ++ (void)setlocale(LC_CTYPE, old); ++#endif ++ return rx->rc; + } + + protected int +-file_regexec(file_regex_t *rx, const char *str, size_t nmatch, +- regmatch_t* pmatch, int eflags) ++file_regexec(struct magic_set *ms, file_regex_t *rx, const char *str, ++ size_t nmatch, regmatch_t* pmatch, int eflags) + { ++#ifdef USE_C_LOCALE ++ locale_t old = uselocale(ms->c_lc_ctype); ++ assert(old != NULL); ++#else ++ char old[1024]; ++ strlcpy(old, setlocale(LC_CTYPE, NULL), sizeof(old)); ++ (void)setlocale(LC_CTYPE, "C"); ++#endif ++ int rc; + assert(rx->rc == 0); + /* XXX: force initialization because glibc does not always do this */ + if (nmatch != 0) + memset(pmatch, 0, nmatch * sizeof(*pmatch)); +- return regexec(&rx->rx, str, nmatch, pmatch, eflags); ++ rc = regexec(&rx->rx, str, nmatch, pmatch, eflags); ++#ifdef USE_C_LOCALE ++ uselocale(old); ++#else ++ (void)setlocale(LC_CTYPE, old); ++#endif ++ return rc; + } + + protected void +@@ -669,13 +687,6 @@ file_regfree(file_regex_t *rx) + { + if (rx->rc == 0) + regfree(&rx->rx); +-#ifdef USE_C_LOCALE +- (void)uselocale(rx->old_lc_ctype); +- freelocale(rx->c_lc_ctype); +-#else +- (void)setlocale(LC_CTYPE, rx->old_lc_ctype); +- free(rx->old_lc_ctype); +-#endif + } + + protected void +diff --git a/src/softmagic.c b/src/softmagic.c +index 43338fc..b4052a6 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -478,11 +478,11 @@ check_fmt(struct magic_set *ms, const char *fmt) + if (strchr(fmt, '%') == NULL) + return 0; + +- rc = file_regcomp(&rx, "%[-0-9\\.]*s", REG_EXTENDED|REG_NOSUB); ++ rc = file_regcomp(ms, &rx, "%[-0-9\\.]*s", REG_EXTENDED|REG_NOSUB); + if (rc) { + file_regerror(&rx, rc, ms); + } else { +- rc = file_regexec(&rx, fmt, 0, 0, 0); ++ rc = file_regexec(ms, &rx, fmt, 0, 0, 0); + rv = !rc; + } + file_regfree(&rx); +@@ -2003,11 +2003,12 @@ alloc_regex(struct magic_set *ms, struct magic *m) + return NULL; + } + +- rc = file_regcomp(rx, m->value.s, REG_EXTENDED | REG_NEWLINE | ++ rc = file_regcomp(ms, rx, m->value.s, REG_EXTENDED | REG_NEWLINE | + ((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)); + if (rc == 0) + return rx; + ++fprintf(stderr, "regcomp %s %d\n", m->value.s, rc); + file_regerror(rx, rc, ms); + file_regfree(rx); + free(rx); +@@ -2225,7 +2226,7 @@ magiccheck(struct magic_set *ms, struct magic *m, file_regex_t **m_cache) + search = CCAST(char *, ""); + copy = NULL; + } +- rc = file_regexec(rx, RCAST(const char *, search), ++ rc = file_regexec(ms, rx, RCAST(const char *, search), + 1, &pmatch, 0); + free(copy); + switch (rc) { diff --git a/SOURCES/file-5.39-regex-caching-3.patch b/SOURCES/file-5.39-regex-caching-3.patch new file mode 100644 index 0000000..0a9e0a0 --- /dev/null +++ b/SOURCES/file-5.39-regex-caching-3.patch @@ -0,0 +1,28 @@ +From d1a00ae92b2cf09298615cf3aba474d8fec7380f Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Mon, 18 Apr 2022 21:46:43 +0000 +Subject: [PATCH] From Dirk Mueller: + +when name/use was used, the regex caching table was incorrectly +initialized, which led to false or missing matches. +--- + src/apprentice.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/apprentice.c b/src/apprentice.c +index 804c0e33e..992102b4e 100644 +--- a/src/apprentice.c ++++ b/src/apprentice.c +@@ -3678,11 +3678,11 @@ file_magicfind(struct magic_set *ms, const char *name, struct mlist *v) + continue; + if (strcmp(ma[i].value.s, name) == 0) { + v->magic = &ma[i]; ++ v->magic_rxcomp = &(ml->magic_rxcomp[i]); + for (j = i + 1; j < ml->nmagic; j++) + if (ma[j].cont_level == 0) + break; + v->nmagic = j - i; +- v->magic_rxcomp = ml->magic_rxcomp; + return 0; + } + } diff --git a/SOURCES/file-5.39-regex-caching-4.patch b/SOURCES/file-5.39-regex-caching-4.patch new file mode 100644 index 0000000..41b6fd0 --- /dev/null +++ b/SOURCES/file-5.39-regex-caching-4.patch @@ -0,0 +1,164 @@ +diff --git a/src/apprentice.c b/src/apprentice.c +index 781c5e1..50a91cf 100644 +--- a/src/apprentice.c ++++ b/src/apprentice.c +@@ -2724,11 +2724,9 @@ getvalue(struct magic_set *ms, struct magic *m, const char **p, int action) + file_regex_t rx; + int rc = file_regcomp(ms, &rx, m->value.s, + REG_EXTENDED); +- if (rc) { +- if (ms->flags & MAGIC_CHECK) +- file_regerror(&rx, rc, ms); ++ if (rc == 0) { ++ file_regfree(&rx); + } +- file_regfree(&rx); + return rc ? -1 : 0; + } + return 0; +diff --git a/src/file.h b/src/file.h +index f049446..ee15855 100644 +--- a/src/file.h ++++ b/src/file.h +@@ -171,11 +171,7 @@ + #define FILE_COMPILE 2 + #define FILE_LIST 3 + +-typedef struct { +- const char *pat; +- int rc; +- regex_t rx; +-} file_regex_t; ++typedef regex_t file_regex_t; + + struct buffer { + int fd; +@@ -576,7 +572,6 @@ protected int file_regcomp(struct magic_set *, file_regex_t *, const char *, + protected int file_regexec(struct magic_set *, file_regex_t *, const char *, + size_t, regmatch_t *, int); + protected void file_regfree(file_regex_t *); +-protected void file_regerror(file_regex_t *, int, struct magic_set *); + + typedef struct { + char *buf; +diff --git a/src/funcs.c b/src/funcs.c +index 1391a44..df436eb 100644 +--- a/src/funcs.c ++++ b/src/funcs.c +@@ -614,9 +614,7 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep) + int rc, rv = -1; + + rc = file_regcomp(ms, &rx, pat, REG_EXTENDED); +- if (rc) { +- file_regerror(&rx, rc, ms); +- } else { ++ if (rc == 0) { + regmatch_t rm; + int nm = 0; + while (file_regexec(ms, &rx, ms->o.buf, 1, &rm, 0) == 0) { +@@ -644,16 +642,22 @@ file_regcomp(struct magic_set *ms, file_regex_t *rx, const char *pat, int flags) + strlcpy(old, setlocale(LC_CTYPE, NULL), sizeof(old)); + (void)setlocale(LC_CTYPE, "C"); + #endif +- rx->pat = pat; +- +- rx->rc = regcomp(&rx->rx, pat, flags); ++ int rc; ++ rc = regcomp(rx, pat, flags); + + #ifdef USE_C_LOCALE + uselocale(old); + #else + (void)setlocale(LC_CTYPE, old); + #endif +- return rx->rc; ++ if (rc > 0 && (ms->flags & MAGIC_CHECK)) { ++ char errmsg[512]; ++ ++ (void)regerror(rc, rx, errmsg, sizeof(errmsg)); ++ file_magerror(ms, "regex error %d for `%s', (%s)", rc, pat, ++ errmsg); ++ } ++ return rc; + } + + protected int +@@ -669,11 +673,10 @@ file_regexec(struct magic_set *ms, file_regex_t *rx, const char *str, + (void)setlocale(LC_CTYPE, "C"); + #endif + int rc; +- assert(rx->rc == 0); + /* XXX: force initialization because glibc does not always do this */ + if (nmatch != 0) + memset(pmatch, 0, nmatch * sizeof(*pmatch)); +- rc = regexec(&rx->rx, str, nmatch, pmatch, eflags); ++ rc = regexec(rx, str, nmatch, pmatch, eflags); + #ifdef USE_C_LOCALE + uselocale(old); + #else +@@ -685,18 +688,7 @@ file_regexec(struct magic_set *ms, file_regex_t *rx, const char *str, + protected void + file_regfree(file_regex_t *rx) + { +- if (rx->rc == 0) +- regfree(&rx->rx); +-} +- +-protected void +-file_regerror(file_regex_t *rx, int rc, struct magic_set *ms) +-{ +- char errmsg[512]; +- +- (void)regerror(rc, &rx->rx, errmsg, sizeof(errmsg)); +- file_magerror(ms, "regex error %d for `%s', (%s)", rc, rx->pat, +- errmsg); ++ regfree(rx); + } + + protected file_pushbuf_t * +diff --git a/src/softmagic.c b/src/softmagic.c +index b4052a6..f469a12 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -474,14 +474,13 @@ check_fmt(struct magic_set *ms, const char *fmt) + { + file_regex_t rx; + int rc, rv = -1; ++ const char* pat = "%[-0-9\\.]*s"; + + if (strchr(fmt, '%') == NULL) + return 0; + +- rc = file_regcomp(ms, &rx, "%[-0-9\\.]*s", REG_EXTENDED|REG_NOSUB); +- if (rc) { +- file_regerror(&rx, rc, ms); +- } else { ++ rc = file_regcomp(ms, &rx, pat, REG_EXTENDED|REG_NOSUB); ++ if (rc == 0) { + rc = file_regexec(ms, &rx, fmt, 0, 0, 0); + rv = !rc; + } +@@ -2008,9 +2007,6 @@ alloc_regex(struct magic_set *ms, struct magic *m) + if (rc == 0) + return rx; + +-fprintf(stderr, "regcomp %s %d\n", m->value.s, rc); +- file_regerror(rx, rc, ms); +- file_regfree(rx); + free(rx); + return NULL; + } +@@ -2243,12 +2239,9 @@ magiccheck(struct magic_set *ms, struct magic *m, file_regex_t **m_cache) + break; + + default: +- file_regerror(rx, rc, ms); +- v = CAST(uint64_t, -1); ++ return -1; + break; + } +- if (v == CAST(uint64_t, -1)) +- return -1; + break; + } + case FILE_INDIRECT: diff --git a/SOURCES/file-5.39-regex-combinations.patch b/SOURCES/file-5.39-regex-combinations.patch new file mode 100644 index 0000000..4852762 --- /dev/null +++ b/SOURCES/file-5.39-regex-combinations.patch @@ -0,0 +1,58 @@ +From a4b3abc4104d8a4eeb84a6242f2f1a830204a539 Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Sat, 12 Mar 2022 15:09:47 +0000 +Subject: [PATCH] Combine regex's to improve performance adjusting strength to + preserve ranking (Dirk Mueller) + +--- + magic/Magdir/make | 29 +++++++---------------------- + 1 file changed, 7 insertions(+), 22 deletions(-) + +diff --git a/magic/Magdir/make b/magic/Magdir/make +index f522b4f18..1abdf7a3e 100644 +--- a/magic/Magdir/make ++++ b/magic/Magdir/make +@@ -1,36 +1,21 @@ + #------------------------------------------------------------------------------ +-# $File: make,v 1.4 2018/05/29 17:26:02 christos Exp $ ++# $File: make,v 1.5 2022/03/12 15:09:47 christos Exp $ + # make: file(1) magic for makefiles + # + # URL: https://en.wikipedia.org/wiki/Make_(software) +-0 regex/100l \^CFLAGS makefile script text +-!:mime text/x-makefile +-0 regex/100l \^VPATH makefile script text +-!:mime text/x-makefile +-0 regex/100l \^LDFLAGS makefile script text +-!:mime text/x-makefile +-0 regex/100l \^all: makefile script text +-!:mime text/x-makefile +-0 regex/100l \^\\.PRECIOUS makefile script text ++0 regex/100l \^(CFLAGS|VPATH|LDFLAGS|all:|\\.PRECIOUS) makefile script text + !:mime text/x-makefile ++!:strength -15 + # Update: Joerg Jenderek + # Reference: https://www.freebsd.org/cgi/man.cgi?make(1) + # exclude grub-core\lib\libgcrypt\mpi\Makefile.am with "#BEGIN_ASM_LIST" + # by additional escaping point character +-0 regex/100l \^\\.BEGIN BSD makefile script text +-!:mime text/x-makefile +-!:ext /mk +-!:strength +10 + # exclude MS Windows help file CoNtenT with ":include FOOBAR.CNT" + # and NSIS script with "!include" by additional escaping point character +-0 regex/100l \^\\.include BSD makefile script text +-!:mime text/x-makefile +-!:ext /mk +-!:strength +10 +-0 regex/100l \^\\.endif BSD makefile script text ++0 regex/100l \^\\.(BEGIN|endif|include) BSD makefile script text + !:mime text/x-makefile + !:ext /mk +-!:strength +10 +-0 regex/100l \^SUBDIRS automake makefile script text ++!:strength -10 ++0 regex/100l \^SUBDIRS[[:space:]]+= automake makefile script text + !:mime text/x-makefile +-!:strength +10 ++!:strength -15 diff --git a/SOURCES/file-5.39-regex-escape.patch b/SOURCES/file-5.39-regex-escape.patch new file mode 100644 index 0000000..e6471b2 --- /dev/null +++ b/SOURCES/file-5.39-regex-escape.patch @@ -0,0 +1,86 @@ +diff --git a/magic/Magdir/archive b/magic/Magdir/archive +index 99798b0..945f536 100644 +--- a/magic/Magdir/archive ++++ b/magic/Magdir/archive +@@ -150,7 +150,7 @@ + # Incremental snapshot gnu-tar format from: + # https://www.gnu.org/software/tar/manual/html_node/Snapshot-Files.html + 0 string GNU\ tar- GNU tar incremental snapshot data +->&0 regex [0-9]\.[0-9]+-[0-9]+ version %s ++>&0 regex [0-9]\\.[0-9]+-[0-9]+ version %s + + # cpio archives + # +diff --git a/magic/Magdir/ctf b/magic/Magdir/ctf +index ebea8f3..d91684d 100644 +--- a/magic/Magdir/ctf ++++ b/magic/Magdir/ctf +@@ -20,4 +20,4 @@ + # CTF metadata (plain text) + 0 string /*\x20CTF\x20 Common Trace Format (CTF) plain text metadata + !:strength + 5 # this is to make sure we beat C +->&0 regex [0-9]+\.[0-9]+ \b, v%s ++>&0 regex [0-9]+\\.[0-9]+ \b, v%s +diff --git a/magic/Magdir/geo b/magic/Magdir/geo +index d72e514..dda5f73 100644 +--- a/magic/Magdir/geo ++++ b/magic/Magdir/geo +@@ -1,6 +1,6 @@ + + #------------------------------------------------------------------------------ +-# $File: geo,v 1.7 2019/04/19 00:42:27 christos Exp $ ++# $File: geo,v 1.8 2022/03/24 15:48:58 christos Exp $ + # Geo- files from Kurt Schwehr + + ###################################################################### +@@ -28,8 +28,8 @@ + # Knudsen subbottom chirp profiler - Binary File Format: B9 + # KEB D409-03167 V1.75 Huffman + 0 string KEB\ Knudsen seismic KEL binary (KEB) - +->4 regex [-A-Z0-9]* Software: %s +->>&1 regex V[0-9]*\.[0-9]* version %s ++>4 regex [-A-Z0-9]+ Software: %s ++>>&1 regex V[0-9]+\\.[0-9]+ version %s + + ###################################################################### + # +@@ -40,7 +40,7 @@ + + # Caris LIDAR format for LADS comes as two parts... ascii location file and binary waveform data + 0 string HCA LADS Caris Ascii Format (CAF) bathymetric lidar +->4 regex [0-9]*\.[0-9]* version %s ++>4 regex [0-9]+\\.[0-9]+ version %s + + 0 string HCB LADS Caris Binary Format (CBF) bathymetric lidar waveform data + >3 byte x version %d . +@@ -69,7 +69,7 @@ + + # mb121 https://www.saic.com/maritime/gsf/ + 8 string GSF-v SAIC generic sensor format (GSF) sonar data, +->&0 regex [0-9]*\.[0-9]* version %s ++>&0 regex [0-9]+\\.[0-9]+ version %s + + # MGD77 - https://www.ngdc.noaa.gov/mgg/dat/geodas/docs/mgd77.htm + # mb161 +diff --git a/magic/Magdir/windows b/magic/Magdir/windows +index 8a7923f..1247e03 100644 +--- a/magic/Magdir/windows ++++ b/magic/Magdir/windows +@@ -358,7 +358,7 @@ + # skip space at beginning + >0 string \040 + # name without extension and greater character or name with hlp extension +->>1 regex/c \^([^\xd>]*|.*\.hlp) MS Windows help file Content, based "%s" ++>>1 regex/c \^([^\xd>]*|.*\\.hlp) MS Windows help file Content, based "%s" + !:mime text/plain + !:apple ????TEXT + !:ext cnt +@@ -535,7 +535,7 @@ + # http://www.winfaq.de/faq_html/Content/tip2500/onlinefaq.php?h=tip2653.htm + # https://msdn.microsoft.com/en-us/library/windows/desktop/cc144102.aspx + # .ShellClassInfo DeleteOnCopy LocalizedFileNames ASCII coded case-independent +->>&0 regex/c \^(\.ShellClassInfo|DeleteOnCopy|LocalizedFileNames)] Windows desktop.ini ++>>&0 regex/1024c \^(\\.ShellClassInfo|DeleteOnCopy|LocalizedFileNames)] Windows desktop.ini + !:mime application/x-wine-extension-ini + #!:mime text/plain + # https://support.microsoft.com/kb/84709/ diff --git a/SOURCES/file-5.39-regex-optimalizations.patch b/SOURCES/file-5.39-regex-optimalizations.patch new file mode 100644 index 0000000..d7ccc4e --- /dev/null +++ b/SOURCES/file-5.39-regex-optimalizations.patch @@ -0,0 +1,79 @@ +From 14b5d7aa0b55275969809fdf84e8a8caee857c0f Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Mon, 18 Apr 2022 21:38:10 +0000 +Subject: [PATCH] From Dirk Mueller: * regex rules need literal dots escaped, + otherwise they are considered any character * literal search strings can be + searched using search rather than the much more expensive regex * use + standard xml declaration search as used in other format matchers * only match + the first 1024 bytes, the information we look for should be in the very + first tag * remove unnecessary parentheses + +--- + magic/Magdir/dataone | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +diff --git a/magic/Magdir/dataone b/magic/Magdir/dataone +index 8ef3f7981..566633eff 100644 +--- a/magic/Magdir/dataone ++++ b/magic/Magdir/dataone +@@ -1,6 +1,6 @@ + + #------------------------------------------------------------------------------ +-# $File: dataone,v 1.2 2019/04/19 00:42:27 christos Exp $ ++# $File: dataone,v 1.3 2022/04/18 21:38:10 christos Exp $ + # + # DataONE- files from Dave Vieglais & + # Pratik Shrivastava +@@ -9,39 +9,39 @@ + #------------------------------------------------------------------------------ + + # EML (Ecological Metadata Language Format) +-0 string &0 regex (eml)-[0-9].[0-9].[0-9]+ eml://ecoinformatics.org/%s ++0 string \&0 regex/1024 eml-[0-9]\\.[0-9]\\.[0-9]+ eml://ecoinformatics.org/%s + + # onedcx (DataONE Dublin Core Extended v1.0) +->&0 regex (onedcx/v)[0-9].[0-9]+ https://ns.dataone.org/metadata/schema/onedcx/v1.0 ++>&0 regex/1024 onedcx/v[0-9]\\.[0-9]+ https://ns.dataone.org/metadata/schema/onedcx/v1.0 + + # FGDC-STD-001-1998 (Content Standard for Digital Geospatial Metadata, + # version 001-1998) +->&0 regex fgdc FGDC-STD-001-1998 ++>&0 search/1024 fgdc FGDC-STD-001-1998 + + # Mercury (Oak Ridge National Lab Mercury Metadata version 1.0) +->&0 regex (mercury/terms/v)[0-9].[0-9] https://purl.org/ornl/schema/mercury/terms/v1.0 ++>&0 regex/1024 mercury/terms/v[0-9]\\.[0-9] https://purl.org/ornl/schema/mercury/terms/v1.0 + + # ISOTC211 (Geographic MetaData (GMD) Extensible Markup Language) +->&0 regex isotc211 +->>&0 regex eng;USA https://www.isotc211.org/2005/gmd ++>&0 search/1024 isotc211 ++>>&0 search/1024 eng;USA https://www.isotc211.org/2005/gmd + + # ISOTC211 (NOAA Variant Geographic MetaData (GMD) Extensible Markup Language) +->>&0 regex gov.noaa.nodc:[0-9]+ https://www.isotc211.org/2005/gmd-noaa ++>>&0 regex/1024 gov\\.noaa\\.nodc:[0-9]+ https://www.isotc211.org/2005/gmd-noaa + + # ISOTC211 PANGAEA Variant Geographic MetaData (GMD) Extensible Markup Language +->>&0 regex pangaea.dataset[0-9][0-9][0-9][0-9][0-9][0-9]+ https://www.isotc211.org/2005/gmd-pangaea ++>>&0 regex/1024 pangaea\\.dataset[0-9][0-9][0-9][0-9][0-9][0-9]+ https://www.isotc211.org/2005/gmd-pangaea + !:mime text/xml + + + # Object Reuse and Exchange Vocabulary +-0 string &0 regex rdf +->>&0 regex openarchives https://www.openarchives.org/ore/terms ++0 string \&0 search/1024 rdf ++>>&0 search/1024 openarchives https://www.openarchives.org/ore/terms + !:mime application/rdf+xml + + + # Dryad Metadata Application Profile Version 3.1 + 0 string &0 regex (dryad-bibo/v)[0-9].[0-9] https://datadryad.org/profile/v3.1 ++>&0 regex/1024 dryad-bibo/v[0-9]\\.[0-9] https://datadryad.org/profile/v3.1 + !:mime text/xml diff --git a/SOURCES/file-5.40-magic-python.patch b/SOURCES/file-5.40-magic-python.patch new file mode 100644 index 0000000..4b38590 --- /dev/null +++ b/SOURCES/file-5.40-magic-python.patch @@ -0,0 +1,319 @@ +diff --git a/magic/Magdir/python b/magic/Magdir/python +index 9d306c0..bc5163e 100644 +--- a/magic/Magdir/python ++++ b/magic/Magdir/python +@@ -10,211 +10,211 @@ + # MAGIC as specified in Python/import.c (1.0 to 3.7) + # two bytes of magic followed by "\r\n" in little endian order + 0 belong 0x02099900 python 1.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x03099900 python 1.1/1.2 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x892e0d0a python 1.3 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x04170d0a python 1.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x994e0d0a python 1.5 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xfcc40d0a python 1.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xfdc40d0a python 1.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x87c60d0a python 2.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x88c60d0a python 2.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x2aeb0d0a python 2.1 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x2beb0d0a python 2.1 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x2ded0d0a python 2.2 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x2eed0d0a python 2.2 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x3bf20d0a python 2.3 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x3cf20d0a python 2.3 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x45f20d0a python 2.3 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x59f20d0a python 2.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x63f20d0a python 2.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x6df20d0a python 2.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x6ef20d0a python 2.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x77f20d0a python 2.5 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x81f20d0a python 2.5 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x8bf20d0a python 2.5 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x8cf20d0a python 2.5 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x95f20d0a python 2.5 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x9ff20d0a python 2.5 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xa9f20d0a python 2.5 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xb3f20d0a python 2.5 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xb4f20d0a python 2.5 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xc7f20d0a python 2.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xd1f20d0a python 2.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xd2f20d0a python 2.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xdbf20d0a python 2.7 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xe5f20d0a python 2.7 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xeff20d0a python 2.7 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xf9f20d0a python 2.7 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x03f30d0a python 2.7 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x04f30d0a python 2.7 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xb80b0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xc20b0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xcc0b0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xd60b0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xe00b0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xea0b0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xf40b0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xf50b0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xff0b0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x090c0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x130c0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x1d0c0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x1f0c0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x270c0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x3b0c0d0a python 3.0 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x450c0d0a python 3.1 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x4f0c0d0a python 3.1 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x580c0d0a python 3.2 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x620c0d0a python 3.2 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x6c0c0d0a python 3.2 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x760c0d0a python 3.3 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x800c0d0a python 3.3 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x8a0c0d0a python 3.3 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x940c0d0a python 3.3 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x9e0c0d0a python 3.3 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xb20c0d0a python 3.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xbc0c0d0a python 3.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xc60c0d0a python 3.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xd00c0d0a python 3.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xda0c0d0a python 3.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xe40c0d0a python 3.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xee0c0d0a python 3.4 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0xf80c0d0a python 3.5.1- byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x020d0d0a python 3.5.1- byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x0c0d0d0a python 3.5.1- byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x160d0d0a python 3.5.1- byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x170d0d0a python 3.5.2+ byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x200d0d0a python 3.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x210d0d0a python 3.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x2a0d0d0a python 3.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x2b0d0d0a python 3.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x2c0d0d0a python 3.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x2d0d0d0a python 3.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x2f0d0d0a python 3.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x300d0d0a python 3.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x310d0d0a python 3.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x320d0d0a python 3.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x330d0d0a python 3.6 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x3e0d0d0a python 3.7 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x3f0d0d0a python 3.7 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x400d0d0a python 3.7 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x410d0d0a python 3.7 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x420d0d0a python 3.7 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x480d0d0a python 3.8 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x490d0d0a python 3.8 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x520d0d0a python 3.8 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x530d0d0a python 3.8 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x540d0d0a python 3.8 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x550d0d0a python 3.8 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x5c0d0d0a python 3.9 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x5d0d0d0a python 3.9 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x5e0d0d0a python 3.9 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x5f0d0d0a python 3.9 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x600d0d0a python 3.9 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + 0 belong 0x610d0d0a python 3.9 byte-compiled +-!:mime text/x-bytecode.python ++!:mime application/x-bytecode.python + + 0 search/1/w #!\040/usr/bin/python Python script text executable + !:strength + 15 diff --git a/SOURCES/file-localmagic.patch b/SOURCES/file-localmagic.patch new file mode 100644 index 0000000..ffa0351 --- /dev/null +++ b/SOURCES/file-localmagic.patch @@ -0,0 +1,62 @@ +From 95c993ff6bdfe92a7f519c4db60157a421e65b38 Mon Sep 17 00:00:00 2001 +From: Siteshwar Vashisht +Date: Thu, 21 Feb 2019 15:26:38 +0100 +Subject: [PATCH] Upstream says it's up to distributions to add a way to + support local-magic. + +--- + magic/magic.local | 3 +++ + src/Makefile.am | 2 +- + src/Makefile.in | 2 +- + src/apprentice.c | 2 +- + 4 files changed, 6 insertions(+), 3 deletions(-) + create mode 100644 magic/magic.local + +diff --git a/magic/magic.local b/magic/magic.local +new file mode 100644 +index 0000000..283a863 +--- /dev/null ++++ b/magic/magic.local +@@ -0,0 +1,3 @@ ++# Magic local data for file(1) command. ++# Insert here your local magic data. Format is described in magic(5). ++ +diff --git a/src/Makefile.am b/src/Makefile.am +index 3f67f2c..b43cb8e 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -1,4 +1,4 @@ +-MAGIC = $(pkgdatadir)/magic ++MAGIC = /etc/magic:$(pkgdatadir)/magic + lib_LTLIBRARIES = libmagic.la + nodist_include_HEADERS = magic.h + +diff --git a/src/Makefile.in b/src/Makefile.in +index 59f3b5e..a8f56cf 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -356,7 +356,7 @@ target_alias = @target_alias@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ +-MAGIC = $(pkgdatadir)/magic ++MAGIC = /etc/magic:$(pkgdatadir)/magic + lib_LTLIBRARIES = libmagic.la + nodist_include_HEADERS = magic.h + AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"' +diff --git a/src/apprentice.c b/src/apprentice.c +index 1437bcc..b609dd1 100644 +--- a/src/apprentice.c ++++ b/src/apprentice.c +@@ -460,7 +460,7 @@ apprentice_1(struct magic_set *ms, const char *fn, int action) + #ifndef COMPILE_ONLY + map = apprentice_map(ms, fn); + if (map == NULL) { +- if (ms->flags & MAGIC_CHECK) ++ if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0) + file_magwarn(ms, "using regular magic file `%s'", fn); + map = apprentice_load(ms, fn, action); + if (map == NULL) +-- +2.25.4 + diff --git a/SPECS/file.spec b/SPECS/file.spec new file mode 100644 index 0000000..bd51b91 --- /dev/null +++ b/SPECS/file.spec @@ -0,0 +1,1278 @@ +# python3 is not available on RHEL <= 7 +%if 0%{?fedora} || 0%{?rhel} > 7 +%bcond_without python3 +%else +%bcond_with python3 +%endif + +# python2 is not available on RHEL > 7 +%if 0%{?fedora} > 31 || 0%{?rhel} > 7 +%bcond_with python2 +%else +%bcond_without python2 +%endif + +Summary: Utility for determining file types +Name: file +Version: 5.39 +Release: 10%{?dist} +License: BSD +Source0: http://ftp.astron.com/pub/file/file-%{version}.tar.gz + +# Upstream says it's up to distributions to add a way to support local-magic. +Patch0: file-localmagic.patch + +# not yet upstream +Patch1: file-4.17-rpm-name.patch +Patch2: file-5.04-volume_key.patch + +# Fix close_on_exec multithreaded decompression issue (#1906751) +Patch3: file-5.39-CLOEXEC.patch + +# Upstream commit 7d9b0f0d853957ad88dae0f440fecd58d2740ca7 (#1963892) +Patch4: file-5.40-magic-python.patch + +# not yet upstream +Patch5: file-5.33-fix-compression.patch + +# Upstream commit 4c8a4d8dbab1e73bfb30e391dcec49fcf269f84d (#2120692) +Patch6: file-5.39-regex-caching-1.patch +# Upstream commit 7d438e28c16773e28a3707935c8e5d9927a515a7 (#2120692) +Patch7: file-5.39-regex-caching-2.patch +# Upstream commit d1a00ae92b2cf09298615cf3aba474d8fec7380f (#2120692) +Patch8: file-5.39-regex-caching-3.patch +# Upstream commit 4254a0afecfd2ae200c694dfcf93f4b4ac21652e (#2120692) +Patch9: file-5.39-regex-caching-4.patch +# Upstream commit a4b3abc4104d8a4eeb84a6242f2f1a830204a539 (#2120692) +Patch10: file-5.39-regex-combinations.patch +# Upstream commit d17d8e9ff8ad8e95fdf66239ccdcc2133d1ce5ce (#2120692) +Patch11: file-5.39-regex-escape.patch +# Upstream commit 14b5d7aa0b55275969809fdf84e8a8caee857c0f (#2120692) +Patch12: file-5.39-regex-optimalizations.patch + +URL: https://www.darwinsys.com/file/ +Requires: file-libs%{?_isa} = %{version}-%{release} +BuildRequires: zlib-devel +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRequires: make + +%description +The file command is used to identify a particular file according to the +type of data contained by the file. File can identify many different +file types, including ELF binaries, system libraries, RPM packages, and +different graphics formats. + +%package libs +Summary: Libraries for applications using libmagic +License: BSD + +%description libs + +Libraries for applications using libmagic. + +%package devel +Summary: Libraries and header files for file development +Requires: file-libs%{?_isa} = %{version}-%{release} + +%description devel +The file-devel package contains the header files and libmagic library +necessary for developing programs using libmagic. + +%package static +Summary: Static library for file development +Requires: file-devel = %{version}-%{release} + +%description static +The file-static package contains the static version of the libmagic library. + +%if %{with python2} +%package -n python2-magic +Summary: Python 2 bindings for the libmagic API +BuildRequires: python2-devel +BuildRequires: python2-setuptools +BuildArch: noarch +Requires: %{name} = %{version}-%{release} +%{?python_provide:%python_provide python2-magic} + +%description -n python2-magic +This package contains the Python 2 bindings to allow access to the +libmagic API. The libmagic library is also used by the familiar +file(1) command. +%endif + +%if %{with python3} +%package -n python3-file-magic +Summary: Python 3 bindings for the libmagic API +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildArch: noarch +Requires: %{name} = %{version}-%{release} +Provides: python3-magic = %{version}-%{release} +Obsoletes: python3-magic < %{version}-%{release} +Conflicts: python3-magic < %{version}-%{release} + +%description -n python3-file-magic +This package contains the Python 3 bindings to allow access to the +libmagic API. The libmagic library is also used by the familiar +file(1) command. +%endif + +%prep +%autosetup -p1 + +iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_ +touch -r doc/libmagic.man doc/libmagic.man_ +mv doc/libmagic.man_ doc/libmagic.man + +%if %{with python3} +rm -rf %{py3dir} +cp -a python %{py3dir} +%endif + +%build +# Fix config.guess to find aarch64 - #925339 +autoreconf -fi + +CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" \ +%configure --enable-fsect-man5 --disable-rpath --enable-static +# remove hardcoded library paths from local libtool +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/src/.libs +%make_build +%if %{with python2} +cd python +CFLAGS="%{optflags}" %{__python2} setup.py build +%endif +%if %{with python3} +cd %{py3dir} +CFLAGS="%{optflags}" %{__python3} setup.py build +%endif + +%install +mkdir -p ${RPM_BUILD_ROOT}%{_bindir} +mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1 +mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5 +mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/misc +mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/file + +%make_install +rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la + +# local magic in /etc/magic +mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir} +cp -a ./magic/magic.local ${RPM_BUILD_ROOT}%{_sysconfdir}/magic + +cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic +ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic +ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic + +%if %{with python2} +cd python +%{__python2} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} +%endif +%if %{with python3} +cd %{py3dir} +%{__python3} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} +%endif +%{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name} + +%ldconfig_scriptlets libs + +%files +%license COPYING +%doc ChangeLog README +%{_bindir}/* +%{_mandir}/man1/* +%config(noreplace) %{_sysconfdir}/magic + +%files libs +%license COPYING +%doc ChangeLog README +%{_libdir}/*so.* +%{_datadir}/magic* +%{_mandir}/man5/* +%{_datadir}/file +%{_datadir}/misc/* + +%files devel +%{_libdir}/*.so +%{_includedir}/magic.h +%{_mandir}/man3/* +%{_libdir}/pkgconfig/libmagic.pc + +%files static +%{_libdir}/libmagic.a + +%if %{with python2} +%files -n python2-magic +%license COPYING +%doc python/README.md python/example.py +%{python2_sitelib}/magic.py +%{python2_sitelib}/magic.pyc +%{python2_sitelib}/magic.pyo +%if 0%{?fedora} || 0%{?rhel} >= 6 +%{python2_sitelib}/*egg-info +%endif +%endif + +%if %{with python3} +%files -n python3-file-magic +%license COPYING +%doc python/README.md python/example.py +%{python3_sitelib}/magic.py +%{python3_sitelib}/*egg-info +%{python3_sitelib}/__pycache__/* +%endif + +%changelog +* Wed Aug 24 2022 Vincent Mihalkovic - 5.39-10 +- speedup magic matching + Resolves: #2120692 + +* Wed Aug 17 2022 Vincent Mihalkovic - 5.39-9 +- fix recognition (src/compress.c) of compressed empty files + Resolves: #2121694 + +* Mon Aug 09 2021 Mohan Boddu - 5.39-8 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Mon Aug 9 2021 Vincent Mihalkovic - 5.39-7 +- do not classify python bytecode files as text. + Resolves: #1963892 + +* Thu Apr 15 2021 Mohan Boddu - 5.39-6 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Tue Jan 26 2021 Fedora Release Engineering - 5.39-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Dec 16 2020 Vincent Mihalkovic - 5.39-4 +- Fix close_on_exec multithreaded decompression issue (#1906751) + +* Mon Jul 27 2020 Fedora Release Engineering - 5.39-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jun 24 2020 Vincent Mihalkovic - 5.39-2 +- BuildRequires: python3-setuptools + +* Tue Jun 16 2020 Vincent Mihalkovic - 5.39-1 +- update to new version 5.39 + +* Wed May 27 2020 Miro Hrončok - 5.38-6 +- Rebuilt for Python 3.9 + +* Tue May 26 2020 Vincent Mihalkovič - 5.38-5 +- increase CDROM strength to beat MBR (#1696798) + +* Sat May 23 2020 Miro Hrončok - 5.38-4 +- Rebuilt for Python 3.9 + +* Wed Mar 11 2020 Vincent Mihalkovič - 5.38-3 +- use python3-file-magic instead of python3-magic (#1793689) + +* Tue Jan 28 2020 Fedora Release Engineering - 5.38-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Tue Dec 17 2019 Kamil Dudka - 5.38-1 +- update to new version 5.38 + +* Mon Nov 18 2019 Kamil Dudka - 5.37-9 +- remove wrong magic for JFFS file system (#1771242) + +* Fri Oct 25 2019 Kamil Dudka - 5.37-8 +- fix heap-based buffer overflow in cdf_read_property_info() (CVE-2019-18218) + +* Mon Oct 14 2019 Kamil Dudka - 5.37-7 +- remove the python2-magic subpackage on f32+ (#1761223) + +* Fri Oct 04 2019 Kamil Dudka - 5.37-6 +- always install python2-setuptools if python2 is enabled + +* Thu Oct 03 2019 Miro Hrončok - 5.37-5 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Fri Aug 16 2019 Miro Hrončok - 5.37-4 +- Rebuilt for Python 3.8 + +* Thu Jul 25 2019 Fedora Release Engineering - 5.37-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue Jun 11 2019 Kamil Dudka - 5.37-2 +- fix double free on read error (#1685217) + +* Fri May 17 2019 Kamil Dudka - 5.37-1 +- update to new version 5.37 + +* Fri Mar 01 2019 Kamil Dudka - 5.36-2 +- improve support for Apple formats (#1679455) + +* Thu Feb 21 2019 Siteshwar Vashisht - 5.36-1 +- update to new version 5.36, which fixes the following vulnerabilities: + CVE-2019-8907 - remote denial of service in do_core_note in readelf.c + CVE-2019-8905 - stack-based buffer over-read in do_core_note in readelf.c + CVE-2019-8904 - stack-based buffer over-read in do_bid_note in readelf.c + CVE-2019-8906 - out-of-bounds read in do_core_note in readelf.c + +* Thu Jan 31 2019 Fedora Release Engineering - 5.35-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jan 24 2019 Ondrej Dubaj - 5.35-4 +- Added Linux PowerPC core offsets for Linux + fixed bug #1161911 + +* Thu Jan 24 2019 Ondrej Dubaj - 5.35-3 +- Fixed bug missidentifying netpbm files (#856092) + +* Tue Dec 04 2018 Ondrej Dubaj - 5.35-2 +- Fixed bug misleading qcow2 v2 and v3 files (#1654349) + +* Tue Dec 04 2018 Kamil Dudka - 5.35-1 +- update to new version 5.35 + +* Wed Nov 21 2018 Ondrej Dubaj - 5.34-6 +- Fixed missidentifying locale files bug (#1527398) + +* Wed Nov 14 2018 Kamil Dudka - 5.34-5 +- reintroduce the python2-magic subpackage needed by python2-bugzilla (#1649547) + +* Mon Nov 12 2018 Kamil Dudka - 5.34-4 +- add magic for eBPF objects (#1648667) + +* Tue Jul 31 2018 Florian Weimer - 5.34-3 +- Rebuild with fixed binutils + +* Fri Jul 27 2018 Igor Gnatenko - 5.34-2 +- Rebuild for new binutils + +* Wed Jul 25 2018 Kamil Dudka - 5.34-1 +- update to new version 5.34 + +* Tue Jul 17 2018 Kamil Dudka - 5.33-10 +- show details about ppc swap partition (#1224668) +- support longer version strings for clamav database (#1539107) + +* Fri Jul 13 2018 Fedora Release Engineering - 5.33-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Sun Jun 17 2018 Miro Hrončok - 5.33-8 +- Rebuilt for Python 3.7 + +* Wed Jun 13 2018 Kamil Dudka - 5.33-7 +- fix out-of-bounds read via a crafted ELF file (CVE-2018-10360) + +* Mon May 28 2018 Kamil Dudka - 5.33-6 +- make file-devel depend on file-libs, instead of file +- reintroduce file-static subpackage (#1575661) +- drop obsolete Group tag + +* Thu May 24 2018 Kamil Dudka - 5.33-5 +- do not classify shared libraries as pie executables in MIME output (#1581343) + +* Tue May 22 2018 Kamil Dudka - 5.33-4 +- do not classify shared libraries as pie executables (#1581343) +- seccomp: fix build failure due to missing syscalls + +* Mon Apr 30 2018 Miro Hrončok - 5.33-3 +- Update Python macros to new packaging standards + (See https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build) + +* Wed Apr 18 2018 Kamil Dudka - 5.33-2 +- increase strength of GIF to beat MBR (#1515180) + +* Mon Apr 16 2018 Kamil Dudka - 5.33-1 +- update to new version 5.33 + +* Wed Mar 28 2018 Kamil Dudka - 5.32-4 +- make the python2-magic subpackage optional + +* Wed Feb 07 2018 Fedora Release Engineering - 5.32-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Feb 03 2018 Igor Gnatenko - 5.32-2 +- Switch to %%ldconfig_scriptlets + +* Mon Sep 04 2017 Kamil Dudka - 5.32-1 +- update to new version 5.32 + +* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 5.31-10 +- Python 2 binary package renamed to python2-file + See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 + +* Fri Aug 18 2017 Marek Cermak - 5.31-9 +- Ruby script recognition and classification (#1050897) + +* Mon Aug 14 2017 Marek Cermak - 5.31-8 +- New magic entry for iconv/gconv module configuration cache (#1342428) + +* Fri Aug 4 2017 Marek Cermak - 5.31-7 +- Changes in commands and images magic files +- Fixes awk/perl script recognition + +* Wed Aug 02 2017 Fedora Release Engineering - 5.31-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Mon Jul 31 2017 Marek Cermak - 5.31-5 +- fixed patch for recognition of gnu message catalog (.mo) files (#1226215) + +* Sun Jul 30 2017 Florian Weimer - 5.31-4 +- Rebuild with binutils fix for ppc64le (#1475636) + +* Wed Jul 26 2017 Fedora Release Engineering - 5.31-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue Jul 25 2017 Marek Cermak - 5.31-2 +- fixed recognition of gnu message catalog (.mo) files (#1226215) + +* Wed May 24 2017 Kamil Dudka - 5.31-1 +- update to new version 5.31 + +* Wed Apr 05 2017 Kamil Dudka - 5.30-6 +- fix utf-8 conversion in Python 2 bindings (#1433364) + +* Thu Feb 23 2017 Kamil Dudka - 5.30-5 +- make the package build on EPEL-6 and EPEL-7 +- drop undocumented override of the __libtoolize RPM macro +- drop undocumented non-upstream file-5.24-varied.patch +- drop undocumented non-upstream file-5.22-awk-perl.patch +- drop non-upstream file-5.19-cafebabe.patch no longer needed (#1134580) +- drop undocumented non-upstream file-5.14-x86boot.patch +- drop undocumented non-upstream file-5.04-generic-msdos.patch + +* Thu Feb 23 2017 Kamil Dudka - 5.30-4 +- increase strength of perl modules to exceed C sources (#772651) +- drop non-upstream file-5.14-perl.patch (#1051598) +- drop undocumented non-upstream file-5.10-strength.patch (#772651) + +* Tue Feb 14 2017 Kamil Dudka - 5.30-3 +- restore compatibility with certain RPM scripts + +* Tue Feb 14 2017 Kamil Dudka - 5.30-2 +- fix debug info reversed logic + +* Mon Feb 13 2017 Kamil Dudka - 5.30-1 +- apply patches automatically to ease maintenance +- update to new version 5.30 + +* Wed Feb 08 2017 Kamil Dudka - 5.29-3 +- build in parallel and in verbose mode +- fix assertion failure on certain files (thanks to Christoph Biedl) + +* Tue Dec 13 2016 Charalampos Stratakis - 5.29-2 +- Rebuild for Python 3.6 + +* Tue Oct 25 2016 Kamil Dudka - 5.29-1 +- update to new version 5.29 + +* Wed Aug 17 2016 Kamil Dudka - 5.28-4 +- avoid double encoding with Python 3 (#1367144) + +* Tue Jul 19 2016 Fedora Release Engineering - 5.28-3 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Mon Jun 27 2016 Igor Gnatenko - 5.28-2 +- Fix crash during uncompression of zlib (RHBZ #1350252) + +* Fri Jun 24 2016 Kamil Dudka - 5.28-1 +- update to new version 5.28 + +* Wed Feb 03 2016 Fedora Release Engineering - 5.25-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jan 28 2016 Jan Kaluza - 5.25-5 +- fix #1302297 - fix misdetection of some Perl scripts as Minix filesystem + +* Wed Jan 06 2016 Jan Kaluza - 5.25-4 +- fix #1291903 - fix misdetection of some text files as MSX binary files + +* Fri Nov 20 2015 Jan kaluza - 5.25-3 +- fix #1279401 - change the order of Perl patterns to try "Perl script" + patterns before "Perl Module" + +* Thu Nov 05 2015 Robert Kuska - 5.25-2 +- Rebuilt for Python3.5 rebuild + +* Fri Sep 18 2015 Jan Kaluza - 5.25-1 +- update to new version 5.25 + +* Thu Jul 16 2015 Jan Kaluza - 5.24-1 +- update to new version 5.24 + +* Mon Jun 22 2015 Jan Kaluza - 5.22-5 +- fix #1201630 - fix recursion in JPEG magic pattern + +* Wed Jun 17 2015 Fedora Release Engineering - 5.22-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Feb 21 2015 Till Maas - 5.22-3 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Mon Feb 16 2015 Jan Kaluza - 5.22-2 +- remove weak zlib pattern + +* Wed Feb 04 2015 Jan Kaluza - 5.22-1 +- update to new version 5.22 + +* Thu Oct 23 2014 Jan Kaluza - 5.19-7 +- fix #1155464 - fix for CVE-2014-3710 + +* Wed Sep 03 2014 Jan Kaluza - 5.19-6 +- fix #1134580 - detect Mach-O universal binary + +* Wed Sep 03 2014 Jan Kaluza - 5.19-5 +- fix #1101404 - remove weak Pascal patterns +- fix #1107995 - detect locale-archive +- fix #1130693, #1115111 - fix detection of MSOOXML, OOXML and ZIP +- fix #1124940 - detect Python 3.4 byte-compiled files + +* Fri Aug 22 2014 Jan Kaluza - 5.19-4 +- fix #1132787 - CVE-2014-3587 + +* Sat Aug 16 2014 Fedora Release Engineering - 5.19-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jul 12 2014 Tom Callaway - 5.19-2 +- fix license handling + +* Wed Jun 25 2014 Jan Kaluza - 5.19-1 +- fix #1011789 - update to version 5.19 + +* Sat Jun 07 2014 Fedora Release Engineering - 5.14-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue May 27 2014 Kalev Lember - 5.14-21 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 + +* Tue Mar 25 2014 Jan Kaluza - 5.14-20 +- fix #1079847 - fix potential regression in Perl detection caused + by original patch for CVE-2013-7345 + +* Mon Mar 24 2014 Jan Kaluza - 5.14-19 +- fix redefinition of OFFSET_OOB in CVE-2014-2270 patch + +* Mon Mar 24 2014 Jan Kaluza - 5.14-18 +- fix #1079847 - fix for CVE-2013-7345 +- fix #1080450 - remove *.orig files before compiling magic/Magdir + +* Fri Mar 07 2014 Jan Kaluza - 5.14-17 +- fix #1073555 - fix for CVE-2014-2270 + +* Tue Feb 25 2014 Jan Kaluza - 5.14-16 +- fix potential memory leak introduced in previous commit + +* Tue Feb 18 2014 Jan Kaluza - 5.14-15 +- fix #1065837 - fix for CVE-2014-1943 + +* Wed Jan 15 2014 Jan Kaluza - 5.14-14 +- fix #1051598 - reverse the order of shebang vs. package keyword detection + in Perl by increasing strength of all Perl patterns + +* Mon Sep 09 2013 Jan Kaluza - 5.14-13 +- fix #1001689 - fix segfault when calling magic_load twice + +* Thu Aug 22 2013 Jan Kaluza - 5.14-12 +- fix #985072 - add support for journald files + +* Thu Aug 8 2013 Ville Skyttä - 5.14-11 +- Build python-magic for python3 where applicable. + +* Sat Aug 03 2013 Fedora Release Engineering - 5.14-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue Jul 02 2013 Jan Kaluza - 5.14-9 +- fix #980446 - do not segfault when no magic is loaded + +* Mon Jun 17 2013 Jan Kaluza - 5.14-8 +- replace sitearch with sitelib + +* Mon Jun 17 2013 Jan Kaluza - 5.14-7 +- build python-magic as noarch + +* Wed May 15 2013 Jan Kaluza - 5.14-6 +- fix #962678 - do not exit if no magic file is loaded, we can still provide + useful info without magic file + +* Mon May 13 2013 Jan Kaluza - 5.14-5 +- fix #925339 - support aarch64 + +* Mon Apr 08 2013 Jan Kaluza - 5.14-4 +- fix #948255 - print white-space in fsmagic, but only when + we know there will be some more output + +* Fri Mar 29 2013 Jan Kaluza - 5.14-3 +- fix #928995 - do not print white-space in the end of fsmagic + +* Mon Mar 25 2013 Jan Kaluza - 5.14-2 +- fix useless space in ELF output which could break libtool + +* Fri Mar 22 2013 Jan Kaluza - 5.14-1 +- fix #891856 - update to file-5.14 +- fix #909754 - magic number for Python-3.3 +- fix #912271 - do not report dwarf debug info packages as 'stripped' +- fix #882321 - do not print 'unknown capability' for ELF capabilities for + architectures which File does not support +- fix #866000 - show proper build id for ELF binaries +- fix #860139 - better dump file recognition on big endian architectures +- remove file-static subpackage +- move python-magic .py files to python_sitearch + +* Mon Mar 11 2013 Jan Kaluza - 5.11-9 +- fix #919466 - fix memory leak in get_default_magic + +* Wed Feb 13 2013 Fedora Release Engineering - 5.11-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Dec 04 2012 Jan Kaluza - 5.11-7 +- removed duplicated patterns for backups generated by "dump" tool +- recognize volume_key escrow packets +- mention exit code in manpage +- remove weak msdos patterns + +* Wed Nov 21 2012 Jan Kaluza - 5.11-6 +- clean up the spec file + +* Tue Aug 14 2012 Jan Kaluza - 5.11-5 +- fix #847936 - decompress bzip2 properly when using -z param +- fix #847937 - read magic patterns also from ~/.magic.mgc + +* Fri Jul 27 2012 Fedora Release Engineering - 5.11-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jul 19 2012 Jan Kaluza - 5.11-3 +- removed buildroot, defattr + +* Thu Jun 21 2012 Jan Kaluza - 5.11-2 +- detect names of RPM packages +- detect swap on ia64 architecture + +* Mon Feb 27 2012 Jan Kaluza - 5.11-1 +- fix #796130 - update to file-5.11 +- fix #796209 - recognize VDI images +- fix #795709 - recognize QED images + +* Wed Jan 18 2012 Jan Kaluza - 5.10-5 +- fix detection of ASCII text files with setuid, setgid, or sticky bits + +* Tue Jan 10 2012 Jan Kaluza - 5.10-4 +- fix #772651 - decrease strength of newly added "C source" patterns + +* Tue Jan 03 2012 Jan Kaluza - 5.10-3 +- fix #771292 - do not show 'using regular magic file' warning for /etc/magic, + because this file is not supposed to be compiled + +* Mon Jan 02 2012 Jan Kaluza - 5.10-2 +- fix #770006 - detect tnef files + +* Mon Jan 02 2012 Jan Kaluza - 5.10-1 +- fix #771030 - update to file-5.10 + +* Mon Jan 02 2012 Jan Kaluza - 5.09-3 +- fix #720321 - added /etc/magic config file to let users define their local + magic patterns + +* Wed Oct 26 2011 Fedora Release Engineering - 5.09-2 +- Rebuilt for glibc bug#747377 + +* Thu Sep 29 2011 Jan Kaluza - 5.09-1 +- fix #739286 - update to file-5.09 + +* Thu Aug 04 2011 Jan Kaluza - 5.08-1 +- fix #728181 - update to file-5.08 +- remove unused patches + +* Tue Jun 14 2011 Jan Kaluza - 5.07-5 +- fix #712991 - include RPM noarch in /usr/share/magic + +* Thu Jun 09 2011 Jan Kaluza - 5.07-4 +- fix #711843 - fix postscript detection + +* Thu Jun 09 2011 Jan Kaluza - 5.07-3 +- fix #709953 - add support for BIOS version detection + +* Mon May 23 2011 Jan Kaluza - 5.07-2 +- backported patches to fix 5.07 regressions +- fix #706231 - fixed ZIP detection +- fix #705183, #705499 - removed weak DOS device driver pattern + +* Wed May 11 2011 Jan Kaluza - 5.07-1 +- update to new upstream version 5.07 +- remove unused patches + +* Tue Mar 01 2011 Jan Kaluza - 5.05-4 +- fix #678458 - support for Python 3.2 compiled files + +* Thu Feb 10 2011 Jan Kaluza - 5.05-3 +- fix #676543 - improved TeX and LaTeX recognition +- fix #676041 - detect all supported RPM architectures + +* Tue Feb 08 2011 Fedora Release Engineering - 5.05-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Jan 18 2011 Jan Kaluza - 5.05-1 +- fix #670319 - update to new upstream release 5.05 +- removed useless patches + +* Mon Jan 10 2011 Jan Kaluza - 5.04-18 +- fix #668304 - support for com32r programs +- distinguish between GFS2 and GFS1 filesystems + +* Wed Nov 24 2010 Jan Kaluza - 5.04-17 +- fix #656395 - "string" magic directive supports longer strings + +* Wed Aug 25 2010 Jan Kaluza - 5.04-16 +- fix #637785 - support for zip64 format + +* Tue Aug 24 2010 Jan Kaluza - 5.04-15 +- fix #626591 - support for WebM format + +* Thu Aug 12 2010 Jan Kaluza - 5.04-14 +- fix #623602 - support for Python 2.7 compiled files + +* Wed Jul 21 2010 David Malcolm - 5.04-13 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Thu Jul 15 2010 Jan Kaluza 5.04-12 +- fix #599695 - try to get "from" attribute for ELF binaries + only from core dumps. + +* Thu Jul 08 2010 Jan Kaluza 5.04-11 +- added docs for file-libs + +* Tue Jun 29 2010 Jan Kaluza 5.04-10 +- fix #608922 - updated z-machine magic + +* Fri Jun 11 2010 Jan Kaluza 5.04-9 +- removed excessive HTML/SGML "magic patterns" (#603040) + +* Wed Apr 14 2010 Daniel Novotny 5.04-8 +- fix #580046 - the file command returns zero exit code + even in case of unexisting file being tested + +* Wed Apr 07 2010 Daniel Novotny 5.04-7 +- fix #566305 - "file" may trim too much of command line from core file + +* Wed Mar 24 2010 Daniel Novotny 5.04-6 +- fix #550212 - 'file' gives bad meta-data for squashfs-4.0 + +* Wed Mar 24 2010 Daniel Novotny 5.04-5 +- fix #575184 - file command does not print separator + when --print0 option is used + +* Thu Mar 11 2010 Daniel Novotny 5.04-4 +- fix #570785 - "file" misidentifies filesystem type + +* Tue Feb 09 2010 Daniel Novotny 5.04-3 +- fix #562840 - [PATCH] Add matches for ruby modules + +* Thu Jan 28 2010 Daniel Novotny 5.04-2 +- fix #533245 - segfaults on star.ulaw + +* Mon Jan 25 2010 Daniel Novotny 5.04-1 +- update to new upstream release 5.04 + +* Mon Jan 18 2010 Daniel Novotny 5.03-18 +- static library moved to new "-static" subpackage (#556048) + +* Fri Dec 25 2009 Robert Scheck 5.03-17 +- removed broken install of example.py (%%doc is much enough) + +* Mon Nov 30 2009 Daniel Novotny 5.03-16 +- fixed the patch for multilib (#515767) + +* Tue Nov 24 2009 Daniel Novotny 5.03-15 +- BuildRequires: autoconf, automake + +* Tue Nov 24 2009 Daniel Novotny 5.03-14 +- BuildRequires: automake because of the Makefile.am patch + +* Fri Nov 13 2009 Daniel Novotny 5.03-13 +- fix #537324 - update spec conditional for rhel + +* Thu Nov 05 2009 Daniel Novotny 5.03-12 +- fix #533151 - file command doesn't recognize deltaisos or rpm-only deltarpms + +* Tue Oct 27 2009 Daniel Novotny 5.03-11 +- fix #531082 - RFE: add detection of Python 3 bytecode +- fix #531127 - `file' command does not recognize mime type `image/vnd.djvu' + +* Wed Oct 21 2009 Daniel Novotny 5.03-10 +- fix #530083 - file -s is not able to detect swap signature on ppc + +* Tue Aug 25 2009 Daniel Novotny 5.03-9 +- fix #515767 - multilib: file /usr/share/misc/magic.mgc conflicts + +* Thu Aug 06 2009 Daniel Novotny 5.03-8 +- rebuild for #515767 - multilib: file /usr/share/misc/magic.mgc conflicts + +* Fri Jul 24 2009 Fedora Release Engineering - 5.03-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Jul 23 2009 Daniel Novotny 5.03-6 +- fix #510429 - file is confused by string "/* (if any) */" + in C header and claims it "Lisp/Scheme program text" + +* Wed Jul 22 2009 Daniel Novotny 5.03-5 +- #513079 - RFE: file - recognize xfs metadump images + +* Fri Jul 10 2009 Adam Jackson 5.03-4 +- Clean up %%description. + +* Tue Jun 16 2009 Daniel Novotny 5.03-4 +- one more PostScript font magic added (#505762), + updated font patch + +* Tue Jun 16 2009 Daniel Novotny 5.03-3 +- added magic for three font issues (PostScript fonts) + (#505758, #505759, #505765) + +* Thu May 14 2009 Daniel Novotny 5.03-2 +- fix #500739 - Disorganized magic* file locations in file-libs + +* Mon May 11 2009 Daniel Novotny 5.03-1 +- new upstream version + +* Tue May 05 2009 Daniel Novotny 5.02-1 +- new upstream version; drop upstreamed patches; this fixes #497913 + +* Wed Apr 29 2009 Daniel Novotny 5.00-8 +- fix #498036 - Elang JAM file definition breaks detection of postscript-files + +* Mon Apr 20 2009 Daniel Novotny 5.00-7 +- fix previous patch: + the name of the format is a bit different (MDUMP -> MDMP) + +* Fri Apr 17 2009 Daniel Novotny 5.00-6 +- fix #485835 (MDUMP files) + +* Mon Mar 23 2009 Daniel Novotny 5.00-5 +- added two font definitions (#491594, #491595) + and a fix for file descriptor leak when MAGIC_COMPRESS used (#491596) + +* Tue Feb 24 2009 Fedora Release Engineering - 5.00-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Feb 23 2009 Daniel Novotny 5.00-3 +- fix #486105 - file-5.00-2.fc11 fails to recognise a file + (and makes rpmbuild fail) + +* Mon Feb 16 2009 Daniel Novotny 5.00-2 +- fix #485141 - rpm failed while checking a French Word file + +* Mon Feb 09 2009 Daniel Novotny 5.00-1 +- upgrade to 5.00 +- drop upstreamed patches, rebase remaining patch + +* Wed Jan 14 2009 Daniel Novotny 4.26-9 +- fix #476655 detect JPEG-2000 Code Stream Bitmap + +* Mon Jan 12 2009 Daniel Novotny 4.26-8 +- fix #479300 - add btrfs filesystem magic + +* Mon Dec 15 2008 Daniel Novotny 4.26-7 +- fix the LaTex issue in bz#474156 + +* Thu Dec 04 2008 Ignacio Vazquez-Abrams - 4.26-6 +- Rebuild for Python 2.6 + +* Thu Dec 04 2008 Daniel Novotny - 4.26-5 +- fix #470811 - Spurious perl auto-requires + +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 4.26-4 +- Rebuild for Python 2.6 + +* Thu Oct 16 2008 Daniel Novotny 4.26-3 +- fix #465994 file --mime-encoding seems broken + +* Tue Oct 07 2008 Daniel Novotny 4.26-2 +- fix #463809: rpmbuild rpmfcClassify: Assertion fails on some binary files + (false positive test on "DOS device driver" crashed file(1) + and rpmbuild(8) failed) + +* Mon Sep 15 2008 Daniel Novotny 4.26-1 +- new upstream version: fixes #462064 + +* Mon Jul 21 2008 Tomas Smetana - 4.25-1 +- new upstream version; drop upstreamed patches + +* Fri Jun 06 2008 Tomas Smetana - 4.24-4 +- add GFS2 filesystem magic; thanks to Eric Sandeen +- add LVM snapshots magic (#449755); thanks to Jason Farrell + +* Wed Jun 04 2008 Tomas Smetana - 4.24-3 +- drop patches that do nothing in recent build system +- create the text magic file during installation + +* Tue Jun 03 2008 Tomas Smetana - 4.24-2 +- rebuild because of egg-info + +* Tue Jun 03 2008 Tomas Smetana - 4.24-1 +- new upstream version + +* Tue Mar 11 2008 Tomas Smetana - 4.23-5 +- fix EFI detection patch + +* Fri Feb 01 2008 Tomas Smetana - 4.23-4 +- fix mismatching gzip files and text files as animations + +* Fri Feb 01 2008 Tomas Smetana - 4.23-3 +- fix #430927 - detect ext4 filesystems + +* Thu Jan 31 2008 Tomas Smetana - 4.23-2 +- fix #430952 - wrong handling of ELF binaries + +* Tue Jan 29 2008 Tomas Smetana - 4.23-1 +- new upstream version; update patches; drop unused patches + +* Thu Jan 24 2008 Tomas Smetana - 4.21-5 +- build a separate python-magic package; thanks to Terje Rosten + +* Thu Dec 06 2007 Tomas Smetana - 4.21-4 +- add PE32/PE32+ magic + +* Wed Aug 15 2007 Martin Bacovsky - 4.21-3 +- resolves: #172015: no longer reports filename of crashed app when run on core files. +- resolves: #249578: Weird output from "file -i" +- resolves: #234817: file reports wrong filetype for microsoft word file + +* Wed Jul 4 2007 Martin Bacovsky - 4.21-2 +- resolves: #246700: RPM description isn't related to product +- resolves: #238789: file-devel depends on %%{version} + but not on %%{version}-%%{release} +- resolves: #235267: for core files, file doesn't display the executable name + +* Tue May 29 2007 Martin Bacovsky - 4.21-1 +- upgrade to new upstream 4.21 +- resolves: #241034: CVE-2007-2799 file integer overflow + +* Wed Mar 7 2007 Martin Bacovsky - 4.20-1 +- upgrade to new upstream 4.20 + +* Tue Feb 20 2007 Martin Bacovsky - 4.19-4 +- rpath in file removal + +* Mon Feb 19 2007 Martin Bacovsky - 4.19-3 +- Resolves: #225750 - Merge Review: file + +* Thu Jan 25 2007 Martin Bacovsky - 4.19-2 +- Resolves: #223297 - file does not recognize OpenOffice "native" formats +- Resolves: #224344 - Magic rules should be in file-libs + +* Tue Jan 9 2007 Martin Bacovsky - 4.19-1 +- Resolves: #208880 - Pointless file(1) error message while detecting ELF 64-bit file + thanks to for patch +- Resolves: #214992 - file-devel should own %%_includedir/* %%_libdir/lib*.so +- Resolves: #203548 - a -devel package should be split out for libmagic +- upgrade to new upstream 4.19 +- patch revision and cleaning +- split package to file, file-devel and file-libs + +* Wed Aug 23 2006 Martin Bacovsky - 4.17-8 +- fix recognition of perl script with embed awk (#203610) + +* Fri Aug 18 2006 Martin Bacovsky - 4.17-7 +- fix recognition of bash script with embed awk (#202185) + +* Thu Aug 03 2006 Martin Bacovsky - 4.17-6 +- fix gziped empty file (#72986) + +* Wed Jul 12 2006 Jesse Keating - 4.17-5.1 +- rebuild + +* Mon Jul 10 2006 Radek Vokal 4.17-5 +- fix powerpoint mine (#190373) + +* Wed May 24 2006 Radek Vokal 4.17-4 +- /usr/share/file is owned by package (#192858) +- fix magic for Clamav files (#192406) + +* Fri Apr 21 2006 Radek Vokal 4.17-3 +- add support for OCFS or ASM (#189017) + +* Tue Mar 14 2006 Radek Vokal 4.17-2 +- fix segfault when compiling magic +- add check for wctype.h +- fix for flac and mp3 files + +* Mon Mar 13 2006 Radek Vokal 4.17-1 +- upgrade to file-4.17, patch clean-up + +* Fri Feb 10 2006 Jesse Keating - 4.16-6.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 4.16-6.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Sat Feb 04 2006 Radek Vokal 4.16-6 +- xen patch, recognizes Xen saved domain + +* Fri Jan 13 2006 Radek Vokal 4.16-5 +- fix for 64bit arrays + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Tue Nov 29 2005 Radek Vokal - 4.16-4 +- printf utf8 filenames and don't use isprint() (#174348) + +* Tue Nov 08 2005 Radek Vokal - 4.16-3 +- remove .la files (#172633) + +* Mon Oct 31 2005 Radek Vokal - 4.16-2 +- fix core files output, show "from" (#172015) + +* Tue Oct 18 2005 Radek Vokal - 4.16-1 +- upgrade to upstream + +* Mon Oct 03 2005 Radek Vokal - 4.15-4 +- file output for Berkeley DB gains Cracklib (#168917) + +* Mon Sep 19 2005 Radek Vokal - 4.15-3 +- small fix in previously added patch, now it works for multiple params + +* Mon Sep 19 2005 Radek Vokal - 4.15-2 +- print xxx-style only once (#168617) + +* Tue Aug 09 2005 Radek Vokal - 4.15-1 +- upgrade to upstream + +* Tue Aug 09 2005 Radek Vokal - 4.14-4 +- mime for mpeg and aac files fixed (#165323) + +* Fri Aug 05 2005 Radek Vokal - 4.14-3 +- mime for 3ds files removed, conflicts with text files (#165165) + +* Fri Jul 22 2005 Radek Vokal - 4.14-2 +- fixed mime types recognition (#163866) + +* Thu Jul 14 2005 Radek Vokal - 4.14-1 +- sync with upstream, patch clean-up + +* Mon Jul 04 2005 Radek Vokal - 4.13-5 +- fixed reiserfs check (#162378) + +* Mon Apr 11 2005 Radek Vokal - 4.13-4 +- check Cyrus files before Apple Quicktime movies (#154342) + +* Mon Mar 07 2005 Radek Vokal - 4.13-3 +- check for shared libs before fs dump files (#149868) + +* Fri Mar 04 2005 Radek Vokal - 4.13-2 +- gcc4 rebuilt + +* Tue Feb 15 2005 Radek Vokal - 4.13-1 +- new version, fixing few bugs, patch clean-up +- consistent output for bzip files (#147440) + +* Mon Jan 24 2005 Radek Vokal - 4.12-3 +- core64 patch fixing output on core files (#145354) +- minor change in magic patch + +* Mon Jan 03 2005 Radek Vokal - 4.12-2 +- fixed crashes in threaded environment (#143871) + +* Thu Dec 02 2004 Radek Vokal - 4.12-1 +- upgrade to file-4.12 +- removed Tim's patch, tuned magic patch + +* Sat Nov 20 2004 Miloslav Trmac - 4.10-4 +- Convert libmagic.3 to UTF-8 + +* Thu Nov 18 2004 Radek Vokal 4.10-3 +- set of patches from debian.org +- new magic types (#128763) +- zlib added to BuildReq (#125294) + +* Tue Oct 12 2004 Tim Waugh 4.10-2 +- Fixed occasional segfault (bug #131892). + +* Wed Aug 11 2004 Radek Vokal +- zlib patch deleted, note patch deleted, rh patch updated, debian patch updated +- upgrade to file-4.10 + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Mon May 10 2004 Jakub Jelinek +- fix ELF note handling (#109495) + +* Tue Mar 23 2004 Karsten Hopp 4.07-3 +- add docs (#115966) + +* Tue Mar 02 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Sun Jan 18 2004 Jeff Johnson 4.07-1 +- upgrade to 4.07. +- deal gracefully with unreadable files (#113207). +- detect PO files (from Debian). + +* Tue Dec 16 2003 Jeff Johnson 4.06-1 +- upgrade to file-4.06. + +* Mon Nov 10 2003 Tim Waugh 4.02-4 +- Minimal fix for busy loop problem (bug #109495). + +* Mon Oct 13 2003 Jeff Johnson 4.05-1 +- upgrade to 4.05. + +* Thu Oct 9 2003 Jeff Johnson 4.02-3 +- use zlib rather than exec'ing gzip. + +-* Thu Aug 28 2003 Dan Walsh +-- Add Selinux support. + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Sat May 24 2003 Florian La Roche +- add ldconfig to post/postun + +* Mon Apr 21 2003 Jeff Johnson 4.02-1 +- upgrade to file-4.02. + +* Thu Feb 27 2003 Jeff Johnson 3.39-9 +- check size read from elf header (#85297). + +* Tue Feb 18 2003 Matt Wilson 3.39-8 +- add FHS compatibility symlink from /usr/share/misc/magic -> ../magic + (#84509) + +* Fri Feb 14 2003 Jeff Johnson 3.39-7 +- the "real" fix to the vorbis/ogg magic details (#82810). + +* Mon Jan 27 2003 Jeff Johnson 3.39-6 +- avoid vorbis/ogg magic details (#82810). + +* Wed Jan 22 2003 Tim Powers 3.39-5 +- rebuilt + +* Sun Jan 12 2003 Nalin Dahyabhai 3.39-4 +- PT_NOTE, take 3 + +* Fri Jan 10 2003 Nalin Dahyabhai 3.39-3 +- don't barf in ELF headers with align = 0 + +* Tue Jan 7 2003 Nalin Dahyabhai 3.39-2 +- don't get lost when looking at PT_NOTE sections + +* Sat Oct 26 2002 Jeff Johnson 3.39-1 +- update to 3.39. + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Mon May 6 2002 Trond Eivind Glomsrød 3.37-6 +- Don't use an old magic.mime +- Add mng detection (#64229) + +* Tue Feb 26 2002 Trond Eivind Glomsrød 3.37-5 +- Rebuild + +* Mon Jan 14 2002 Trond Eivind Glomsrød 3.37-4 +- Fix missing include of (#58209) + +* Tue Dec 11 2001 Trond Eivind Glomsrød 3.37-2 +- Add CFLAGS to handle large files (#53576) + +* Mon Dec 10 2001 Trond Eivind Glomsrød 3.37-1 +- 3.37 +- s/Copyright/License/ +- build with --enable-fsect-man5, drop patch +- disable two old patches + +* Fri Jul 06 2001 Florian La Roche +- revert a patch to Magdir/elf, which breaks many libtool scripts + in several rpm packages + +* Mon Jun 25 2001 Crutcher Dunnavant +- iterate to 3.35 + +* Sun Jun 24 2001 Elliot Lee +- Bump release + rebuild. + +* Sun Nov 26 2000 Jeff Johnson +- update to 3.33. + +* Mon Aug 14 2000 Preston Brown +- Bill made the patch but didn't apply it. :) + +* Mon Aug 14 2000 Bill Nottingham +- 'ASCII text', not 'ASCII test' (#16168) + +* Mon Jul 31 2000 Jeff Johnson +- fix off-by-1 error when creating filename for use with -i. +- include a copy of GNOME /etc/mime-types in %%{_datadir}/magic.mime (#14741). + +* Sat Jul 22 2000 Jeff Johnson +- install magic as man5/magic.5 with other formats (#11172). + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Wed Jun 14 2000 Jeff Johnson +- FHS packaging. + +* Fri Apr 14 2000 Bernhard Rosenkraenzer +- 3.30 + +* Wed Feb 16 2000 Cristian Gafton +- add ia64 patch from rth + +* Mon Feb 7 2000 Bill Nottingham +- handle compressed manpages +- update to 3.28 + +* Mon Aug 23 1999 Jeff Johnson +- identify ELF stripped files correctly (#4665). +- use SPARC (not sparc) consistently throughout (#4665). +- add entries for MS Office files (#4665). + +* Thu Aug 12 1999 Jeff Johnson +- diddle magic so that *.tfm files are identified correctly. + +* Tue Jul 6 1999 Jeff Johnson +- update to 3.27. + +* Mon Mar 22 1999 Preston Brown +- experimental support for realmedia files added + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 5) + +* Fri Mar 19 1999 Jeff Johnson +- strip binary. + +* Fri Nov 27 1998 Jakub Jelinek +- add SPARC V9 magic. + +* Tue Nov 10 1998 Jeff Johnson +- update to 3.26. + +* Mon Aug 24 1998 Jeff Johnson +- update to 3.25. +- detect gimp XCF versions. + +* Thu May 07 1998 Prospector System +- translations modified for de, fr, tr + +* Wed Apr 08 1998 Erik Troan +- updated to 3.24 +- buildrooted + +* Mon Jun 02 1997 Erik Troan +- built against glibc + +* Mon Mar 31 1997 Erik Troan +- Fixed problems caused by 64 bit time_t. + +* Thu Mar 06 1997 Michael K. Johnson +- Improved recognition of Linux kernel images.