Hello community, here is the log from the commit of package file for openSUSE:Factory checked in at 2013-01-29 06:55:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/file (Old) and /work/SRC/openSUSE:Factory/.file.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "file", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/file/file.changes 2012-11-28 10:18:50.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.file.new/file.changes 2013-01-29 06:55:49.000000000 +0100 @@ -1,0 +2,32 @@ +Wed Jan 23 13:00:47 UTC 2013 - [email protected] + +- Make if build on ppc64, that is re-add the configure check for + sizeof long long otherwise readelf fail on ppc64 + +------------------------------------------------------------------- +Tue Jan 22 16:22:05 UTC 2013 - [email protected] + +- Update to file version 5.12 + * Warn about inconsistent continuation levels. + * Change fsmagic to add a space after it prints. + * Make getline public so that file can link against it. + Perhaps it is better to rename it, or hide it differently. + Fixes builds on platforms that do not provide it. + * Add SuS d{,1,2,4,8}, u{,1,2,4,8} and document + what long, int, short, etc is (Guy Harris) + * add magic_version function and constant + * Redo memory allocation and de-allocation. + (prevents double frees on non mmap platforms) + * Fix bug with name/use having to do with passing + found state from the parent to the child and back. + * Only print elf capabilities for archs we know (Jan Kaluza) + * Add "name" and "use" file types in order to look + inside mach-o files. + * add string/T (Jan Kaluza) + * search for $HOME/.magic.mgc if it is there first + * fix reads from a pipe, and preserve errno + * use ctime_r, asctime_r + * Fixes for indirect offsets to handle apple disk formats +- Also includes our extfs-minix patch + +------------------------------------------------------------------- Old: ---- file-4.24-warn.dif file-5.02-javacheck.dif file-5.07-llvm.dif file-5.07-misc.dif file-5.07-zip.dif file-5.07-zip2.0.dif file-5.10-visibility.patch file-5.10.dif file-5.11-extfs-minix.dif file-5.11-nitpick.dif file-5.11.tar.gz file-endian.patch file-ocloexec.patch New: ---- file-5.12-endian.patch file-5.12-javacheck.dif file-5.12-llong.dif file-5.12-misc.dif file-5.12-nitpick.dif file-5.12-ocloexec.patch file-5.12-upstream.patch file-5.12-visibility.patch file-5.12-zip.dif file-5.12-zip2.0.dif file-5.12.dif file-5.12.tar.gz file-rpmlintrc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ file.spec ++++++ --- /var/tmp/diff_new_pack.ffbkho/_old 2013-01-29 06:55:50.000000000 +0100 +++ /var/tmp/diff_new_pack.ffbkho/_new 2013-01-29 06:55:50.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package file # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,41 +27,39 @@ %endif # # Set Version also in python-magic.spec -Version: 5.11 +Version: 5.12 Release: 0 Summary: A Tool to Determine File Types License: BSD-2-Clause Group: Productivity/File utilities Source: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz Source2: baselibs.conf -Patch: file-5.10.dif -Patch1: file-5.07-misc.dif +Patch: file-5.12.dif +Patch1: file-5.12-misc.dif +Patch2: file-5.12-llong.dif Patch4: file-4.24-autoconf.dif Patch5: file-4.03-tex.dif Patch7: file-4.20-ssd.dif Patch8: file-4.20-xen.dif Patch9: file-5.07-elf.dif Patch10: file-4.18-printf.dif -Patch11: file-5.07-zip.dif +Patch11: file-5.12-zip.dif Patch12: file-5.07-option.dif Patch13: file-4.21-scribus.dif Patch15: file-4.21-xcursor.dif Patch20: file-4.24-mips.dif Patch22: file-4.24-cromfs.dif -Patch24: file-4.24-warn.dif -Patch25: file-5.02-javacheck.dif +Patch25: file-5.12-javacheck.dif Patch26: file-4.24-solv.dif -Patch27: file-5.07-zip2.0.dif +Patch27: file-5.12-zip2.0.dif Patch28: file-5.07-iso9660.dif -Patch29: file-5.07-llvm.dif -Patch30: file-5.10-visibility.patch +Patch30: file-5.12-visibility.patch Patch31: file-5.07-biorad.dif Patch32: file-5.07-clicfs.dif -Patch33: file-ocloexec.patch -Patch34: file-endian.patch -Patch35: file-5.11-nitpick.dif -# PATCH-FEATURE-SLE file-5.11-extfs-minix.dif [bnc#788435] -Patch36: file-5.11-extfs-minix.dif +Patch33: file-5.12-ocloexec.patch +Patch34: file-5.12-endian.patch +Patch35: file-5.12-nitpick.dif +Patch42: file-5.12-upstream.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _miscdir %{_datadir}/misc @@ -72,18 +70,18 @@ /etc/magic, which contains the classification criteria. This command is used by apsfilter to permit automatic printing of different file types. -%package -n libmagic-data +%package -n file-magic Summary: The magic files for libmagic to use Group: Development/Libraries/Other -%description -n libmagic-data +%description -n file-magic This package contains the basic magic files that libmagic reads and uses to estimate a file's type. %package -n libmagic1 Summary: Library with file's functionality Group: Development/Libraries/Other -Requires: libmagic-data = %{version} +Requires: file-magic = %{version} %description -n libmagic1 This library reads magic files and detects file types. Used by file command @@ -101,7 +99,9 @@ %prep %setup -q -n file-%{version} +%patch42 -p1 %patch1 -p0 -b .misc +%patch2 -p0 -b .llong %patch4 -p0 -b .conf %patch5 -p0 -b .tex %patch7 -p0 -b .ssd @@ -116,19 +116,16 @@ %patch20 -p0 -b .mips %endif %patch22 -p0 -b .cromfs -%patch24 -p0 -b .warn %patch25 -p0 -b .javacheck %patch26 -p0 -b .solv %patch27 -p0 -b .zip2.0 %patch28 -p0 -b .iso9600 -%patch29 -p0 -b .llvm %patch30 -p0 -b .vis %patch31 -p0 -b .biorad %patch32 -p0 -b .clicfs %patch33 -p0 -b .clexe %patch34 -p0 -b .endian %patch35 -p0 -b .nitpick -%patch36 -p0 -b .extnotminix %patch -b .0 %build export LANG=POSIX @@ -138,6 +135,24 @@ autoreconf -fiv CFLAGS="$RPM_OPT_FLAGS -DHOWMANY=69632" %configure --disable-silent-rules --datadir=%{_miscdir} --disable-static --with-pic --enable-fsect-man5 +# +# Used by patch #30 the visibility patch which allows us to +# export only the public magic_<...>() functions of libmagic.so +# +pushd src/ + %{__make} %{?_smp_mflags} pkgdatadir='$(datadir)' magic.h + cat > libmagic.map <<-'EOF' + { + global: + EOF + sed -rn '/[[:alnum:]]+_[[:alnum:]]+\(/{ + s/.*([[:blank:]\*])([[:alnum:]]+_[[:alnum:]]+)\(.*\);/ \2\;/p + }' < magic.h >> libmagic.map + cat >> libmagic.map <<-'EOF' + local: *; + }; + EOF +popd %{__make} %{?_smp_mflags} pkgdatadir='$(datadir)' %if 0%{?build_python_bindings:1} pushd python @@ -170,7 +185,7 @@ %defattr (644,root,root,755) %{_libdir}/lib*.so.* -%files -n libmagic-data +%files -n file-magic %defattr (644,root,root,755) %config(noreplace) %{_sysconfdir}/magic %{_miscdir}/magic ++++++ python-magic.spec ++++++ --- /var/tmp/diff_new_pack.ffbkho/_old 2013-01-29 06:55:50.000000000 +0100 +++ /var/tmp/diff_new_pack.ffbkho/_new 2013-01-29 06:55:50.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-magic # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed ++++++ file-5.12-endian.patch ++++++ --- src/apprentice.c +++ src/apprentice.c 2013-01-22 15:08:18.325452293 +0000 @@ -48,6 +48,7 @@ FILE_RCSID("@(#)$File: apprentice.c,v 1. #include <sys/mman.h> #endif #include <dirent.h> +#include <byteswap.h> #define EATAB {while (isascii((unsigned char) *l) && \ isspace((unsigned char) *l)) ++l;} @@ -109,9 +110,11 @@ private struct mlist *mlist_alloc(void); private void mlist_free(struct mlist *); private void byteswap(struct magic *, uint32_t); private void bs1(struct magic *); -private uint16_t swap2(uint16_t); -private uint32_t swap4(uint32_t); -private uint64_t swap8(uint64_t); + +#define swap2(x) bswap_16(x) +#define swap4(x) bswap_32(x) +#define swap8(x) bswap_64(x) + private char *mkdbname(struct magic_set *, const char *, int); private struct magic_map *apprentice_map(struct magic_set *, const char *); private void apprentice_unmap(struct magic_map *); @@ -2788,67 +2791,6 @@ byteswap(struct magic *magic, uint32_t n } /* - * swap a short - */ -private uint16_t -swap2(uint16_t sv) -{ - uint16_t rv; - uint8_t *s = (uint8_t *)(void *)&sv; - uint8_t *d = (uint8_t *)(void *)&rv; - d[0] = s[1]; - d[1] = s[0]; - return rv; -} - -/* - * swap an int - */ -private uint32_t -swap4(uint32_t sv) -{ - uint32_t rv; - uint8_t *s = (uint8_t *)(void *)&sv; - uint8_t *d = (uint8_t *)(void *)&rv; - d[0] = s[3]; - d[1] = s[2]; - d[2] = s[1]; - d[3] = s[0]; - return rv; -} - -/* - * swap a quad - */ -private uint64_t -swap8(uint64_t sv) -{ - uint64_t rv; - uint8_t *s = (uint8_t *)(void *)&sv; - uint8_t *d = (uint8_t *)(void *)&rv; -#if 0 - d[0] = s[3]; - d[1] = s[2]; - d[2] = s[1]; - d[3] = s[0]; - d[4] = s[7]; - d[5] = s[6]; - d[6] = s[5]; - d[7] = s[4]; -#else - d[0] = s[7]; - d[1] = s[6]; - d[2] = s[5]; - d[3] = s[4]; - d[4] = s[3]; - d[5] = s[2]; - d[6] = s[1]; - d[7] = s[0]; -#endif - return rv; -} - -/* * byteswap a single magic entry */ private void --- src/cdf.c +++ src/cdf.c 2013-01-22 00:00:00.000000000 +0000 @@ -50,6 +50,7 @@ FILE_RCSID("@(#)$File: cdf.c,v 1.51 2012 #ifdef HAVE_LIMITS_H #include <limits.h> #endif +#include <byteswap.h> #ifndef EFTYPE #define EFTYPE EINVAL @@ -75,56 +76,9 @@ static union { #define CDF_TOLE2(x) ((uint16_t)(NEED_SWAP ? _cdf_tole2(x) : (uint16_t)(x))) #define CDF_GETUINT32(x, y) cdf_getuint32(x, y) - -/* - * swap a short - */ -static uint16_t -_cdf_tole2(uint16_t sv) -{ - uint16_t rv; - uint8_t *s = (uint8_t *)(void *)&sv; - uint8_t *d = (uint8_t *)(void *)&rv; - d[0] = s[1]; - d[1] = s[0]; - return rv; -} - -/* - * swap an int - */ -static uint32_t -_cdf_tole4(uint32_t sv) -{ - uint32_t rv; - uint8_t *s = (uint8_t *)(void *)&sv; - uint8_t *d = (uint8_t *)(void *)&rv; - d[0] = s[3]; - d[1] = s[2]; - d[2] = s[1]; - d[3] = s[0]; - return rv; -} - -/* - * swap a quad - */ -static uint64_t -_cdf_tole8(uint64_t sv) -{ - uint64_t rv; - uint8_t *s = (uint8_t *)(void *)&sv; - uint8_t *d = (uint8_t *)(void *)&rv; - d[0] = s[7]; - d[1] = s[6]; - d[2] = s[5]; - d[3] = s[4]; - d[4] = s[3]; - d[5] = s[2]; - d[6] = s[1]; - d[7] = s[0]; - return rv; -} +#define _cdf_tole2(x) bswap_16(x) +#define _cdf_tole4(x) bswap_32(x) +#define _cdf_tole8(x) bswap_64(x) /* * grab a uint32_t from a possibly unaligned address, and return it in ++++++ file-5.02-javacheck.dif -> file-5.12-javacheck.dif ++++++ --- /work/SRC/openSUSE:Factory/file/file-5.02-javacheck.dif 2011-09-23 01:57:30.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.file.new/file-5.12-javacheck.dif 2013-01-29 06:55:49.000000000 +0100 @@ -1,11 +1,11 @@ --- magic/Magdir/cafebabe -+++ magic/Magdir/cafebabe 2009-05-05 14:11:37.858402267 +0200 -@@ -12,7 +12,7 @@ - # (and use as a hack). Let's not use 18, because the Mach-O people ++++ magic/Magdir/cafebabe 2013-01-22 14:34:00.199417547 +0000 +@@ -15,7 +15,7 @@ # might add another one or two as time goes by... # + ### JAVA START ### -0 belong 0xcafebabe -+0 belong 0xcafebabe cafebabe ++0 belong 0xcafebabe Cafe Babe !:mime application/x-java-applet >4 belong >30 compiled Java class data, >>6 beshort x version %d. ++++++ file-5.12-llong.dif ++++++ --- configure.ac +++ configure.ac 2013-01-23 12:57:44.605952352 +0000 @@ -107,6 +107,7 @@ AC_TYPE_UINT32_T AC_TYPE_INT32_T AC_TYPE_UINT64_T AC_TYPE_INT64_T +AC_CHECK_SIZEOF(long long) AC_FUNC_MMAP AC_FUNC_FORK AC_FUNC_MBRTOWC ++++++ file-5.07-misc.dif -> file-5.12-misc.dif ++++++ --- /work/SRC/openSUSE:Factory/file/file-5.07-misc.dif 2011-09-23 01:57:31.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.file.new/file-5.12-misc.dif 2013-01-29 06:55:49.000000000 +0100 @@ -11,7 +11,7 @@ 0 string MAS_U ULT(imate) Module sound data --- magic/Magdir/bsdi +++ magic/Magdir/bsdi 2003-12-08 16:50:03.000000000 +0000 -@@ -21,7 +21,7 @@ +@@ -11,7 +11,7 @@ >32 byte 0x6a (uses shared libs) # same as in SunOS 4.x, except for static shared libraries @@ -20,7 +20,7 @@ >0 byte &0x80 >>20 belong <4096 shared library >>20 belong =4096 dynamically linked executable -@@ -30,13 +30,13 @@ +@@ -20,13 +20,13 @@ >16 belong >0 not stripped >36 belong 0xb4100001 (uses shared libs) @@ -37,19 +37,19 @@ >0 byte ^0x80 executable >16 belong >0 not stripped --- magic/Magdir/mach -+++ magic/Magdir/mach 2003-12-08 16:50:03.000000000 +0000 -@@ -76,7 +76,7 @@ - >4 belong 11 hppa - >4 belong 12 acorn - >4 belong 13 m88k -->4 belong 14 sparc -+>4 belong 14 SPARC - >4 belong 15 i860-big - >4 belong 16 i860 - >4 belong 17 rs6000 ++++ magic/Magdir/mach 2013-01-22 14:29:39.261451501 +0000 +@@ -122,7 +122,7 @@ + >>>8 belong&0x00ffffff 1 mc88100 + >>>8 belong&0x00ffffff 2 mc88110 + >>>8 belong&0x00ffffff >2 mc88000 subarchitecture=%ld +->>4 belong&0x00ffffff 14 sparc ++>>4 belong&0x00ffffff 14 SPARC + >>4 belong&0x00ffffff 15 i860g + >>4 belong&0x00ffffff 16 alpha + >>4 belong&0x00ffffff 17 rs6000 --- magic/Magdir/netbsd +++ magic/Magdir/netbsd 2003-12-08 16:50:03.000000000 +0000 -@@ -102,25 +102,25 @@ +@@ -100,25 +100,25 @@ 0 belong&0377777777 045200507 a.out NetBSD/powerpc core >12 string >\0 from '%s' @@ -80,28 +80,28 @@ >32 belong !0 (signal %d) --- magic/Magdir/sun -+++ magic/Magdir/sun 2006-11-22 14:49:20.000000000 +0000 -@@ -6,7 +6,7 @@ - # Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x - # releases. (5.x uses ELF.) ++++ magic/Magdir/sun 2013-01-22 14:30:30.861452080 +0000 +@@ -9,7 +9,7 @@ + # are in aout, as they're indistinguishable from other big-endian + # 32-bit a.out files. # --0 belong&077777777 0600413 sparc demand paged -+0 belong&077777777 0600413 SPARC demand paged +-0 belong&077777777 0600413 a.out SunOS sparc demand paged ++0 belong&077777777 0600413 a.out SunOS SPARC demand paged >0 byte &0x80 >>20 belong <4096 shared library >>20 belong =4096 dynamically linked executable -@@ -14,12 +14,12 @@ +@@ -17,12 +17,12 @@ >0 byte ^0x80 executable >16 belong >0 not stripped --0 belong&077777777 0600410 sparc pure -+0 belong&077777777 0600410 SPARC pure +-0 belong&077777777 0600410 a.out SunOS sparc pure ++0 belong&077777777 0600410 a.out SunOS SPARC pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped --0 belong&077777777 0600407 sparc -+0 belong&077777777 0600407 SPARC +-0 belong&077777777 0600407 a.out SunOS sparc ++0 belong&077777777 0600407 a.out SunOS SPARC >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped ++++++ file-5.11-nitpick.dif -> file-5.12-nitpick.dif ++++++ --- /work/SRC/openSUSE:Factory/file/file-5.11-nitpick.dif 2012-09-23 21:16:02.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.file.new/file-5.12-nitpick.dif 2013-01-29 06:55:49.000000000 +0100 @@ -1,5 +1,5 @@ --- src/file.c -+++ src/file.c 2012-09-18 10:27:51.094936322 +0000 ++++ src/file.c 2013-01-22 14:49:49.305453781 +0000 @@ -94,10 +94,12 @@ private const char *separator = ":"; /* private const struct option long_options[] = { #define OPT(shortname, longname, opt, doc) \ @@ -13,7 +13,7 @@ #undef OPT_LONGONLY {0, 0, NULL, 0} }; -@@ -487,16 +489,21 @@ usage(void) +@@ -522,6 +524,7 @@ docprint(const char *opts) private void help(void) { @@ -21,14 +21,17 @@ (void)fputs( "Usage: file [OPTION...] [FILE...]\n" "Determine type of FILEs.\n" - "\n", stdout); +@@ -529,11 +532,16 @@ help(void) #define OPT(shortname, longname, opt, doc) \ - fprintf(stdout, " -%c, --" longname doc, shortname); + fprintf(stdout, " -%c, --" longname, shortname), \ + docprint(doc); +#define OPT_POSIX(shortname, longname, opt, doc) \ -+ fprintf(stdout, " -%c, --" longname doc "%s\n", shortname, \ -+ (shortname == 'L') ? (posix ? " (default)" : "") : (posix ? "" : " (default)")); ++ fprintf(stdout, " -%c, --" longname "%s", shortname, \ ++ (shortname == 'L') ? (posix ? " (default)" : "") : (posix ? "" : " (default)")), \ ++ docprint(doc); #define OPT_LONGONLY(longname, opt, doc) \ - fprintf(stdout, " --" longname doc); + fprintf(stdout, " --" longname), \ + docprint(doc); #include "file_opts.h" #undef OPT +#undef OPT_POSIX @@ -36,15 +39,15 @@ fprintf(stdout, "\nReport bugs to http://bugs.gw.com/\n"); exit(0); --- src/file_opts.h -+++ src/file_opts.h 2012-09-18 10:14:38.438397131 +0000 ++++ src/file_opts.h 2012-09-18 10:14:38.000000000 +0000 @@ -34,8 +34,8 @@ OPT_LONGONLY("mime-encoding", 0, " OPT('k', "keep-going", 0, " don't stop at the first match\n") #ifdef S_IFLNK OPT('l', "list", 0, " list magic strength\n") -OPT('L', "dereference", 0, " follow symlinks (default)\n") -OPT('h', "no-dereference", 0, " don't follow symlinks\n") -+OPT_POSIX('L', "dereference", 0, " follow symlinks") -+OPT_POSIX('h', "no-dereference", 0, " don't follow symlinks") ++OPT_POSIX('L', "dereference", 0, " follow symlinks\n") ++OPT_POSIX('h', "no-dereference", 0, " don't follow symlinks\n") #endif OPT('n', "no-buffer", 0, " do not buffer output\n") OPT('N', "no-pad", 0, " do not pad output\n") ++++++ file-5.12-ocloexec.patch ++++++ --- src/apprentice.c +++ src/apprentice.c 2013-01-22 14:39:18.865452095 +0000 @@ -927,7 +927,7 @@ load_1(struct magic_set *ms, int action, ssize_t len; struct magic_entry me; - FILE *f = fopen(ms->file = fn, "r"); + FILE *f = fopen(ms->file = fn, "re"); if (f == NULL) { if (errno != ENOENT) file_error(ms, errno, "cannot read magic file `%s'", @@ -2579,7 +2579,7 @@ apprentice_map(struct magic_set *ms, con if (dbname == NULL) goto error; - if ((fd = open(dbname, O_RDONLY|O_BINARY)) == -1) + if ((fd = open(dbname, O_RDONLY|O_BINARY|O_CLOEXEC)) == -1) goto error; if (fstat(fd, &st) == -1) { @@ -2691,7 +2691,7 @@ apprentice_compile(struct magic_set *ms, if (dbname == NULL) goto out; - if ((fd = open(dbname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644)) == -1) + if ((fd = open(dbname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY|O_CLOEXEC, 0644)) == -1) { file_error(ms, errno, "cannot open `%s'", dbname); goto out; --- src/compress.c +++ src/compress.c 2013-01-22 14:37:22.969952110 +0000 @@ -252,7 +252,7 @@ file_pipe2file(struct magic_set *ms, int #else { int te; - tfd = mkstemp(buf); + tfd = mkostemp(buf, O_CLOEXEC); te = errno; (void)unlink(buf); errno = te; --- src/file.c +++ src/file.c 2013-01-22 00:00:00.000000000 +0000 @@ -390,7 +390,7 @@ unwrap(struct magic_set *ms, const char f = stdin; wid = 1; } else { - if ((f = fopen(fn, "r")) == NULL) { + if ((f = fopen(fn, "re")) == NULL) { (void)fprintf(stderr, "%s: Cannot open `%s' (%s).\n", progname, fn, strerror(errno)); return 1; --- src/magic.c +++ src/magic.c 2013-01-22 00:00:00.000000000 +0000 @@ -369,7 +369,7 @@ file_or_fd(struct magic_set *ms, const c if (fstat(fd, &sb) == 0 && S_ISFIFO(sb.st_mode)) ispipe = 1; } else { - int flags = O_RDONLY|O_BINARY; + int flags = O_RDONLY|O_BINARY|O_CLOEXEC; if (stat(inname, &sb) == 0 && S_ISFIFO(sb.st_mode)) { #ifdef O_NONBLOCK ++++++ file-5.12-upstream.patch ++++++ ++++ 3787 lines (skipped) ++++++ file-5.10-visibility.patch -> file-5.12-visibility.patch ++++++ --- /work/SRC/openSUSE:Factory/file/file-5.10-visibility.patch 2012-01-19 09:41:35.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.file.new/file-5.12-visibility.patch 2013-01-29 06:55:49.000000000 +0100 @@ -9,23 +9,3 @@ if MINGW MINGWLIBS = -lgnurx -lshlwapi else ---- src/libmagic.map -+++ src/libmagic.map 2011-06-14 00:00:00.000000000 +0000 -@@ -0,0 +1,17 @@ -+{ -+global: -+ magic_buffer; -+ magic_check; -+ magic_close; -+ magic_compile; -+ magic_descriptor; -+ magic_errno; -+ magic_error; -+ magic_file; -+ magic_getpath; -+ magic_list; -+ magic_load; -+ magic_open; -+ magic_setflags; -+local: *; -+}; ++++++ file-5.07-zip.dif -> file-5.12-zip.dif ++++++ --- /work/SRC/openSUSE:Factory/file/file-5.07-zip.dif 2011-09-23 01:57:31.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.file.new/file-5.12-zip.dif 2013-01-29 06:55:49.000000000 +0100 @@ -1,8 +1,8 @@ --- magic/Magdir/archive -+++ magic/Magdir/archive 2011-07-18 09:56:50.651926085 +0000 -@@ -571,6 +571,20 @@ - ++++ magic/Magdir/archive 2013-01-22 14:56:24.865452717 +0000 +@@ -592,6 +592,19 @@ # Zip archives (Greg Roelofs, c/o [email protected]) + 0 string PK\005\006 Zip archive data (empty) 0 string PK\003\004 +>30 ubelong !0x6d696d65 +>>4 byte 0x00 Zip archive data @@ -17,7 +17,6 @@ +!:mime application/zip +>>4 byte 0x14 Zip archive data, at least v2.0 to extract +!:mime application/zip -+ # Specialised zip formats which start with a member named 'mimetype' # (stored uncompressed, with no 'extra field') containing the file's MIME type. ++++++ file-5.07-zip.dif -> file-5.12-zip2.0.dif ++++++ --- /work/SRC/openSUSE:Factory/file/file-5.07-zip.dif 2011-09-23 01:57:31.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.file.new/file-5.12-zip2.0.dif 2013-01-29 06:55:49.000000000 +0100 @@ -1,23 +1,13 @@ --- magic/Magdir/archive -+++ magic/Magdir/archive 2011-07-18 09:56:50.651926085 +0000 -@@ -571,6 +571,20 @@ ++++ magic/Magdir/archive 2013-01-22 15:01:33.273452678 +0000 +@@ -588,6 +588,10 @@ + # PKZIP multi-volume archive + 0 string PK\x07\x08PK\x03\x04 Zip multi-volume archive data, at least PKZIP v2.50 to extract + !:mime application/zip ++>30 ubelong 0x6d696d65 Zip archive data, at least v2.0 to extract ++>>34 ubelong 0x74797065 \b, mime type ++>>>38 regex application/[a-z\+\-]+ \b %s ++!:mime application/unknown+zip # Zip archives (Greg Roelofs, c/o [email protected]) - 0 string PK\003\004 -+>30 ubelong !0x6d696d65 -+>>4 byte 0x00 Zip archive data -+!:mime application/zip -+>>4 byte 0x09 Zip archive data, at least v0.9 to extract -+!:mime application/zip -+>>4 byte 0x0a Zip archive data, at least v1.0 to extract -+!:mime application/zip -+>>4 byte 0x0b Zip archive data, at least v1.1 to extract -+!:mime application/zip -+>>0x161 string WINZIP Zip archive data, WinZIP self-extracting -+!:mime application/zip -+>>4 byte 0x14 Zip archive data, at least v2.0 to extract -+!:mime application/zip -+ - - # Specialised zip formats which start with a member named 'mimetype' - # (stored uncompressed, with no 'extra field') containing the file's MIME type. + 0 string PK\005\006 Zip archive data (empty) ++++++ file-4.24-warn.dif -> file-5.12.dif ++++++ --- /work/SRC/openSUSE:Factory/file/file-4.24-warn.dif 2011-09-23 01:57:30.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.file.new/file-5.12.dif 2013-01-29 06:55:49.000000000 +0100 @@ -1,10 +1,586 @@ ---- src/apprentice.c -+++ src/apprentice.c -@@ -562,6 +562,7 @@ - /* invalid search type, but no need to complain here */ - break; - } -+ return 0; - } +--- magic/Magdir/elf ++++ magic/Magdir/elf 2013-01-22 15:12:10.957452651 +0000 +@@ -127,7 +127,7 @@ + >18 leshort 47 Renesas H8/300H, + >18 leshort 48 Renesas H8S, + >18 leshort 49 Renesas H8/500, +->18 leshort 50 IA-64, ++>18 leshort 50 IA-64 (Intel 64 bit architecture), + >18 leshort 51 Stanford MIPS-X, + >18 leshort 52 Motorola Coldfire, + >18 leshort 53 Motorola M68HC12, +--- magic/Magdir/linux ++++ magic/Magdir/linux 2013-01-22 15:16:40.925952418 +0000 +@@ -97,22 +97,44 @@ + # and Nicol�s Lichtmaier <[email protected]> + # All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29 + # Linux kernel boot images (i386 arch) (Wolfram Kleff) +-514 string HdrS Linux kernel ++514 string HdrS Linux + !:strength + 5 +->510 leshort 0xAA55 x86 boot executable +->>518 leshort >0x1ff +->>>529 byte 0 zImage, +->>>529 byte 1 bzImage, +->>>(526.s+0x200) string >\0 version %s, +->>498 leshort 1 RO-rootFS, +->>498 leshort 0 RW-rootFS, +->>508 leshort >0 root_dev 0x%X, +->>502 leshort >0 swap_dev 0x%X, +->>504 leshort >0 RAMdisksize %u KB, +->>506 leshort 0xFFFF Normal VGA +->>506 leshort 0xFFFE Extended VGA +->>506 leshort 0xFFFD Prompt for Videomode +->>506 leshort >0 Video mode %d ++>510 leshort 0xAA55 \b/x86 Kernel ++>510 leshort <0xAA55 Kernel ++>510 leshort >0xAA55 Kernel ++>518 leshort 0x0105 \b, Setup Version 0x105, zImage ++>518 leshort >0x0105 \b, Setup Version %#hx ++>>529 byte 0 \b, zImage ++>>529 byte 1 \b, bzImage ++>>>(526.s+0x205) byte 32 ++>>>>(526.s+0x200) string >\0 \b, Version %5.5s ++>>>(526.s+0x206) byte 32 ++>>>>(526.s+0x200) string >\0 \b, Version %6.6s ++>>>(526.s+0x207) byte 32 ++>>>>(526.s+0x200) string >\0 \b, Version %7.7s ++>>>(526.s+0x205) byte 45 ++>>>>(526.s+0x200) string >\0 \b, Version %5.5s ++>>>(526.s+0x206) byte 45 ++>>>>(526.s+0x200) string >\0 \b, Version %6.6s ++>>>(526.s+0x207) byte 45 ++>>>>(526.s+0x200) string >\0 \b, Version %7.7s ++>>>(526.s+0x208) byte 45 ++>>>>(526.s+0x200) string >\0 \b, Version %8.8s ++>>>(526.s+0x209) byte 45 ++>>>>(526.s+0x200) string >\0 \b, Version %9.9s ++>>>(526.s+0x20a) byte 45 ++>>>>(526.s+0x200) string >\0 \b, Version %10.10s ++>>>(526.s+0x20b) byte 45 ++>>>>(526.s+0x200) string >\0 \b, Version %11.11s ++>>498 leshort 1 \b, RO-rootFS ++>>498 leshort 0 \b, RW-rootFS ++>>508 leshort >0 \b, root_dev 0x%X ++>>502 leshort >0 \b, swap_dev 0x%X ++>>504 leshort >0 \b, RAMdisksize %u KB ++>>506 leshort 0xFFFF \b, Normal VGA ++>>506 leshort 0xFFFE \b, Extended VGA ++>>506 leshort 0xFFFD \b, Prompt for Videomode ++>>506 leshort >0 \b, Video mode %d + # This also matches new kernels, which were caught above by "HdrS". + 0 belong 0xb8c0078e Linux kernel + >0x1e3 string Loading version 1.3.79 or older +--- magic/Magdir/msad ++++ magic/Magdir/msad 2006-03-27 11:29:19.000000000 +0000 +@@ -0,0 +1,5 @@ ++#------------------------------------------------------------------------------ ++# msad: file(1) magic for msad ++# Microsoft visual C ++# This must precede the heuristic for raw G3 data ++4 string Standard\ Jet\ DB Microsoft Access Database +--- magic/Magdir/msdos ++++ magic/Magdir/msdos 2011-06-14 14:36:26.000000000 +0000 +@@ -99,9 +99,9 @@ + >>>(0x3c.l+22) leshort&0x0200 >0 (stripped to external PDB) + >>>(0x3c.l+22) leshort&0x1000 >0 system file + >>>(0x3c.l+24) leshort 0x010b +->>>>(0x3c.l+232) lelong >0 Mono/.Net assembly ++>>>>(0x3c.l+232) lelong >0 \b, Mono/.Net assembly + >>>(0x3c.l+24) leshort 0x020b +->>>>(0x3c.l+248) lelong >0 Mono/.Net assembly ++>>>>(0x3c.l+248) lelong >0 \b, Mono/.Net assembly - /* + # 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 2013-01-22 15:19:20.873952132 +0000 +@@ -5,7 +5,7 @@ MAGIC_FRAGMENT_BASE = Magdir + MAGIC_DIR = $(top_srcdir)/magic + MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE) + +-pkgdata_DATA = magic.mgc ++pkgdata_DATA = magic.mgc magic + + EXTRA_DIST = \ + $(MAGIC_DIR)/Header \ +@@ -20,7 +20,6 @@ $(MAGIC_FRAGMENT_DIR)/amigaos \ + $(MAGIC_FRAGMENT_DIR)/animation \ + $(MAGIC_FRAGMENT_DIR)/aout \ + $(MAGIC_FRAGMENT_DIR)/apl \ +-$(MAGIC_FRAGMENT_DIR)/apple \ + $(MAGIC_FRAGMENT_DIR)/applix \ + $(MAGIC_FRAGMENT_DIR)/archive \ + $(MAGIC_FRAGMENT_DIR)/assembler \ +@@ -73,7 +72,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \ + $(MAGIC_FRAGMENT_DIR)/erlang \ + $(MAGIC_FRAGMENT_DIR)/esri \ + $(MAGIC_FRAGMENT_DIR)/fcs \ +-$(MAGIC_FRAGMENT_DIR)/filesystems \ + $(MAGIC_FRAGMENT_DIR)/flash \ + $(MAGIC_FRAGMENT_DIR)/fonts \ + $(MAGIC_FRAGMENT_DIR)/fortran \ +@@ -110,6 +108,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ + $(MAGIC_FRAGMENT_DIR)/java \ + $(MAGIC_FRAGMENT_DIR)/javascript \ + $(MAGIC_FRAGMENT_DIR)/jpeg \ ++$(MAGIC_FRAGMENT_DIR)/linux \ ++$(MAGIC_FRAGMENT_DIR)/filesystems \ + $(MAGIC_FRAGMENT_DIR)/karma \ + $(MAGIC_FRAGMENT_DIR)/kde \ + $(MAGIC_FRAGMENT_DIR)/keepass \ +@@ -117,7 +117,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \ + $(MAGIC_FRAGMENT_DIR)/lecter \ + $(MAGIC_FRAGMENT_DIR)/lex \ + $(MAGIC_FRAGMENT_DIR)/lif \ +-$(MAGIC_FRAGMENT_DIR)/linux \ + $(MAGIC_FRAGMENT_DIR)/lisp \ + $(MAGIC_FRAGMENT_DIR)/llvm \ + $(MAGIC_FRAGMENT_DIR)/lua \ +@@ -125,7 +124,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \ + $(MAGIC_FRAGMENT_DIR)/m4 \ + $(MAGIC_FRAGMENT_DIR)/mach \ + $(MAGIC_FRAGMENT_DIR)/macos \ +-$(MAGIC_FRAGMENT_DIR)/macintosh \ + $(MAGIC_FRAGMENT_DIR)/magic \ + $(MAGIC_FRAGMENT_DIR)/mail.news \ + $(MAGIC_FRAGMENT_DIR)/make \ +@@ -144,10 +142,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ + $(MAGIC_FRAGMENT_DIR)/mkid \ + $(MAGIC_FRAGMENT_DIR)/mlssa \ + $(MAGIC_FRAGMENT_DIR)/mmdf \ +-$(MAGIC_FRAGMENT_DIR)/modem \ + $(MAGIC_FRAGMENT_DIR)/motorola \ + $(MAGIC_FRAGMENT_DIR)/mozilla \ + $(MAGIC_FRAGMENT_DIR)/msdos \ ++$(MAGIC_FRAGMENT_DIR)/modem \ + $(MAGIC_FRAGMENT_DIR)/msooxml \ + $(MAGIC_FRAGMENT_DIR)/msvc \ + $(MAGIC_FRAGMENT_DIR)/mup \ +@@ -189,6 +187,8 @@ $(MAGIC_FRAGMENT_DIR)/pyramid \ + $(MAGIC_FRAGMENT_DIR)/python \ + $(MAGIC_FRAGMENT_DIR)/revision \ + $(MAGIC_FRAGMENT_DIR)/riff \ ++$(MAGIC_FRAGMENT_DIR)/apple \ ++$(MAGIC_FRAGMENT_DIR)/macintosh \ + $(MAGIC_FRAGMENT_DIR)/rinex \ + $(MAGIC_FRAGMENT_DIR)/rpm \ + $(MAGIC_FRAGMENT_DIR)/rtf \ +@@ -257,8 +257,20 @@ $(MAGIC_FRAGMENT_DIR)/zfs \ + $(MAGIC_FRAGMENT_DIR)/zilog \ + $(MAGIC_FRAGMENT_DIR)/zyxel + ++RAW = magic + MAGIC = magic.mgc +-CLEANFILES = ${MAGIC} $(MAGIC_FRAGMENT_DIR)/Localstuff ++CLEANFILES = ${MAGIC} $(MAGIC_DIR)/Localstuff ${RAW} ++ ++${RAW}: $(MAGIC_DIR)/Header $(MAGIC_DIR)/Localstuff $(EXTRA_DIST) ++ cat /dev/null > $@ ++ for frag in $(EXTRA_DIST); do \ ++ if test -f $(srcdir)/$$frag; then \ ++ f=$(srcdir)/$$frag; \ ++ else \ ++ f=$$frag; \ ++ fi; \ ++ cat $$f; \ ++ done >> $@ + + # 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 +@@ -270,19 +282,22 @@ FILE_COMPILE = $(top_builddir)/src/file + FILE_COMPILE_DEP = $(FILE_COMPILE) + endif + +-${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) +- @rm -fr magic +- @mkdir magic && cp -p $(EXTRA_DIST) magic +- @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \ +- echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \ +- else \ +- v=$$(file --version | sed -e s/file-// -e q); \ +- if [ "$$v" != "${PACKAGE_VERSION}" ]; then \ +- echo "Cannot use the installed version of file ($$v) to"; \ +- echo "cross-compile file ${PACKAGE_VERSION}"; \ +- echo "Please install file ${PACKAGE_VERSION} locally first"; \ +- exit 1; \ +- fi; \ +- fi) +- $(FILE_COMPILE) -C -m magic +- @rm -fr magic ++${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) $(RAW) ++ $(FILE_COMPILE) -C -m $(RAW) ++ ++#${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) ++# @rm -fr magic ++# @mkdir magic && cp -p $(EXTRA_DIST) magic ++# @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \ ++# echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \ ++# else \ ++# v=$$(file --version | sed -e s/file-// -e q); \ ++# if [ "$$v" != "${PACKAGE_VERSION}" ]; then \ ++# echo "Cannot use the installed version of file ($$v) to"; \ ++# echo "cross-compile file ${PACKAGE_VERSION}"; \ ++# echo "Please install file ${PACKAGE_VERSION} locally first"; \ ++# exit 1; \ ++# fi; \ ++# fi) ++# $(FILE_COMPILE) -C -m magic ++# @rm -fr magic +--- magic/Makefile.in ++++ magic/Makefile.in 2013-01-22 15:20:18.609452535 +0000 +@@ -204,7 +204,7 @@ top_srcdir = @top_srcdir@ + MAGIC_FRAGMENT_BASE = Magdir + MAGIC_DIR = $(top_srcdir)/magic + MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE) +-pkgdata_DATA = magic.mgc ++pkgdata_DATA = magic.mgc magic + EXTRA_DIST = \ + $(MAGIC_DIR)/Header \ + $(MAGIC_DIR)/Localstuff \ +@@ -217,7 +217,6 @@ $(MAGIC_FRAGMENT_DIR)/amanda \ + $(MAGIC_FRAGMENT_DIR)/amigaos \ + $(MAGIC_FRAGMENT_DIR)/animation \ + $(MAGIC_FRAGMENT_DIR)/apl \ +-$(MAGIC_FRAGMENT_DIR)/apple \ + $(MAGIC_FRAGMENT_DIR)/applix \ + $(MAGIC_FRAGMENT_DIR)/archive \ + $(MAGIC_FRAGMENT_DIR)/assembler \ +@@ -270,7 +269,6 @@ $(MAGIC_FRAGMENT_DIR)/epoc \ + $(MAGIC_FRAGMENT_DIR)/erlang \ + $(MAGIC_FRAGMENT_DIR)/esri \ + $(MAGIC_FRAGMENT_DIR)/fcs \ +-$(MAGIC_FRAGMENT_DIR)/filesystems \ + $(MAGIC_FRAGMENT_DIR)/flash \ + $(MAGIC_FRAGMENT_DIR)/fonts \ + $(MAGIC_FRAGMENT_DIR)/fortran \ +@@ -306,6 +304,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ + $(MAGIC_FRAGMENT_DIR)/java \ + $(MAGIC_FRAGMENT_DIR)/javascript \ + $(MAGIC_FRAGMENT_DIR)/jpeg \ ++$(MAGIC_FRAGMENT_DIR)/linux \ ++$(MAGIC_FRAGMENT_DIR)/filesystems \ + $(MAGIC_FRAGMENT_DIR)/karma \ + $(MAGIC_FRAGMENT_DIR)/kde \ + $(MAGIC_FRAGMENT_DIR)/keepass \ +@@ -313,7 +313,6 @@ $(MAGIC_FRAGMENT_DIR)/kml \ + $(MAGIC_FRAGMENT_DIR)/lecter \ + $(MAGIC_FRAGMENT_DIR)/lex \ + $(MAGIC_FRAGMENT_DIR)/lif \ +-$(MAGIC_FRAGMENT_DIR)/linux \ + $(MAGIC_FRAGMENT_DIR)/lisp \ + $(MAGIC_FRAGMENT_DIR)/llvm \ + $(MAGIC_FRAGMENT_DIR)/lua \ +@@ -321,7 +320,6 @@ $(MAGIC_FRAGMENT_DIR)/luks \ + $(MAGIC_FRAGMENT_DIR)/m4 \ + $(MAGIC_FRAGMENT_DIR)/mach \ + $(MAGIC_FRAGMENT_DIR)/macos \ +-$(MAGIC_FRAGMENT_DIR)/macintosh \ + $(MAGIC_FRAGMENT_DIR)/magic \ + $(MAGIC_FRAGMENT_DIR)/mail.news \ + $(MAGIC_FRAGMENT_DIR)/make \ +@@ -340,10 +338,10 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ + $(MAGIC_FRAGMENT_DIR)/mkid \ + $(MAGIC_FRAGMENT_DIR)/mlssa \ + $(MAGIC_FRAGMENT_DIR)/mmdf \ +-$(MAGIC_FRAGMENT_DIR)/modem \ + $(MAGIC_FRAGMENT_DIR)/motorola \ + $(MAGIC_FRAGMENT_DIR)/mozilla \ + $(MAGIC_FRAGMENT_DIR)/msdos \ ++$(MAGIC_FRAGMENT_DIR)/modem \ + $(MAGIC_FRAGMENT_DIR)/msooxml \ + $(MAGIC_FRAGMENT_DIR)/msvc \ + $(MAGIC_FRAGMENT_DIR)/mup \ +@@ -385,6 +383,8 @@ $(MAGIC_FRAGMENT_DIR)/pyramid \ + $(MAGIC_FRAGMENT_DIR)/python \ + $(MAGIC_FRAGMENT_DIR)/revision \ + $(MAGIC_FRAGMENT_DIR)/riff \ ++$(MAGIC_FRAGMENT_DIR)/apple \ ++$(MAGIC_FRAGMENT_DIR)/macintosh \ + $(MAGIC_FRAGMENT_DIR)/rinex \ + $(MAGIC_FRAGMENT_DIR)/rpm \ + $(MAGIC_FRAGMENT_DIR)/rtf \ +@@ -453,10 +453,22 @@ $(MAGIC_FRAGMENT_DIR)/zfs \ + $(MAGIC_FRAGMENT_DIR)/zilog \ + $(MAGIC_FRAGMENT_DIR)/zyxel + ++RAW = magic + MAGIC = magic.mgc +-CLEANFILES = ${MAGIC} $(MAGIC_FRAGMENT_DIR)/Localstuff ++CLEANFILES = ${MAGIC} $(MAGIC_DIR)/Localstuff ${RAW} + @IS_CROSS_COMPILE_FALSE@FILE_COMPILE = $(top_builddir)/src/file + ++${RAW}: $(MAGIC_DIR)/Header $(MAGIC_DIR)/Localstuff $(EXTRA_DIST) ++ cat /dev/null > $@ ++ for frag in $(EXTRA_DIST); do \ ++ if test -f $(srcdir)/$$frag; then \ ++ f=$(srcdir)/$$frag; \ ++ else \ ++ f=$$frag; \ ++ fi; \ ++ cat $$f; \ ++ done >> $@ ++ + # 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 +@@ -671,23 +683,25 @@ uninstall-am: uninstall-pkgdataDATA + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-pkgdataDATA + ++${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) $(RAW) ++ $(FILE_COMPILE) -C -m $(RAW + +-${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) +- @rm -fr magic +- @mkdir magic && cp -p $(EXTRA_DIST) magic +- @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \ +- echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \ +- else \ +- v=$$(file --version | sed -e s/file-// -e q); \ +- if [ "$$v" != "${PACKAGE_VERSION}" ]; then \ +- echo "Cannot use the installed version of file ($$v) to"; \ +- echo "cross-compile file ${PACKAGE_VERSION}"; \ +- echo "Please install file ${PACKAGE_VERSION} locally first"; \ +- exit 1; \ +- fi; \ +- fi) +- $(FILE_COMPILE) -C -m magic +- @rm -fr magic ++#${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) ++# @rm -fr magic ++# @mkdir magic && cp -p $(EXTRA_DIST) magic ++# @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \ ++# echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \ ++# else \ ++# v=$$(file --version | sed -e s/file-// -e q); \ ++# if [ "$$v" != "${PACKAGE_VERSION}" ]; then \ ++# echo "Cannot use the installed version of file ($$v) to"; \ ++# echo "cross-compile file ${PACKAGE_VERSION}"; \ ++# echo "Please install file ${PACKAGE_VERSION} locally first"; \ ++# exit 1; \ ++# fi; \ ++# fi) ++# $(FILE_COMPILE) -C -m magic ++# @rm -fr magic + + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. +--- src/Makefile.am ++++ src/Makefile.am 2008-04-14 15:14:56.000000000 +0000 +@@ -1,4 +1,4 @@ +-MAGIC = $(pkgdatadir)/magic ++MAGIC = $(sysconfdir)/magic:$(pkgdatadir)/magic + lib_LTLIBRARIES = libmagic.la + include_HEADERS = magic.h + +--- src/dcore.c ++++ src/dcore.c 2006-03-27 11:29:19.000000000 +0000 +@@ -0,0 +1,207 @@ ++/* ++ * Show goo about ELF core files ++ * Jeremy Fitzhardinge <[email protected]> 1996 ++ */ ++#include <unistd.h> ++#include <fcntl.h> ++#include <stdlib.h> ++#include <stdio.h> ++#include <sys/types.h> ++#include <string.h> ++#if defined __GLIBC__ && __GLIBC__ >= 2 ++#include <elf.h> ++#include <sys/procfs.h> ++# ifndef NT_PRFPREG ++# define NT_PRFPREG 2 ++# endif ++# ifndef NT_TASKSTRUCT ++# define NT_TASKSTRUCT 4 ++# endif ++#else ++#include <linux/elf.h> ++#include <linux/elfcore.h> ++#endif ++ ++static void fperror(const char *str) ++{ ++ perror(str); ++ exit(1); ++} ++ ++static size_t myread(int fd, void *buf, size_t sz) ++{ ++ size_t ret; ++ ++ if ((ret = read(fd, buf, sz)) != sz) ++ fperror("read failed"); ++ return ret; ++} ++ ++static void print_prstatus(const prstatus_t *pr) ++{ ++ unsigned i; ++ static const char *regs[] = { "ebx", "ecx", "edx", "esi", "edi", "ebp", ++ "eax", "ds", "es", "fs", "gs", ++ "orig_eax", "eip", "cs", ++ "efl", "uesp", "ss"}; ++ ++ printf(" pid=%d ppid=%d pgrp=%d sid=%d\n", ++ pr->pr_pid, pr->pr_ppid, pr->pr_pgrp, pr->pr_sid); ++ for(i = 0; i < NGREG; i++) ++ { ++ unsigned long val = pr->pr_reg[i]; ++ printf(" %-2u %-5s=%08lx %lu\n", i, regs[i], val, val); ++ } ++} ++ ++static void print_prpsinfo(const prpsinfo_t *ps) ++{ ++ printf(" uid=%d gid=%d\n", ps->pr_uid, ps->pr_gid); ++ printf(" comm=%s\n", ps->pr_fname); ++ printf(" psargs=%s\n", ps->pr_psargs); ++} ++ ++#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) ++ ++static void do_note(int fd, Elf32_Phdr *phdr) ++{ ++ off_t here = lseek(fd, 0, SEEK_CUR); ++ int size = phdr->p_filesz; ++ char *raw = alloca(size), *end; ++ end = raw+size; ++ ++ lseek(fd, phdr->p_offset, SEEK_SET); ++ myread(fd, raw, size); ++ ++ while(raw < end) ++ { ++ Elf32_Nhdr *note = (Elf32_Nhdr *)raw; ++ const char *str; ++ const char *name, *desc; ++ ++ raw += sizeof(*note); ++ name = raw; ++ raw += roundup(note->n_namesz, sizeof(long)); ++ desc = raw; ++ raw += roundup(note->n_descsz, sizeof(long)); ++ ++ printf(" name=%.*s", (int)note->n_namesz, name); ++ ++ if(strncmp(name, "CORE", note->n_namesz) != 0) ++ { ++ printf("\n"); ++ continue; ++ } ++ ++ switch(note->n_type) ++ { ++#define X(x) case x: str = #x; break; ++ X(NT_PRSTATUS); ++ X(NT_PRFPREG); ++ X(NT_PRPSINFO); ++ X(NT_TASKSTRUCT); ++#undef X ++ default: ++ str = "???"; ++ } ++ printf(" n_type=%s n_descsz=%ld\n", ++ str, note->n_descsz); ++ switch(note->n_type) ++ { ++ case NT_PRSTATUS: ++ print_prstatus((prstatus_t *)desc); ++ break; ++ case NT_PRPSINFO: ++ print_prpsinfo((prpsinfo_t *)desc); ++ break; ++ } ++ } ++ lseek(fd, here, SEEK_SET); ++} ++ ++int main(int argc, char *argv[]) ++{ ++ int fd; ++ Elf32_Ehdr elf; ++ int i; ++ ++ if (argc != 2) ++ { ++ fprintf(stderr, "Usage: %s corefile\n", argv[0]); ++ exit(1); ++ } ++ ++ if ((fd = open(argv[1], O_RDONLY)) == -1) ++ fperror("open of core"); ++ ++ myread(fd, &elf, sizeof(elf)); ++ ++ if (memcmp(ELFMAG, elf.e_ident, SELFMAG) != 0) ++ printf("bad magic\n"); ++ ++ if (elf.e_ident[EI_CLASS] != ELFCLASS32) ++ printf("wrong class\n"); ++ ++ if (elf.e_ident[EI_DATA] != ELFDATA2LSB) ++ printf("wrong endianess\n"); ++ ++ if (elf.e_ident[EI_VERSION] != EV_CURRENT) ++ printf("wrong version\n"); ++ ++ { ++ const char *str; ++ switch(elf.e_type) ++ { ++#define C(x) case ET_##x: str = #x; break; ++ C(NONE); ++ C(REL); ++ C(EXEC); ++ C(DYN); ++ C(CORE); ++#undef C ++ default: str = "???"; break; ++ } ++ printf("elf file type ET_%s\n", str); ++ } ++ ++ if (elf.e_machine != EM_386 && elf.e_machine != EM_486) ++ printf("not i386 or i486\n"); ++ ++ if (elf.e_ehsize != sizeof(elf)) ++ printf("wrong header size\n"); ++ ++ if (elf.e_phentsize != sizeof(Elf32_Phdr)) ++ printf("wrong phdr size\n"); ++ ++ if (lseek(fd, elf.e_phoff, SEEK_SET) != (off_t)elf.e_phoff) ++ fperror("lseek to phdr failed\n"); ++ ++ for(i = 0; i < elf.e_phnum; i++) ++ { ++ Elf32_Phdr phdr; ++ const char *str; ++ ++ myread(fd, &phdr, sizeof(phdr)); ++ switch(phdr.p_type) ++ { ++#define C(x) case PT_##x: str = #x; break; ++ C(NULL); ++ C(LOAD); ++ C(DYNAMIC); ++ C(INTERP); ++ C(NOTE); ++ C(SHLIB); ++ C(PHDR); ++#undef C ++ default: ++ str = "???"; break; ++ } ++ printf("type PT_%s off=%ld vaddr=%lx filesz=%ld flags=%lx\n", ++ str, phdr.p_offset, phdr.p_vaddr, phdr.p_filesz, ++ (unsigned long)phdr.p_flags); ++ if (phdr.p_type == PT_NOTE) ++ do_note(fd, &phdr); ++ } ++ exit(0); ++} ++ ++++++ file-5.11.tar.gz -> file-5.12.tar.gz ++++++ ++++ 11249 lines of diff (skipped) ++++++ file-rpmlintrc ++++++ addFilter(".*Warning:.*using.*regular.*magic.*file.*/usr/share/misc/magic.*") addFilter(".*E:.*shlib-fixed-dependency.*") addFilter(".*W:.*no-dependency-on.*") addFilter(".*W:.*name-repeated-in-summary.*") -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
