999-conglomeration.dpatch 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. #!/bin/sh /usr/share/dpatch/dpatch-run
  2. ## 999-conglomeration.dpatch by Michael Piefel <piefel@debian.org>
  3. ##
  4. ## DP: Needs to be broken out (FIXME).
  5. @DPATCH@
  6. diff -Naurp file-4.23.orig/magic/magic.mime file-4.23/magic/magic.mime
  7. --- file-4.23.orig/magic/magic.mime 2008-01-12 18:23:14.000000000 +0000
  8. +++ file-4.23/magic/magic.mime 2008-01-12 18:25:28.000000000 +0000
  9. @@ -184,6 +184,7 @@
  10. 0 string MThd audio/x-midi
  11. #>9 byte >0 (format %d)
  12. #>11 byte >1 using %d channels
  13. +0 string MThd audio/midi
  14. # Creative Music (CMF) data
  15. 0 string CTMF audio/x-unknown
  16. # SoundBlaster instrument data
  17. @@ -332,7 +333,7 @@
  18. # because it tries to uncompress it to figure out what's inside.
  19. # standard unix compress
  20. -0 string \037\235 application/x-compress
  21. +#0 string \037\235 application/x-compress
  22. # gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
  23. 0 string \037\213 application/x-gzip
  24. @@ -437,18 +438,14 @@
  25. #------------------------------------------------------------------------------
  26. # html: file(1) magic for HTML (HyperText Markup Language) docs
  27. #
  28. -# from Daniel Quinlan <quinlan@yggdrasil.com>
  29. +# from Michael Piefel <piefel@debian.org>
  30. #
  31. -0 string \<HEAD text/html
  32. -0 string \<head text/html
  33. -0 string \<TITLE text/html
  34. -0 string \<title text/html
  35. -0 string \<html text/html
  36. -0 string \<HTML text/html
  37. -0 string \<!-- text/html
  38. -0 string \<h1 text/html
  39. -0 string \<H1 text/html
  40. -0 string/c \<!doctype\ html text/html
  41. +0 string/cB \<!DOCTYPE\ html text/html
  42. +0 string/cb \<head text/html
  43. +0 string/cb \<title text/html
  44. +0 string/bc \<html text/html
  45. +0 string \<!-- text/html
  46. +0 string/c \<h1 text/html
  47. #------------------------------------------------------------------------------
  48. # images: file(1) magic for image formats (see also "c-lang" for XPM bitmaps)
  49. @@ -511,7 +508,7 @@
  50. 0 beshort 0xffd8 image/jpeg
  51. # PC bitmaps (OS/2, Windoze BMP files) (Greg Roelofs, newt@uchicago.edu)
  52. -0 string BM image/bmp
  53. +0 string BM image/x-ms-bmp
  54. #>14 byte 12 (OS/2 1.x format)
  55. #>14 byte 64 (OS/2 2.x format)
  56. #>14 byte 40 (Windows 3.x format)
  57. @@ -749,8 +746,10 @@
  58. #------------------------------------------------------------------------------
  59. # Hierarchical Data Format, used to facilitate scientific data exchange
  60. # specifications at http://hdf.ncsa.uiuc.edu/
  61. -0 belong 0x0e031301 Hierarchical Data Format (version 4) data
  62. -0 string \211HDF\r\n\032 Hierarchical Data Format (version 5) data
  63. +#Hierarchical Data Format (version 4) data
  64. +0 belong 0x0e031301 application/x-hdf
  65. +#Hierarchical Data Format (version 5) data
  66. +0 string \211HDF\r\n\032 application/x-hdf
  67. # Adobe Photoshop
  68. 0 string 8BPS image/vnd.adobe.photoshop
  69. @@ -820,21 +819,39 @@
  70. # Debian has entries for the old PGP formats:
  71. # pgp: file(1) magic for Pretty Good Privacy
  72. # see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
  73. -0 beshort 0x9900 application/x-pgp-keyring
  74. -0 beshort 0x9501 application/x-pgp-keyring
  75. -0 beshort 0x9500 application/x-pgp-keyring
  76. -0 beshort 0xa600 application/pgp-encrypted
  77. -0 string -----BEGIN\040PGP text/PGP armored data
  78. ->15 string PUBLIC\040KEY\040BLOCK- public key block
  79. ->15 string MESSAGE- message
  80. ->15 string SIGNED\040MESSAGE- signed message
  81. ->15 string PGP\040SIGNATURE- signature
  82. -0 beshort 0x8501 data
  83. +#0 beshort 0x9900 application/x-pgp-keyring
  84. +#0 beshort 0x9501 application/x-pgp-keyring
  85. +#0 beshort 0x9500 application/x-pgp-keyring
  86. +#0 beshort 0xa600 application/pgp-encrypted
  87. +#0 string -----BEGIN\040PGP text/PGP armored data
  88. +#>15 string PUBLIC\040KEY\040BLOCK- public key block
  89. +#>15 string MESSAGE- message
  90. +#>15 string SIGNED\040MESSAGE- signed message
  91. +#>15 string PGP\040SIGNATURE- signature
  92. +#0 beshort 0x8501 data
  93. +#text/PGP key public ring
  94. +0 beshort 0x9900 application/pgp
  95. +#text/PGP key security ring
  96. +0 beshort 0x9501 application/pgp
  97. +#text/PGP key security ring
  98. +0 beshort 0x9500 application/pgp
  99. +#text/PGP encrypted data
  100. +0 beshort 0xa600 application/pgp-encrypted
  101. +#text/PGP armored data
  102. +##public key block
  103. +2 string ---BEGIN\ PGP\ PUBLIC\ KEY\ BLOCK- application/pgp-keys
  104. +0 string -----BEGIN\040PGP\40MESSAGE- application/pgp
  105. +0 string -----BEGIN\040PGP\40SIGNATURE- application/pgp-signature
  106. +
  107. #
  108. # GnuPG Magic:
  109. #
  110. -0 beshort 0x9901 application/x-gnupg-keyring
  111. -0 beshort 0x8501 text/OpenPGP data
  112. +#0 beshort 0x9901 application/x-gnupg-keyring
  113. +#0 beshort 0x8501 text/OpenPGP data
  114. +#text/GnuPG key public ring
  115. +0 beshort 0x9901 application/pgp
  116. +#text/OpenPGP data
  117. +0 beshort 0x8501 application/pgp-encrypted
  118. # flash: file(1) magic for Macromedia Flash file format
  119. #
  120. @@ -1003,3 +1020,8 @@
  121. 0 lelong 0x10201A7A x-epoc/x-sisx-app
  122. # FORTRAN source
  123. 0 string/c c\ text/x-fortran
  124. +
  125. +# Gnumeric spreadsheet
  126. +# This entry is only semi-helpful, as Gnumeric compresses its files, so
  127. +# they will ordinarily reported as "compressed", but at least -z helps
  128. +39 string =<gmr:Workbook application/x-gnumeric
  129. diff -Naurp file-4.23.orig/src/file.c file-4.23/src/file.c
  130. --- file-4.23.orig/src/file.c 2007-12-27 16:35:58.000000000 +0000
  131. +++ file-4.23/src/file.c 2008-01-12 18:25:28.000000000 +0000
  132. @@ -350,7 +350,7 @@ main(int argc, char *argv[])
  133. }
  134. magic_close(magic);
  135. - return 0;
  136. + return magic->haderr ? -1 : 0;
  137. }
  138. diff -Naurp file-4.23.orig/src/fsmagic.c file-4.23/src/fsmagic.c
  139. --- file-4.23.orig/src/fsmagic.c 2007-11-07 21:33:23.000000000 +0000
  140. +++ file-4.23/src/fsmagic.c 2008-01-12 18:25:28.000000000 +0000
  141. @@ -93,7 +93,8 @@ file_fsmagic(struct magic_set *ms, const
  142. if (file_printf(ms, "cannot open `%s' (%s)",
  143. fn, strerror(errno)) == -1)
  144. return -1;
  145. - return 1;
  146. + ms->haderr++;
  147. + return -1;
  148. }
  149. if (mime) {