SHA256
1
0
forked from pool/file

Accepting request 311662 from Base:System

- Update to file version 5.23
  * Fix issue with regex range for magic with offset
  * Always return true from mget with USE (success to mget not match
    indication). Fixes mime evaluation after USE magic
  * PR/459: Don't insert magic entries to the list if there are parsing
    errors for them.
  * PR/455: Add utf-7 encoding
  * PR/455: Implement -Z, look inside, but don't report on compression
  * PR/454: Fix allocation error on bad magic.
  * handle MAGIC_CONTINUE everywhere, not just in softmagic
  * don't print descriptions for NAME types when mime.
  * Add --extension to list the known extensions for this file type
    Idea by Andrew J Roazen
  * Bump file search buffer size to 1M.
  * Fix multiple issues with date formats reported by Christoph Biedl:
          - T_LOCAL meaning was reversed
          - Arithmetic did not work
    Also stop adjusting daylight savings for gmt printing.
  * PR/411: Fix memory corruption from corrupt cdf file.
- Refresh and rename patches
  file-5.20-endian.patch becomes file-5.23-endian.patch
  file-5.22.dif becomes file-5.23.dif
  Refresh patch file-secure_getenv.patch

- adapt version in specfile to 5.23

OBS-URL: https://build.opensuse.org/request/show/311662
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/file?expand=0&rev=89
This commit is contained in:
Stephan Kulow 2015-07-05 15:49:54 +00:00 committed by Git OBS Bridge
commit 2b189fdfa6
9 changed files with 115 additions and 76 deletions

View File

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

View File

