-#!!!!!!!!!!!!!!!!!!!
-TODO:
-
-file /home/users/glen/tmp/vagrant-1.1.0-root-glen/usr/lib64/vagrant/embedded/rgloader/rgloader.darwin.bundle
-Segmentation fault
-glen@carme-pld packages/vagrant $ q file
-file-5.13-1.x86_64
-
-glen@carme-pld packages/vagrant $ file /home/users/glen/tmp/vagrant-1.1.0-root-glen/usr/lib64/vagrant/embedded/rgloader/rgloader.darwin.bundle
-/home/users/glen/tmp/vagrant-1.1.0-root-glen/usr/lib64/vagrant/embedded/rgloader/rgloader.darwin.bundle: ERROR: Mach-O fat file with 3 architectures: [ I386
-glen@carme-pld packages/vagrant $ q file
-file-5.12-1.x86_64
-#!!!!!!!!!!!!!!!!!!!!
-
#
# Conditional build:
%bcond_without python # don't build python-magic module
Summary(zh_TW.UTF-8): 用於決定檔案類型的一個工具程式。
Name: file
Version: 5.13
-Release: 1.1
+Release: 2
License: distributable
Group: Applications/File
Source0: ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz
Patch3: automake.patch
Patch4: sticky-bit.patch
Patch5: cdf-pread.patch
+Patch6: macho-crash.patch
URL: http://www.darwinsys.com/file/
BuildRequires: autoconf >= 2.50
BuildRequires: automake
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
%if "%{cc_version}" < "3.4"
%{__sed} -i -e 's,-Wextra,,' configure.ac
--- /dev/null
+See file mailinglist thread:
+http://mx.gw.com/pipermail/file/2013/001138.html
+
+From cf289f23851ba3eb017576be1ba65c0a0f0e16a9 Mon Sep 17 00:00:00 2001
+From: Christos Zoulas <christos@zoulas.com>
+Date: Tue, 26 Feb 2013 18:24:43 +0000
+Subject: [PATCH] - avoid 0 offset causing an infinite loop. - XXX: should
+ limit indirect nesting.
+
+---
+ src/softmagic.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/softmagic.c b/src/softmagic.c
+index c42ca19..22d1a27 100644
+--- a/src/softmagic.c
++++ b/src/softmagic.c
+@@ -1617,6 +1617,12 @@ private int mcopy(struct magic_set *, union VALUETYPE *, int, int,
+
+ if (m->flag & INDIROFFADD) {
+ offset += ms->c.li[cont_level-1].off;
++ if (offset == 0) {
++ if ((ms->flags & MAGIC_DEBUG) != 0)
++ fprintf(stderr,
++ "indirect *zero* offset\n");
++ return 0;
++ }
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ fprintf(stderr, "indirect +offs=%u\n", offset);
+ }
+--
+1.8.1.5
+