This commit is contained in:
parent
f7a0752200
commit
0018b1e798
@ -1,23 +0,0 @@
|
|||||||
--- src/funcs.c
|
|
||||||
+++ src/funcs.c 2007-05-24 14:15:36.218013250 +0200
|
|
||||||
@@ -26,7 +26,7 @@
|
|
||||||
*/
|
|
||||||
#include "file.h"
|
|
||||||
#include "magic.h"
|
|
||||||
-#include <assert.h>
|
|
||||||
+#include <limits.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
@@ -247,7 +247,10 @@ file_getbuffer(struct magic_set *ms)
|
|
||||||
len = ms->o.size - ms->o.left;
|
|
||||||
/* * 4 is for octal representation, + 1 is for NUL */
|
|
||||||
psize = len * 4 + 1;
|
|
||||||
- assert(psize > len);
|
|
||||||
+ if (len > (ULONG_MAX - 1) / 4) {
|
|
||||||
+ file_oomem(ms, len);
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
if (ms->o.psize < psize) {
|
|
||||||
if ((pbuf = realloc(ms->o.pbuf, psize)) == NULL) {
|
|
||||||
file_oomem(ms, psize);
|
|
@ -1,38 +0,0 @@
|
|||||||
Index: softmagic.c
|
|
||||||
===================================================================
|
|
||||||
RCS file: /p/file/cvsroot/file/src/softmagic.c,v
|
|
||||||
retrieving revision 1.91
|
|
||||||
retrieving revision 1.95
|
|
||||||
diff -u -r1.91 -r1.95
|
|
||||||
--- src/softmagic.c 18 Jan 2007 05:29:33 -0000 1.91
|
|
||||||
+++ src/softmagic.c 3 Mar 2007 19:09:25 -0000 1.95
|
|
||||||
@@ -38,7 +38,7 @@
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef lint
|
|
||||||
-FILE_RCSID("@(#)$File: softmagic.c,v 1.91 2007/01/18 05:29:33 ljt Exp $")
|
|
||||||
+FILE_RCSID("@(#)$File: softmagic.c,v 1.95 2007/03/03 19:09:25 christos Exp $")
|
|
||||||
#endif /* lint */
|
|
||||||
|
|
||||||
private int match(struct magic_set *, struct magic *, uint32_t,
|
|
||||||
@@ -1523,10 +1523,20 @@
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
regmatch_t pmatch[1];
|
|
||||||
+#ifndef REG_STARTEND
|
|
||||||
+#define REG_STARTEND 0
|
|
||||||
+ size_t l = ms->search.s_len - 1;
|
|
||||||
+ char c = ms->search.s[l];
|
|
||||||
+ ((char *)(intptr_t)ms->search.s)[l] = '\0';
|
|
||||||
+#else
|
|
||||||
pmatch[0].rm_so = 0;
|
|
||||||
pmatch[0].rm_eo = ms->search.s_len;
|
|
||||||
+#endif
|
|
||||||
rc = regexec(&rx, (const char *)ms->search.s,
|
|
||||||
1, pmatch, REG_STARTEND);
|
|
||||||
+#if REG_STARTEND == 0
|
|
||||||
+ ((char *)(intptr_t)ms->search.s)[l] = c;
|
|
||||||
+#endif
|
|
||||||
switch (rc) {
|
|
||||||
case 0:
|
|
||||||
ms->search.s += (int)pmatch[0].rm_so;
|
|
@ -1,28 +0,0 @@
|
|||||||
--- src/file.c
|
|
||||||
+++ src/file.c 2007-04-05 17:04:50.607194194 +0200
|
|
||||||
@@ -358,7 +358,7 @@ main(int argc, char *argv[])
|
|
||||||
|
|
||||||
private void
|
|
||||||
/*ARGSUSED*/
|
|
||||||
-load(const char *m __unused, int flags)
|
|
||||||
+load(const char *m __attr_unused__, int flags)
|
|
||||||
{
|
|
||||||
if (magic)
|
|
||||||
return;
|
|
||||||
--- src/file.h
|
|
||||||
+++ src/file.h 2007-04-05 17:04:35.237181956 +0200
|
|
||||||
@@ -79,11 +79,11 @@
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-#ifndef __unused
|
|
||||||
+#ifndef __attr_unused__
|
|
||||||
#if __GNUC_PREREQ__(2, 7)
|
|
||||||
-#define __unused __attribute__((__unused__))
|
|
||||||
+#define __attr_unused__ __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
-#define __unused /* delete */
|
|
||||||
+#define __attr_unused__ /* delete */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:fd1dbfeef939b79382e5b4e50bc49496d2457b94a995532bdea2a4c08c159369
|
|
||||||
size 414064
|
|
@ -1,23 +1,5 @@
|
|||||||
--- src/file.c
|
--- src/file.c
|
||||||
+++ src/file.c 2007-05-14 11:14:56.000000000 +0000
|
+++ src/file.c 2007-06-06 16:33:10.402651296 +0200
|
||||||
@@ -128,7 +128,7 @@ main(int argc, char *argv[])
|
|
||||||
char *home, *usermagic;
|
|
||||||
struct stat sb;
|
|
||||||
static const char hmagic[] = "/.magic";
|
|
||||||
-#define OPTSTRING "bcCdf:F:hikLm:nNprsvz0"
|
|
||||||
+#define OPTSTRING "bcCde:f:F:hikLm:nNprsvz0"
|
|
||||||
#ifdef HAVE_GETOPT_LONG
|
|
||||||
int longindex;
|
|
||||||
static const struct option long_options[] =
|
|
||||||
@@ -138,7 +138,7 @@ main(int argc, char *argv[])
|
|
||||||
{"brief", 0, 0, 'b'},
|
|
||||||
{"checking-printout", 0, 0, 'c'},
|
|
||||||
{"debug", 0, 0, 'd'},
|
|
||||||
- {"exclude", 0, 0, 'e' },
|
|
||||||
+ {"exclude", 1, 0, 'e' },
|
|
||||||
{"files-from", 1, 0, 'f'},
|
|
||||||
{"separator", 1, 0, 'F'},
|
|
||||||
{"mime", 0, 0, 'i'},
|
|
||||||
@@ -240,6 +240,8 @@ main(int argc, char *argv[])
|
@@ -240,6 +240,8 @@ main(int argc, char *argv[])
|
||||||
flags |= MAGIC_DEBUG|MAGIC_CHECK;
|
flags |= MAGIC_DEBUG|MAGIC_CHECK;
|
||||||
break;
|
break;
|
@ -1,17 +1,19 @@
|
|||||||
--- magic/Magdir/msdos
|
--- magic/Magdir/msdos
|
||||||
+++ magic/Magdir/msdos 2007-04-16 14:54:43.942155748 +0200
|
+++ magic/Magdir/msdos 2007-06-06 16:42:16.380856618 +0200
|
||||||
@@ -14,8 +14,12 @@
|
@@ -14,12 +14,10 @@
|
||||||
|
|
||||||
# OS/2 batch files are REXX. the second regex is a bit generic, oh well
|
# OS/2 batch files are REXX. the second regex is a bit generic, oh well
|
||||||
# the matched commands seem to be common in REXX and uncommon elsewhere
|
# the matched commands seem to be common in REXX and uncommon elsewhere
|
||||||
|
-100 regex/c =^[\ \t]{0,10}call[\ \t]{1,10}rxfunc OS/2 REXX batch file text
|
||||||
|
-100 regex/c =^[\ \t]{0,10}say\ ['"] OS/2 REXX batch file text
|
||||||
|
-
|
||||||
|
-
|
||||||
-100 regex/c =^\\s*call\\s+rxfuncadd.*sysloadfu OS/2 REXX batch file text
|
-100 regex/c =^\\s*call\\s+rxfuncadd.*sysloadfu OS/2 REXX batch file text
|
||||||
-100 regex/c =^\\s*say\ ['"] OS/2 REXX batch file text
|
-100 regex/c =^\\s*say\ ['"] OS/2 REXX batch file text
|
||||||
+#100 regex/c =^\\s*call\\s+rxfuncadd.*sysloadfu OS/2 REXX batch file text
|
|
||||||
+#100 regex/c =^\\s*say\ ['"] OS/2 REXX batch file text
|
|
||||||
+100 search/0xffff rxfuncadd
|
+100 search/0xffff rxfuncadd
|
||||||
+>100 regex/c =^\\s{0,255}call\\s{1,99}rxfuncadd OS/2 REXX batch file text
|
+>100 regex/c =^[\ \t]{0,10}call[\ \t]{1,10}rxfunc OS/2 REXX batch file text
|
||||||
+100 search/0xffff say
|
+100 search/0xffff say
|
||||||
+>100 regex/c =^\\s{0,255}say\ ['"] OS/2 REXX batch file text
|
+>100 regex/c =^[\ \t]{0,10}say\ ['"] OS/2 REXX batch file text
|
||||||
|
|
||||||
0 leshort 0x14c MS Windows COFF Intel 80386 object file
|
0 leshort 0x14c MS Windows COFF Intel 80386 object file
|
||||||
#>4 ledate x stamp %s
|
#>4 ledate x stamp %s
|
10
file-4.21-scribus.dif
Normal file
10
file-4.21-scribus.dif
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
--- magic/Localstuff
|
||||||
|
+++ magic/Localstuff 2007-08-29 18:58:37.090251353 +0200
|
||||||
|
@@ -29,3 +29,7 @@
|
||||||
|
#>2 regex \(name\ [^)]*\) %s
|
||||||
|
>20 search/256 (name (name
|
||||||
|
>>&1 string x %s...)
|
||||||
|
+
|
||||||
|
+# File magic for Scribus, an Open Source Desktop Publishing system
|
||||||
|
+0 string \<SCRIBUSUTF8\ Version Scribus Document
|
||||||
|
+0 string \<SCRIBUSUTF8NEW\ Version Scribus Document
|
@ -1,6 +1,6 @@
|
|||||||
--- .pkgextract
|
--- .pkgextract
|
||||||
+++ .pkgextract 2006-03-27 13:29:19.000000000 +0200
|
+++ .pkgextract 2006-03-27 13:29:19.000000000 +0200
|
||||||
@@ -0,0 +1,14 @@
|
@@ -0,0 +1,13 @@
|
||||||
+patch -p0 -s --suffix=.misc < ../file-4.18-misc.dif
|
+patch -p0 -s --suffix=.misc < ../file-4.18-misc.dif
|
||||||
+patch -p0 -s --suffix=.pcp < ../file-4.12-pcp.dif
|
+patch -p0 -s --suffix=.pcp < ../file-4.12-pcp.dif
|
||||||
+patch -p0 -s --suffix=.exec < ../file-4.20-exec.dif
|
+patch -p0 -s --suffix=.exec < ../file-4.20-exec.dif
|
||||||
@ -11,10 +11,9 @@
|
|||||||
+patch -p0 -s --suffix=.xen < ../file-4.20-xen.dif
|
+patch -p0 -s --suffix=.xen < ../file-4.20-xen.dif
|
||||||
+patch -p0 -s --suffix=.elf < ../file-4.18-elf.dif
|
+patch -p0 -s --suffix=.elf < ../file-4.18-elf.dif
|
||||||
+patch -p0 -s --suffix=.prtf < ../file-4.18-printf.dif
|
+patch -p0 -s --suffix=.prtf < ../file-4.18-printf.dif
|
||||||
+patch -p0 -s --suffix=.rse < ../file-4.20-reg_startend.dif
|
+patch -p0 -s --suffix=.reg < ../file-4.21-reg_dos.dif
|
||||||
+patch -p0 -s --suffix=.unsd < ../file-4.20-unused.dif
|
+patch -p0 -s --suffix=.opt < ../file-4.21-option.dif
|
||||||
+patch -p0 -s --suffix=.reg < ../file-4.20-reg_dos.dif
|
+patch -p0 -s --suffix=.scri < ../file-4.21-scribus.dif
|
||||||
+patch -p0 -s --suffix=.opt < ../file-4.20-option.dif
|
|
||||||
--- magic/Header
|
--- magic/Header
|
||||||
+++ magic/Header 2006-03-27 13:29:19.000000000 +0200
|
+++ magic/Header 2006-03-27 13:29:19.000000000 +0200
|
||||||
@@ -1,5 +1,7 @@
|
@@ -1,5 +1,7 @@
|
||||||
@ -441,3 +440,17 @@
|
|||||||
+ exit(0);
|
+ exit(0);
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
|
--- src/funcs.c
|
||||||
|
+++ src/funcs.c 2007-06-06 15:05:14.000000000 +0000
|
||||||
|
@@ -41,9 +41,9 @@
|
||||||
|
#endif
|
||||||
|
#ifndef SIZE_T_MAX
|
||||||
|
#ifdef __LP64__
|
||||||
|
-#define SIZE_T_MAX (size_t)0xfffffffffffffffffU
|
||||||
|
+#define SIZE_T_MAX (size_t)0xffffffffffffffffUL
|
||||||
|
#else
|
||||||
|
-#define SIZE_T_MAX (size_t)0xffffffffU
|
||||||
|
+#define SIZE_T_MAX (size_t)0xffffffffUL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
3
file-4.21.tar.bz2
Normal file
3
file-4.21.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:44158449344566035756efaa1921cfda625f7081c10fd034f37919ece9db762c
|
||||||
|
size 415270
|
10
file.changes
10
file.changes
@ -1,3 +1,13 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Aug 29 19:01:31 CEST 2007 - werner@suse.de
|
||||||
|
|
||||||
|
- Add Scribus to local magic (bug #298009)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jun 6 17:08:25 CEST 2007 - werner@suse.de
|
||||||
|
|
||||||
|
- Update to file version 4.21 including the last three bug fixes
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu May 24 11:58:09 CEST 2007 - werner@suse.de
|
Thu May 24 11:58:09 CEST 2007 - werner@suse.de
|
||||||
|
|
||||||
|
26
file.spec
26
file.spec
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# spec file for package file (Version 4.20)
|
# spec file for package file (Version 4.21)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# This file and all modifications and additions to the pristine
|
# This file and all modifications and additions to the pristine
|
||||||
@ -16,8 +16,8 @@ URL: http://www.darwinsys.com/file/
|
|||||||
License: Other uncritical OpenSource License
|
License: Other uncritical OpenSource License
|
||||||
Group: Productivity/File utilities
|
Group: Productivity/File utilities
|
||||||
Autoreqprov: on
|
Autoreqprov: on
|
||||||
Version: 4.20
|
Version: 4.21
|
||||||
Release: 17
|
Release: 1
|
||||||
Summary: A Tool to Determine File Types
|
Summary: A Tool to Determine File Types
|
||||||
Source: ftp://ftp.astron.com/pub/file/file-%{version}.tar.bz2
|
Source: ftp://ftp.astron.com/pub/file/file-%{version}.tar.bz2
|
||||||
Patch: file-%{version}.dif
|
Patch: file-%{version}.dif
|
||||||
@ -31,11 +31,9 @@ Patch7: file-4.20-ssd.dif
|
|||||||
Patch8: file-4.20-xen.dif
|
Patch8: file-4.20-xen.dif
|
||||||
Patch9: file-4.18-elf.dif
|
Patch9: file-4.18-elf.dif
|
||||||
Patch10: file-4.18-printf.dif
|
Patch10: file-4.18-printf.dif
|
||||||
Patch11: file-4.20-reg_startend.dif
|
Patch11: file-4.21-reg_dos.dif
|
||||||
Patch12: file-4.20-unused.dif
|
Patch12: file-4.21-option.dif
|
||||||
Patch13: file-4.20-reg_dos.dif
|
Patch13: file-4.21-scribus.dif
|
||||||
Patch14: file-4.20-option.dif
|
|
||||||
Patch15: file-4.20-CVE-2007-2799.dif
|
|
||||||
Patch20: file-4.16-mips.dif
|
Patch20: file-4.16-mips.dif
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
@ -82,11 +80,9 @@ Authors:
|
|||||||
%patch8 -p0 -b .xen
|
%patch8 -p0 -b .xen
|
||||||
%patch9 -p0 -b .elf
|
%patch9 -p0 -b .elf
|
||||||
%patch10 -p0 -b .prtf
|
%patch10 -p0 -b .prtf
|
||||||
%patch11 -p0 -b .rse
|
%patch11 -p0 -b .reg
|
||||||
%patch12 -p0 -b .unused
|
%patch12 -p0 -b .opt
|
||||||
%patch13 -p0 -b .reg
|
%patch13 -p0 -b .scri
|
||||||
%patch14 -p0 -b .opt
|
|
||||||
%patch15 -p0 -b .CVE-2007-2799
|
|
||||||
%ifarch mips
|
%ifarch mips
|
||||||
%patch20 -p0 -b .mips
|
%patch20 -p0 -b .mips
|
||||||
%endif
|
%endif
|
||||||
@ -149,6 +145,10 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%attr(644,root,root) %{_mandir}/man3/libmagic.3.gz
|
%attr(644,root,root) %{_mandir}/man3/libmagic.3.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 29 2007 - werner@suse.de
|
||||||
|
- Add Scribus to local magic (bug #298009)
|
||||||
|
* Wed Jun 06 2007 - werner@suse.de
|
||||||
|
- Update to file version 4.21 including the last three bug fixes
|
||||||
* Thu May 24 2007 - werner@suse.de
|
* Thu May 24 2007 - werner@suse.de
|
||||||
- Fix of the fix for bug #256290 with CVE-2007-2799
|
- Fix of the fix for bug #256290 with CVE-2007-2799
|
||||||
* Mon May 21 2007 - werner@suse.de
|
* Mon May 21 2007 - werner@suse.de
|
||||||
|
Loading…
Reference in New Issue
Block a user