6 Dec
2006
6 Dec
'06
11:02
Hello community, here is the log from the commit of package file checked in at Wed Dec 6 12:02:11 CET 2006. -------- --- file/file.changes 2006-06-12 15:17:24.000000000 +0200 +++ /mounts/work_src_done/STABLE/file/file.changes 2006-11-23 17:15:35.000000000 +0100 @@ -1,0 +2,11 @@ +Thu Nov 23 17:15:17 CET 2006 - werner@suse.de + +- Initialize variable in elf patch + +------------------------------------------------------------------- +Wed Nov 22 16:14:33 CET 2006 - werner@suse.de + +- Update to new file 4.18 + * Includes most of our extensions (elf, fifo, softmagic) + +------------------------------------------------------------------- Old: ---- file-4.09-misc.dif file-4.17-elf.dif file-4.17-fifo.dif file-4.17-intstr.dif file-4.17.dif file-4.17.tar.bz2 New: ---- file-4.18-elf.dif file-4.18-misc.dif file-4.18-printf.dif file-4.18.dif file-4.18.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ file.spec ++++++ --- /var/tmp/diff_new_pack.L7Df6X/_old 2006-12-06 11:59:17.000000000 +0100 +++ /var/tmp/diff_new_pack.L7Df6X/_new 2006-12-06 11:59:17.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package file (Version 4.17) +# spec file for package file (Version 4.18) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -15,25 +15,24 @@ License: Other uncritical OpenSource License, Other License(s), see package Group: Productivity/File utilities Autoreqprov: on -Version: 4.17 +Version: 4.18 Release: 3 Summary: A Tool to Determine File Types Source: ftp://ftp.astron.com/pub/file/file-%{version}.tar.bz2 Patch: file-%{version}.dif -Patch1: file-4.09-misc.dif -Patch2: file-4.06-exec.dif -Patch3: file-4.06-autoconf.dif -Patch4: file-4.03-tex.dif -Patch5: file-selinux.dif -Patch6: file-4.12-pcp.dif -Patch22: file-4.16-mips.dif -Patch42: file-4.17-fifo.dif -Patch43: file-4.13-netware.diff -Patch44: file-4.13-cracklib.dif -Patch45: file-4.16-ssd.dif -Patch46: file-4.16-xen.dif -Patch50: file-4.17-intstr.dif -Patch51: file-4.17-elf.dif +Patch1: file-4.18-misc.dif +Patch2: file-4.12-pcp.dif +Patch3: file-4.06-exec.dif +Patch4: file-4.06-autoconf.dif +Patch5: file-4.03-tex.dif +Patch6: file-selinux.dif +Patch7: file-4.13-netware.diff +Patch8: file-4.13-cracklib.dif +Patch9: file-4.16-ssd.dif +Patch10: file-4.16-xen.dif +Patch11: file-4.18-elf.dif +Patch12: file-4.18-printf.dif +Patch20: file-4.16-mips.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -69,22 +68,21 @@ %prep %setup -q -%patch50 -p0 -b .intstr -%patch51 -p0 -b .elf.dif %patch1 -p0 -b .misc -%patch2 -p0 -b .exec -%patch3 -p0 -b .conf -%patch4 -p0 -b .tex -%patch5 -p0 -b .policy -%patch6 -p0 -b .pcp +%patch2 -p0 -b .pcp +%patch3 -p0 -b .exec +%patch4 -p0 -b .conf +%patch5 -p0 -b .tex +%patch6 -p0 -b .policy +%patch7 -p0 -b .ntwr +%patch8 -p0 -b .crlib +%patch9 -p0 -b .pm +%patch10 -p0 -b .xen +%patch11 -p0 -b .elf.dif +%patch12 -p0 -b .printf %ifarch mips -%patch22 -p0 -s .mips +%patch20 -p0 -s .mips %endif -%patch42 -p0 -b .fifo -%patch43 -p0 -b .netware -%patch44 -p0 -b .cracklib -%patch45 -p0 -b .pm -%patch46 -p0 -b .xen %patch %build @@ -144,6 +142,11 @@ %attr(644,root,root) %{_mandir}/man3/libmagic.3.gz %changelog -n file +* Thu Nov 23 2006 - werner@suse.de +- Initialize variable in elf patch +* Wed Nov 22 2006 - werner@suse.de +- Update to new file 4.18 + * Includes most of our extensions (elf, fifo, softmagic) * Mon Jun 12 2006 - werner@suse.de - Reenable file to display process name from a core dump (#183685) * Mon Mar 27 2006 - werner@suse.de ++++++ file-4.17-elf.dif -> file-4.18-elf.dif ++++++ --- file/file-4.17-elf.dif 2006-06-12 15:16:35.000000000 +0200 +++ /mounts/work_src_done/STABLE/file/file-4.18-elf.dif 2006-11-23 17:14:40.000000000 +0100 @@ -1,89 +1,6 @@ --- src/readelf.c -+++ src/readelf.c 2006-06-12 15:15:12.000000000 +0200 -@@ -189,15 +189,16 @@ - #ifdef ELFCORE - size_t prpsoffsets32[] = { - 8, /* FreeBSD */ -- 28, /* Linux 2.0.36 */ -- 32, /* Linux (I forget which kernel version) */ -+ 28, /* Linux 2.0.36 (short name) */ -+ 44, /* Linux (path name) */ - 84, /* SunOS 5.x */ - }; - - size_t prpsoffsets64[] = { - 16, /* FreeBSD, 64-bit */ -- 40, /* Linux (tested on core from 2.4.x) */ -- 120, /* SunOS 5.x, 64-bit */ -+ 40, /* Linux (tested on core from 2.4.x, short name) */ -+ 56, /* Linux (path name) */ -+ 120, /* SunOS 5.x, 64-bit */ - }; - - #define NOFFSETS32 (sizeof prpsoffsets32 / sizeof prpsoffsets32[0]) -@@ -247,8 +248,15 @@ - size_t offset; - unsigned char nbuf[BUFSIZ]; - ssize_t bufsize; -+ off_t savedoffset; -+ struct stat st; - int flags = 0; - -+ if (fstat(fd, &st) < 0) { -+ file_badread(ms); -+ return -1; -+ } -+ - if (size != xph_sizeof) { - if (file_printf(ms, ", corrupted program header size") == -1) - return -1; -@@ -259,7 +267,7 @@ - * Loop through all the program headers. - */ - for ( ; num; num--) { -- if (lseek(fd, off, SEEK_SET) == (off_t)-1) { -+ if ((savedoffset = lseek(fd, off, SEEK_SET)) == (off_t)-1) { - file_badseek(ms); - return -1; - } -@@ -267,6 +275,15 @@ - file_badread(ms); - return -1; - } -+ -+ if (xph_offset > st.st_size) { -+ if (lseek(fd, savedoffset, SEEK_SET) == (off_t)-1) { -+ file_badseek(ms); -+ return -1; -+ } -+ continue; -+ } -+ - off += size; - if (xph_type != PT_NOTE) - continue; -@@ -321,7 +338,7 @@ - /* - * We're out of note headers. - */ -- return offset; -+ return (offset >= size) ? offset : size; - } - - if (namesz & 0x80000000) { -@@ -349,7 +366,10 @@ - - offset = ELF_ALIGN(doff + descsz); - if (doff + descsz > size) { -- return offset; -+ /* -+ * We're past the end of the buffer. -+ */ -+ return (offset >= size) ? offset : size; - } - - if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 && -@@ -588,7 +608,7 @@ ++++ src/readelf.c 2006-11-22 15:54:30.000000000 +0100 +@@ -621,7 +621,7 @@ core: default: if (xnh_type == NT_PRPSINFO) { @@ -92,7 +9,7 @@ unsigned char c; /* * Extract the program name. We assume -@@ -600,7 +620,9 @@ +@@ -633,7 +633,9 @@ core: * If the characters aren't all printable, * reject it. */ @@ -103,79 +20,3 @@ size_t reloffset = prpsoffsets(i); size_t noffset = doff + reloffset; for (j = 0; j < 16; j++, noffset++, -@@ -762,13 +784,20 @@ - int bufsize; - size_t offset, align; - off_t savedoffset; -+ struct stat st; - int flags = 0; - -+ if (fstat(fd, &st) < 0) { -+ file_badread(ms); -+ return -1; -+ } -+ - if (size != xph_sizeof) { - if (file_printf(ms, ", corrupted program header size") == -1) - return -1; - return 0; - } -+ - if (lseek(fd, off, SEEK_SET) == (off_t)-1) { - file_badseek(ms); - return -1; -@@ -783,6 +812,13 @@ - file_badseek(ms); - return -1; - } -+ if (xph_offset > st.st_size) { -+ if (lseek(fd, savedoffset, SEEK_SET) == (off_t)-1) { -+ file_badseek(ms); -+ return -1; -+ } -+ continue; -+ } - - switch (xph_type) { - case PT_DYNAMIC: -@@ -843,8 +879,13 @@ - size_t nbytes) - { - union { -+#if defined(__s390x__) || defined(__powerpc64__) - int32_t l; - char c[sizeof (int32_t)]; -+#else -+ long l; -+ char c[sizeof (long)]; -+#endif - } u; - int class; - int swap; -@@ -867,7 +908,7 @@ - return 0; - - -- class = buf[4]; -+ class = buf[EI_CLASS]; - - if (class == ELFCLASS32) { - Elf32_Ehdr elfhdr; -@@ -877,7 +918,7 @@ - - u.l = 1; - (void) memcpy(&elfhdr, buf, sizeof elfhdr); -- swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[5]; -+ swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[EI_DATA]; - - if (getu16(swap, elfhdr.e_type) == ET_CORE) { - #ifdef ELFCORE -@@ -915,7 +956,7 @@ - - u.l = 1; - (void) memcpy(&elfhdr, buf, sizeof elfhdr); -- swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[5]; -+ swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[EI_DATA]; - - if (getu16(swap, elfhdr.e_type) == ET_CORE) { - #ifdef ELFCORE ++++++ file-4.09-misc.dif -> file-4.18-misc.dif ++++++ --- file/file-4.09-misc.dif 2006-03-24 14:46:55.000000000 +0100 +++ /mounts/work_src_done/STABLE/file/file-4.18-misc.dif 2006-11-22 15:50:07.000000000 +0100 @@ -1,6 +1,6 @@ --- magic/Magdir/audio +++ magic/Magdir/audio 2003-12-08 17:50:33.000000000 +0100 -@@ -72,13 +72,13 @@ +@@ -96,13 +96,13 @@ # Real Audio (Magic .ra\0375) 0 belong 0x2e7261fd RealAudio sound file @@ -14,7 +14,7 @@ -#0 string MTM MultiTracker Module sound file +#0 string MTM MultiTracker Module sound data #0 string if Composer 669 Module sound data - 0 string JN Composer 669 Module sound data (extended format) + #0 string JN Composer 669 Module sound data (extended format) 0 string MAS_U ULT(imate) Module sound data --- magic/Magdir/bsdi +++ magic/Magdir/bsdi 2003-12-08 17:50:03.000000000 +0100 @@ -53,7 +53,7 @@ 0 string/b #!\ /usr/local/tcsh Tenex C shell script text executable 0 string/b #!\ /usr/local/bin/tcsh Tenex C shell script text executable -@@ -34,6 +35,8 @@ +@@ -35,6 +36,8 @@ # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de) 0 string/b #!\ /bin/bash Bourne-Again shell script text executable @@ -64,8 +64,8 @@ # using env --- magic/Magdir/mach +++ magic/Magdir/mach 2003-12-08 17:50:03.000000000 +0100 -@@ -37,7 +37,7 @@ - >4 belong 11 hp pa-risc +@@ -74,7 +74,7 @@ + >4 belong 11 hppa >4 belong 12 acorn >4 belong 13 m88k ->4 belong 14 sparc @@ -75,7 +75,7 @@ >4 belong 17 rs6000 --- magic/Magdir/msdos +++ magic/Magdir/msdos 2005-07-25 15:24:04.000000000 +0200 -@@ -241,7 +241,7 @@ +@@ -248,7 +248,7 @@ # a few unknown ZIP sfxes, no idea if they are needed or if they are # already captured by the generic patterns above @@ -117,8 +117,8 @@ >32 belong !0 (signal %d) --- magic/Magdir/sun -+++ magic/Magdir/sun 2003-12-08 17:50:03.000000000 +0100 -@@ -5,18 +5,18 @@ ++++ magic/Magdir/sun 2006-11-22 15:49:20.000000000 +0100 +@@ -5,7 +5,7 @@ # Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x # releases. (5.x uses ELF.) # @@ -127,14 +127,16 @@ >0 byte &0x80 >>20 belong <4096 shared library >>20 belong =4096 dynamically linked executable - >>20 belong >4096 dynamically linked executable +@@ -13,12 +13,12 @@ >0 byte ^0x80 executable >16 belong >0 not stripped + -0 belong&077777777 0600410 sparc pure +0 belong&077777777 0600410 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 byte &0x80 dynamically linked executable ++++++ file-4.18-printf.dif ++++++ --- src/apprentice.c +++ src/apprentice.c 2006-11-22 16:09:57.000000000 +0000 @@ -886,8 +886,16 @@ quad = 1; /*FALLTHROUGH*/ case FILE_FMT_NUM: + if (*ptr == '#') + ptr++; + if (*ptr == ' ') + ptr++; if (*ptr == '-') ptr++; + if (*ptr == '+') + ptr++; + if (*ptr == '\'') + ptr++; if (*ptr == '.') ptr++; while (isdigit((unsigned char)*ptr)) ptr++; @@ -907,6 +915,7 @@ case 'i': case 'd': case 'u': + case 'o': case 'x': case 'X': return 0; @@ -921,12 +930,16 @@ case 'i': case 'd': case 'u': + case 'o': case 'x': case 'X': return 0; default: return -1; } + case 'o': + case 'x': + case 'X': case 'd': return 0; default: @@ -937,6 +950,7 @@ case 'c': case 'd': case 'u': + case 'o': case 'x': case 'X': return 0; ++++++ file-4.09-misc.dif -> file-4.18.dif ++++++ --- file/file-4.09-misc.dif 2006-03-24 14:46:55.000000000 +0100 +++ /mounts/work_src_done/STABLE/file/file-4.18.dif 2006-11-22 16:03:03.000000000 +0100 @@ -1,142 +1,440 @@ ---- magic/Magdir/audio -+++ magic/Magdir/audio 2003-12-08 17:50:33.000000000 +0100 -@@ -72,13 +72,13 @@ - - # Real Audio (Magic .ra\0375) - 0 belong 0x2e7261fd RealAudio sound file --0 string .RMF RealMedia file -+0 string .RMF\0\0\0 RealMedia file - - # MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net] - # Oct 31, 1995 - # fixed by2003-06-24 - # Too short... --#0 string MTM MultiTracker Module sound file -+#0 string MTM MultiTracker Module sound data - #0 string if Composer 669 Module sound data - 0 string JN Composer 669 Module sound data (extended format) - 0 string MAS_U ULT(imate) Module sound data ---- magic/Magdir/bsdi -+++ magic/Magdir/bsdi 2003-12-08 17:50:03.000000000 +0100 -@@ -19,7 +19,7 @@ - >32 byte 0x6a (uses shared libs) - - # same as in SunOS 4.x, except for static shared libraries --0 belong&077777777 0600413 sparc demand paged -+0 belong&077777777 0600413 SPARC demand paged - >0 byte &0x80 - >>20 belong <4096 shared library - >>20 belong =4096 dynamically linked executable -@@ -28,13 +28,13 @@ - >16 belong >0 not stripped - >36 belong 0xb4100001 (uses shared libs) - --0 belong&077777777 0600410 sparc pure -+0 belong&077777777 0600410 SPARC pure - >0 byte &0x80 dynamically linked executable - >0 byte ^0x80 executable - >16 belong >0 not stripped - >36 belong 0xb4100001 (uses shared libs) - --0 belong&077777777 0600407 sparc -+0 belong&077777777 0600407 SPARC - >0 byte &0x80 dynamically linked executable - >0 byte ^0x80 executable - >16 belong >0 not stripped ---- magic/Magdir/commands -+++ magic/Magdir/commands 2003-12-08 17:50:03.000000000 +0100 -@@ -8,6 +8,7 @@ - # korn shell magic, sent by George Wu, gwu@clyde.att.com - 0 string/b #!\ /bin/ksh Korn shell script text executable - 0 string/b #!\ /bin/tcsh Tenex C shell script text executable -+0 string/b #!\ /usr/bin/tcsh Tenex C shell script text executable - 0 string/b #!\ /usr/local/tcsh Tenex C shell script text executable - 0 string/b #!\ /usr/local/bin/tcsh Tenex C shell script text executable - -@@ -34,6 +35,8 @@ - - # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de) - 0 string/b #!\ /bin/bash Bourne-Again shell script text executable -+0 string/b #!\ /usr/bin/bash Bourne-Again shell script text executable -+0 string/b #!\ /usr/local/bash Bourne-Again shell script text executable - 0 string/b #!\ /usr/local/bin/bash Bourne-Again shell script text executable - - # using env ---- magic/Magdir/mach -+++ magic/Magdir/mach 2003-12-08 17:50:03.000000000 +0100 -@@ -37,7 +37,7 @@ - >4 belong 11 hp pa-risc - >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/msdos -+++ magic/Magdir/msdos 2005-07-25 15:24:04.000000000 +0200 -@@ -241,7 +241,7 @@ - - # a few unknown ZIP sfxes, no idea if they are needed or if they are - # already captured by the generic patterns above -->122 string Windows\ self-extracting\ ZIP \b, ZIP self-extracting archive -+>0x7a string Windows\ self-extracting\ ZIP \b, ZIP self-extracting archive - >(8.s*16) search/0x20 PKSFX \b, ZIP self-extracting archive (PKZIP) - # TODO: how to add this? >FileSize-34 string Windows\ Self-Installing\ Executable \b, ZIP self-extracting archive +--- .pkgextract ++++ .pkgextract 2006-03-27 13:29:19.000000000 +0200 +@@ -0,0 +1,11 @@ ++patch -p0 -s --suffix=.misc < ../file-4.18-misc.dif ++patch -p0 -s --suffix=.pcp < ../file-4.12-pcp.dif ++patch -p0 -s --suffix=.exec < ../file-4.06-exec.dif ++patch -p0 -s --suffix=.conf < ../file-4.06-autoconf.dif ++patch -p0 -s --suffix=.tex < ../file-4.03-tex.dif ++patch -p0 -s --suffix=.policy < ../file-selinux.dif ++patch -p0 -s --suffix=.ntwr < ../file-4.13-netware.diff ++patch -p0 -s --suffix=.crlib< ../file-4.13-cracklib.dif ++patch -p0 -s --suffix=.pm < ../file-4.16-ssd.dif ++patch -p0 -s --suffix=.xen < ../file-4.16-xen.dif ++patch -p0 -s --suffix=.elf < ../file-4.18-elf.dif +--- magic/Header ++++ magic/Header 2006-03-27 13:29:19.000000000 +0200 +@@ -1,5 +1,7 @@ + # Magic + # Magic data for file(1) command. +-# Machine-generated from src/cmd/file/magdir/*; edit there only! +-# Format is described in magic(files), where: +-# files is 5 on V7 and BSD, 4 on SV, and ?? in the SVID. ++# Format is described in magic(5). ++# ++# Note: If you have edited this file you may run `file -C' ++# to make a pre-compiled magic.mgc for faster execution ++# +--- magic/Makefile.am ++++ magic/Makefile.am 2006-03-27 13:29:19.000000000 +0200 +@@ -38,7 +38,6 @@ Magdir/amanda \ + Magdir/amigaos \ + Magdir/animation \ + Magdir/apl \ +-Magdir/apple \ + Magdir/applix \ + Magdir/archive \ + Magdir/asterix \ +@@ -83,7 +82,6 @@ Magdir/encore \ + Magdir/epoc \ + Magdir/esri \ + Magdir/fcs \ +-Magdir/filesystems \ + Magdir/flash \ + Magdir/fonts \ + Magdir/frame \ +@@ -109,14 +107,14 @@ Magdir/island \ + Magdir/ispell \ + Magdir/java \ + Magdir/jpeg \ ++Magdir/linux \ ++Magdir/filesystems \ + Magdir/karma \ + Magdir/lecter \ + Magdir/lex \ + Magdir/lif \ +-Magdir/linux \ + Magdir/lisp \ + Magdir/mach \ +-Magdir/macintosh \ + Magdir/magic \ + Magdir/mail.news \ + Magdir/maple \ +@@ -130,11 +128,11 @@ Magdir/misctools \ + Magdir/mkid \ + Magdir/mlssa \ + Magdir/mmdf \ +-Magdir/modem \ ++Magdir/msad \ + Magdir/motorola \ + Magdir/msdos \ ++Magdir/modem \ + Magdir/msvc \ +-Magdir/mup \ + Magdir/natinst \ + Magdir/ncr \ + Magdir/netbsd \ +@@ -169,6 +167,8 @@ Magdir/pyramid \ + Magdir/python \ + Magdir/revision \ + Magdir/riff \ ++Magdir/apple \ ++Magdir/macintosh \ + Magdir/rpm \ + Magdir/rtf \ + Magdir/sc \ +--- magic/Magdir/elf ++++ magic/Magdir/elf 2006-11-22 15:57:15.000000000 +0100 +@@ -92,7 +92,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, +@@ -184,7 +184,7 @@ + >>18 beshort 47 Renesas H8/300H, + >>18 beshort 48 Renesas H8S, + >>18 beshort 49 Renesas H8/500, +->>18 beshort 50 IA-64, ++>>18 beshort 50 IA-64 (Intel 64 bit architecture), + >>18 beshort 51 Stanford MIPS-X, + >>18 beshort 52 Motorola Coldfire, + >>18 beshort 53 Motorola M68HC12, +--- magic/Magdir/linux ++++ magic/Magdir/linux 2006-03-27 13:29:19.000000000 +0200 +@@ -82,21 +82,43 @@ + # and Nicolás Lichtmaier + # 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 +->510 leshort 0xAA55 x86 boot executable +->>518 leshort >=0x200 +->>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 ++514 string HdrS Linux ++>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/modem ++++ magic/Magdir/modem 2006-03-27 13:29:19.000000000 +0200 +@@ -2,9 +2,9 @@ + # modem: file(1) magic for modem programs # ---- magic/Magdir/netbsd -+++ magic/Magdir/netbsd 2003-12-08 17:50:03.000000000 +0100 -@@ -101,25 +101,25 @@ - 0 belong&0377777777 045200507 a.out NetBSD/powerpc core - >12 string >\0 from '%s' - --0 belong&0377777777 042400413 a.out NetBSD/sparc demand paged -+0 belong&0377777777 042400413 a.out NetBSD/SPARC demand paged - >0 byte &0x80 - >>20 belong <8192 shared library - >>20 belong =8192 dynamically linked executable - >>20 belong >8192 dynamically linked executable - >0 byte ^0x80 executable - >16 belong >0 not stripped --0 belong&0377777777 042400410 a.out NetBSD/sparc pure -+0 belong&0377777777 042400410 a.out NetBSD/SPARC pure - >0 byte &0x80 dynamically linked executable - >0 byte ^0x80 executable - >16 belong >0 not stripped --0 belong&0377777777 042400407 a.out NetBSD/sparc -+0 belong&0377777777 042400407 a.out NetBSD/SPARC - >0 byte &0x80 dynamically linked executable - >0 byte ^0x80 - >>0 byte &0x40 position independent - >>20 belong !0 executable - >>20 belong =0 object file - >16 belong >0 not stripped --0 belong&0377777777 042400507 a.out NetBSD/sparc core -+0 belong&0377777777 042400507 a.out NetBSD/SPARC core - >12 string >\0 from '%s' - >32 belong !0 (signal %d) - ---- magic/Magdir/sun -+++ magic/Magdir/sun 2003-12-08 17:50:03.000000000 +0100 -@@ -5,18 +5,18 @@ - # Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x - # releases. (5.x uses ELF.) - # --0 belong&077777777 0600413 sparc demand paged -+0 belong&077777777 0600413 SPARC demand paged - >0 byte &0x80 - >>20 belong <4096 shared library - >>20 belong =4096 dynamically linked executable - >>20 belong >4096 dynamically linked executable - >0 byte ^0x80 executable - >16 belong >0 not stripped --0 belong&077777777 0600410 sparc pure -+0 belong&077777777 0600410 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 byte &0x80 dynamically linked executable - >0 byte ^0x80 executable - >16 belong >0 not stripped + # From: Florian La Roche +-4 string Research, Digifax-G3-File +->29 byte 1 , fine resolution +->29 byte 0 , normal resolution ++1 string PC\ Research,\ Inc Digifax-G3-File ++>29 byte 1 \b, fine resolution ++>29 byte 0 \b, normal resolution + + 0 short 0x0100 raw G3 data, byte-padded + 0 short 0x1400 raw G3 data +--- magic/Magdir/msad ++++ magic/Magdir/msad 2006-03-27 13:29:19.000000000 +0200 +@@ -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 2006-11-22 16:01:01.000000000 +0100 +@@ -62,6 +62,7 @@ + >>&0 leshort 0x290 PA-RISC + >>&18 leshort&0x0100 >0 32-bit + >>&18 leshort&0x1000 >0 system file ++>>&228 lelong >0 \b, Mono/.Net assembly + >>&0xf4 search/0x140 \x0\x40\x1\x0 + >>>(&0.l+(4)) string MSCF \b, WinHKI CAB self-extracting archive + +@@ -86,7 +87,7 @@ + >>>>(0x3c.l+4) leshort 0x290 PA-RISC + >>>>(0x3c.l+22) leshort&0x0100 >0 32-bit + >>>>(0x3c.l+22) leshort&0x1000 >0 system file +->>>>(0x3c.l+232) lelong >0 Mono/.Net assembly ++>>>>(0x3c.l+232) lelong >0 \b, Mono/.Net assembly + + >>>>(0x3c.l+0xf8) string UPX0 \b, UPX compressed + >>>>(0x3c.l+0xf8) search/0x140 PEC2 \b, PECompact2 compressed +@@ -472,6 +473,13 @@ + # Acroread or something files wrongly identified as G3 .pfm + # these have the form \000 \001 any? \002 \000 \000 + # or \000 \001 any? \022 \000 \000 ++0 belong&0xffff00ff 0x00010012 PFM data ++>4 string \000\000 ++>6 string >\060 - %s ++ ++0 belong&0xffff00ff 0x00010002 PFM data ++>4 string \000\000 ++>6 string >\060 - %s + #0 string \000\001 pfm? + #>3 string \022\000\000Copyright\ yes + #>3 string \002\000\000Copyright\ yes +--- src/Makefile.am ++++ src/Makefile.am 2006-03-27 13:29:19.000000000 +0200 +@@ -1,4 +1,4 @@ +-MAGIC = $(pkgdatadir)/magic ++MAGIC = $(sysconfdir)/magic:$(pkgdatadir)/magic + lib_LTLIBRARIES = libmagic.la + include_HEADERS = magic.h + EXTRA_DIST = test.c +--- src/dcore.c ++++ src/dcore.c 2006-03-27 13:29:19.000000000 +0200 +@@ -0,0 +1,207 @@ ++/* ++ * Show goo about ELF core files ++ * Jeremy Fitzhardinge 1996 ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#if defined __GLIBC__ && __GLIBC__ >= 2 ++#include ++#include ++# ifndef NT_PRFPREG ++# define NT_PRFPREG 2 ++# endif ++# ifndef NT_TASKSTRUCT ++# define NT_TASKSTRUCT 4 ++# endif ++#else ++#include ++#include ++#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-4.17.tar.bz2 -> file-4.18.tar.bz2 ++++++ ++++ 10746 lines of diff (skipped) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org