@ -4,7 +4,7 @@
2 files changed, 10 insertions(+), 114 deletions(-)
--- src/apprentice.c
+++ src/apprentice.c 2014-10-13 11:02:16.023878187 +0000
+++ src/apprentice.c 2014-10-13 11:02:16.000000000 +0000
@@ -54,6 +54,7 @@ FILE_RCSID("@(#)$File: apprentice.c,v 1.
#if defined(HAVE_LIMITS_H)
#include <limits.h>
@ -28,7 +28,7 @@
private char *mkdbname(struct magic_set *, const char *, int);
private struct magic_map *apprentice_buf(struct magic_set *, struct magic *,
size_t);
@@ -3031,67 +3034,6 @@ byteswap(struct magic *magic, uint32_t n
@@ -3119,67 +3122,6 @@ byteswap(struct magic *magic, uint32_t n
}
/*
@ -97,8 +97,8 @@
*/
private void
--- src/cdf.c
+++ src/cdf.c 2014-10-13 11:00:50.524206235 +0000
@@ -50,6 +50,7 @@ FILE_RCSID("@(#)$File: cdf.c,v 1.67 2014
+++ src/cdf.c 2015-06-11 15:12:51.017518448 +0000
@@ -50,6 +50,7 @@ FILE_RCSID("@(#)$File: cdf.c,v 1.76 2015
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
@ -106,8 +106,8 @@
#ifndef EFTYPE
#define EFTYPE EINVAL
@@ -77,56 +78,9 @@ static union {
CDF_TOLE4(x) : CDF_TOLE8(x)))
@@ -80,56 +81,9 @@ static union {
CDF_TOLE8(CAST(uint64_t, x))))
#define CDF_GETUINT32(x, y) cdf_getuint32(x, y)
-

View File

@ -89,7 +89,7 @@
# hooray, there's a DOS extender using the PE format, with a valid PE
# executable inside (which just prints a message and exits if run in win)
--- magic/Makefile.am
+++ magic/Makefile.am 2015-01-19 10:35:16.594852944 +0000
+++ magic/Makefile.am 2015-01-19 10:35:17.000000000 +0000
@@ -5,7 +5,7 @@ MAGIC_FRAGMENT_BASE = Magdir
MAGIC_DIR = $(top_srcdir)/magic
MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE)
@ -107,7 +107,7 @@
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/archive \
$(MAGIC_FRAGMENT_DIR)/assembler \
@@ -76,7 +75,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
@@ -77,7 +76,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
$(MAGIC_FRAGMENT_DIR)/erlang \
$(MAGIC_FRAGMENT_DIR)/esri \
$(MAGIC_FRAGMENT_DIR)/fcs \
@ -115,7 +115,7 @@
$(MAGIC_FRAGMENT_DIR)/flash \
$(MAGIC_FRAGMENT_DIR)/fonts \
$(MAGIC_FRAGMENT_DIR)/fortran \
@@ -114,6 +112,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
@@ -115,6 +113,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
$(MAGIC_FRAGMENT_DIR)/java \
$(MAGIC_FRAGMENT_DIR)/javascript \
$(MAGIC_FRAGMENT_DIR)/jpeg \
@ -124,7 +124,7 @@
$(MAGIC_FRAGMENT_DIR)/karma \
$(MAGIC_FRAGMENT_DIR)/kde \
$(MAGIC_FRAGMENT_DIR)/keepass \
@@ -122,7 +122,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
@@ -123,7 +123,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
$(MAGIC_FRAGMENT_DIR)/lecter \
$(MAGIC_FRAGMENT_DIR)/lex \
$(MAGIC_FRAGMENT_DIR)/lif \
@ -132,7 +132,7 @@
$(MAGIC_FRAGMENT_DIR)/lisp \
$(MAGIC_FRAGMENT_DIR)/llvm \
$(MAGIC_FRAGMENT_DIR)/lua \
@@ -130,7 +129,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
@@ -131,7 +130,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
$(MAGIC_FRAGMENT_DIR)/m4 \
$(MAGIC_FRAGMENT_DIR)/mach \
$(MAGIC_FRAGMENT_DIR)/macos \
@ -140,7 +140,7 @@
$(MAGIC_FRAGMENT_DIR)/magic \
$(MAGIC_FRAGMENT_DIR)/mail.news \
$(MAGIC_FRAGMENT_DIR)/make \
@@ -151,10 +149,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
@@ -152,10 +150,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
$(MAGIC_FRAGMENT_DIR)/mkid \
$(MAGIC_FRAGMENT_DIR)/mlssa \
$(MAGIC_FRAGMENT_DIR)/mmdf \
@ -152,7 +152,7 @@
$(MAGIC_FRAGMENT_DIR)/msooxml \
$(MAGIC_FRAGMENT_DIR)/msx \
$(MAGIC_FRAGMENT_DIR)/msvc \
@@ -201,6 +199,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
@@ -203,6 +201,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
$(MAGIC_FRAGMENT_DIR)/qt \
$(MAGIC_FRAGMENT_DIR)/revision \
$(MAGIC_FRAGMENT_DIR)/riff \
@ -161,7 +161,7 @@
$(MAGIC_FRAGMENT_DIR)/rpm \
$(MAGIC_FRAGMENT_DIR)/rtf \
$(MAGIC_FRAGMENT_DIR)/ruby \
@@ -270,8 +270,20 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
@@ -272,8 +272,20 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
$(MAGIC_FRAGMENT_DIR)/zilog \
$(MAGIC_FRAGMENT_DIR)/zyxel
@ -183,7 +183,7 @@
# FIXME: Build file natively as well so that it can be used to compile
# the target's magic file; for now we bail if the local version does not match
@@ -283,19 +295,22 @@ FILE_COMPILE = $(top_builddir)/src/file$
@@ -285,19 +297,22 @@ FILE_COMPILE = $(top_builddir)/src/file$
FILE_COMPILE_DEP = $(FILE_COMPILE)
endif
@ -223,8 +223,8 @@
+# $(FILE_COMPILE) -C -m magic
+# @rm -fr magic
--- magic/Makefile.in
+++ magic/Makefile.in 2015-01-19 10:35:01.869520761 +0000
@@ -267,7 +267,7 @@ top_srcdir = @top_srcdir@
+++ magic/Makefile.in 2015-06-11 15:26:03.753518322 +0000
@@ -278,7 +278,7 @@ top_srcdir = @top_srcdir@
MAGIC_FRAGMENT_BASE = Magdir
MAGIC_DIR = $(top_srcdir)/magic
MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE)
@ -233,7 +233,7 @@
EXTRA_DIST = \
$(MAGIC_DIR)/Header \
$(MAGIC_DIR)/Localstuff \
@@ -282,7 +282,6 @@ $(MAGIC_FRAGMENT_DIR)/android \
@@ -293,7 +293,6 @@ $(MAGIC_FRAGMENT_DIR)/android \
$(MAGIC_FRAGMENT_DIR)/animation \
$(MAGIC_FRAGMENT_DIR)/aout \
$(MAGIC_FRAGMENT_DIR)/apl \
@ -241,7 +241,7 @@
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/archive \
$(MAGIC_FRAGMENT_DIR)/assembler \
@@ -337,7 +336,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
@@ -349,7 +348,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \
$(MAGIC_FRAGMENT_DIR)/erlang \
$(MAGIC_FRAGMENT_DIR)/esri \
$(MAGIC_FRAGMENT_DIR)/fcs \
@ -249,7 +249,7 @@
$(MAGIC_FRAGMENT_DIR)/flash \
$(MAGIC_FRAGMENT_DIR)/fonts \
$(MAGIC_FRAGMENT_DIR)/fortran \
@@ -375,6 +373,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
@@ -387,6 +385,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \
$(MAGIC_FRAGMENT_DIR)/java \
$(MAGIC_FRAGMENT_DIR)/javascript \
$(MAGIC_FRAGMENT_DIR)/jpeg \
@ -258,7 +258,7 @@
$(MAGIC_FRAGMENT_DIR)/karma \
$(MAGIC_FRAGMENT_DIR)/kde \
$(MAGIC_FRAGMENT_DIR)/keepass \
@@ -383,7 +383,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
@@ -395,7 +395,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \
$(MAGIC_FRAGMENT_DIR)/lecter \
$(MAGIC_FRAGMENT_DIR)/lex \
$(MAGIC_FRAGMENT_DIR)/lif \
@ -266,7 +266,7 @@
$(MAGIC_FRAGMENT_DIR)/lisp \
$(MAGIC_FRAGMENT_DIR)/llvm \
$(MAGIC_FRAGMENT_DIR)/lua \
@@ -391,7 +390,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
@@ -403,7 +402,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \
$(MAGIC_FRAGMENT_DIR)/m4 \
$(MAGIC_FRAGMENT_DIR)/mach \
$(MAGIC_FRAGMENT_DIR)/macos \
@ -274,7 +274,7 @@
$(MAGIC_FRAGMENT_DIR)/magic \
$(MAGIC_FRAGMENT_DIR)/mail.news \
$(MAGIC_FRAGMENT_DIR)/make \
@@ -412,10 +410,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
@@ -424,10 +422,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \
$(MAGIC_FRAGMENT_DIR)/mkid \
$(MAGIC_FRAGMENT_DIR)/mlssa \
$(MAGIC_FRAGMENT_DIR)/mmdf \
@ -286,7 +286,7 @@
$(MAGIC_FRAGMENT_DIR)/msooxml \
$(MAGIC_FRAGMENT_DIR)/msx \
$(MAGIC_FRAGMENT_DIR)/msvc \
@@ -462,6 +460,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
@@ -475,6 +473,8 @@ $(MAGIC_FRAGMENT_DIR)/python \
$(MAGIC_FRAGMENT_DIR)/qt \
$(MAGIC_FRAGMENT_DIR)/revision \
$(MAGIC_FRAGMENT_DIR)/riff \
@ -295,7 +295,7 @@
$(MAGIC_FRAGMENT_DIR)/rpm \
$(MAGIC_FRAGMENT_DIR)/rtf \
$(MAGIC_FRAGMENT_DIR)/ruby \
@@ -531,10 +531,22 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
@@ -544,10 +544,22 @@ $(MAGIC_FRAGMENT_DIR)/zfs \
$(MAGIC_FRAGMENT_DIR)/zilog \
$(MAGIC_FRAGMENT_DIR)/zyxel
@ -319,9 +319,9 @@
# FIXME: Build file natively as well so that it can be used to compile
# the target's magic file; for now we bail if the local version does not match
@IS_CROSS_COMPILE_TRUE@FILE_COMPILE = file${EXEEXT}
@@ -755,23 +767,25 @@ uninstall-am: uninstall-pkgdataDATA
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags-am uninstall uninstall-am uninstall-pkgdataDATA
@@ -769,23 +781,25 @@ uninstall-am: uninstall-pkgdataDATA
.PRECIOUS: Makefile
+${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) $(RAW)
+ $(FILE_COMPILE) -C -m $(RAW)

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

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

View File

@ -1,18 +1,36 @@
--- file-5.18.orig/configure.ac
+++ file-5.18/configure.ac
@@ -86,6 +86,8 @@ AC_CHECK_HEADERS(getopt.h err.h)
AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
AC_CHECK_HEADERS(zlib.h)
---
file-5.23/configure.ac | 2 ++
file-5.23/src/file.c | 2 +-
file-5.23/src/file.h | 8 ++++++++
file-5.23/src/magic.c | 10 +++++-----
4 files changed, 16 insertions(+), 6 deletions(-)
--- file-5.23/configure.ac
+++ file-5.23/configure.ac 2015-06-11 15:17:36.393695978 +0000
@@ -90,6 +90,8 @@ AC_CHECK_TYPE([sig_t],[AC_DEFINE([HAVE_S
#include <signal.h>
#endif])
+AC_CHECK_FUNCS([__secure_getenv secure_getenv])
+
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
--- file-5.18.orig/src/file.h
+++ file-5.18/src/file.h
@@ -541,4 +541,12 @@ static const char *rcsid(const char *p)
#define FILE_RCSID(id)
--- file-5.23/src/file.c
+++ file-5.23/src/file.c 2015-06-11 00:00:00.000000000 +0000
@@ -596,7 +596,7 @@ docprint(const char *opts)
private void
help(void)
{
- const unsigned long posix = (unsigned long)getenv("POSIXLY_CORRECT");
+ const unsigned long posix = (unsigned long)secure_getenv("POSIXLY_CORRECT");
(void)fputs(
"Usage: file [OPTION...] [FILE...]\n"
"Determine type of FILEs.\n"
--- file-5.23/src/file.h
+++ file-5.23/src/file.h 2015-06-11 15:18:48.037518208 +0000
@@ -602,4 +602,12 @@ static const char *rcsid(const char *p)
#define __RCSID(a)
#endif
+#ifndef HAVE_SECURE_GETENV
@ -24,9 +42,9 @@
+#endif
+
#endif /* __file_h__ */
--- file-5.18.orig/src/magic.c
+++ file-5.18/src/magic.c
@@ -97,7 +97,7 @@ get_default_magic(void)
--- file-5.23/src/magic.c
+++ file-5.23/src/magic.c 2015-06-11 15:20:08.373518300 +0000
@@ -177,7 +177,7 @@ get_default_magic(void)
free(default_magic);
default_magic = NULL;
}
@ -35,27 +53,27 @@
return MAGIC;
if (asprintf(&hmagicpath, "%s/.magic.mgc", home) < 0)
@@ -152,8 +152,8 @@ out:
@@ -214,16 +214,16 @@ out:
}
/* First, try to get user-specific magic file */
- if ((home = getenv("LOCALAPPDATA")) == NULL) {
- if ((home = getenv("USERPROFILE")) != NULL)
+ if ((home = secure_getenv("LOCALAPPDATA")) == NULL) {
+ if ((home = secure_getenv("USERPROFILE")) != NULL)
if (asprintf(&tmppath,
"%s/Local Settings/Application Data%s", home,
hmagic) < 0)
@@ -166,7 +166,7 @@ out:
APPENDPATH();
/* First, try to get a magic file from user-application data */
- if ((home = getenv("LOCALAPPDATA")) != NULL)
+ if ((home = secure_getenv("LOCALAPPDATA")) != NULL)
_w32_append_path(&hmagicpath, "%s%s", home, hmagic);
/* Second, try to get a magic file from Common Files */
- if ((home = getenv("COMMONPROGRAMFILES")) != NULL) {
+ if ((home = secure_getenv("COMMONPROGRAMFILES")) != NULL) {
if (asprintf(&tmppath, "%s%s", home, hmagic) >= 0)
APPENDPATH();
}
@@ -204,7 +204,7 @@ magic_getpath(const char *magicfile, int
/* Second, try to get a magic file from the user profile data */
- if ((home = getenv("USERPROFILE")) != NULL)
+ if ((home = secure_getenv("USERPROFILE")) != NULL)
_w32_append_path(&hmagicpath,
"%s/Local Settings/Application Data%s", home, hmagic);
/* Third, try to get a magic file from Common Files */
- if ((home = getenv("COMMONPROGRAMFILES")) != NULL)
+ if ((home = secure_getenv("COMMONPROGRAMFILES")) != NULL)
_w32_append_path(&hmagicpath, "%s%s", home, hmagic);
/* Fourth, try to get magic file relative to exe location */
@@ -244,7 +244,7 @@ magic_getpath(const char *magicfile, int
if (magicfile != NULL)
return magicfile;
@ -64,14 +82,3 @@
if (magicfile != NULL)
return magicfile;
--- file-5.18.orig/src/file.c
+++ file-5.18/src/file.c
@@ -530,7 +530,7 @@ docprint(const char *opts)
private void
help(void)
{
- const unsigned long posix = (unsigned long)getenv("POSIXLY_CORRECT");
+ const unsigned long posix = (unsigned long)secure_getenv("POSIXLY_CORRECT");
(void)fputs(
"Usage: file [OPTION...] [FILE...]\n"
"Determine type of FILEs.\n"

View File

@ -1,3 +1,30 @@
-------------------------------------------------------------------
Thu Jun 11 15:14:32 UTC 2015 - werner@suse.de
- Update to file version 5.23
* Fix issue with regex range for magic with offset
* Always return true from mget with USE (success to mget not match
indication). Fixes mime evaluation after USE magic
* PR/459: Don't insert magic entries to the list if there are parsing
errors for them.
* PR/455: Add utf-7 encoding
* PR/455: Implement -Z, look inside, but don't report on compression
* PR/454: Fix allocation error on bad magic.
* handle MAGIC_CONTINUE everywhere, not just in softmagic
* don't print descriptions for NAME types when mime.
* Add --extension to list the known extensions for this file type
Idea by Andrew J Roazen
* Bump file search buffer size to 1M.
* Fix multiple issues with date formats reported by Christoph Biedl:
- T_LOCAL meaning was reversed
- Arithmetic did not work
Also stop adjusting daylight savings for gmt printing.
* PR/411: Fix memory corruption from corrupt cdf file.
- Refresh and rename patches
file-5.20-endian.patch becomes file-5.23-endian.patch
file-5.22.dif becomes file-5.23.dif
Refresh patch file-secure_getenv.patch
-------------------------------------------------------------------
Mon Jan 19 10:48:12 UTC 2015 - werner@suse.de

View File

@ -30,7 +30,7 @@ Obsoletes: file-64bit
%endif
#
# Set Version also in python-magic.spec
Version: 5.22
Version: 5.23
Release: 0
Summary: A Tool to Determine File Types
License: BSD-2-Clause
@ -38,7 +38,7 @@ Group: Productivity/File utilities
Source: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz
Source2: baselibs.conf
Source3: file-rpmlintrc
Patch: file-5.22.dif
Patch: file-5.23.dif
Patch1: file-5.19-misc.dif
Patch4: file-4.24-autoconf.dif
Patch5: file-5.14-tex.dif
@ -58,7 +58,7 @@ Patch27: file-5.19-zip2.0.dif
Patch31: file-5.19-biorad.dif
Patch32: file-5.19-clicfs.dif
Patch33: file-5.16-ocloexec.patch
Patch34: file-5.20-endian.patch
Patch34: file-5.23-endian.patch
Patch35: file-5.12-nitpick.dif
Patch36: file-5.15-clear-invalid.patch
Patch37: file-secure_getenv.patch

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Jun 11 15:15:34 UTC 2015 - werner@suse.de
- adapt version in specfile to 5.23
-------------------------------------------------------------------
Tue Jan 20 11:11:43 UTC 2015 - werner@suse.de

View File

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