Add a check for empty buffers #106152.
authorMike Frysinger <vapier@gentoo.org>
Sat, 17 Sep 2005 08:13:17 +0000 (08:13 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 17 Sep 2005 08:13:17 +0000 (08:13 +0000)
Package-Manager: portage-2.0.52-r1 http://ronaldmcnightrider.ytmnd.com/

sys-apps/file/ChangeLog
sys-apps/file/Manifest
sys-apps/file/file-4.15.ebuild
sys-apps/file/files/file-4.15-empty-mime-buffer.patch [new file with mode: 0644]

index b0ba202783a269e19ef261ad1dcf5ba1f4fb8ebc..d73f14c085ff81c79a0a230975adc75045ecc455 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for sys-apps/file
 # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/file/ChangeLog,v 1.89 2005/09/17 00:27:23 ciaranm Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/file/ChangeLog,v 1.90 2005/09/17 08:13:17 vapier Exp $
+
+  17 Sep 2005; Mike Frysinger <vapier@gentoo.org>
+  +files/file-4.15-empty-mime-buffer.patch, file-4.15.ebuild:
+  Add a check for empty buffers #106152.
 
   17 Sep 2005; Ciaran McCreesh <ciaranm@gentoo.org> ChangeLog:
   Converted to UTF-8, fixed encoding screwups
index 78626e3c9f48b40015175944fb1b0c9ad748e789..10b9b24c869de5b2dd3f2cc0b3971d900e02ac89 100644 (file)
@@ -1,25 +1,26 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 213bc8ded7a22b2fcb129f4ee60e892c file-4.13.ebuild 2226
-MD5 8dde58cae0df7546dd0e7cfe6c8805eb file-4.15.ebuild 1390
-MD5 c6073a11ea3fcb5cc0d1625a54aad8d4 file-4.12.ebuild 2081
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
-MD5 433ae9ba0d9927294a85540f5617b13b ChangeLog 11213
-MD5 f0f2d2181cac822f0c4d4675fb1ff38c files/cracklib.magic 360
-MD5 66df8eecd30769daeb3f643dc6432db3 files/file-4.xx-mips-gentoo.patch 5578
-MD5 d336b3490362624aec2e30679c44a198 files/digest-file-4.12 61
+MD5 c6073a11ea3fcb5cc0d1625a54aad8d4 file-4.12.ebuild 2081
+MD5 d46373392481ffa4240b13570efa88dd file-4.15.ebuild 1449
+MD5 213bc8ded7a22b2fcb129f4ee60e892c file-4.13.ebuild 2226
+MD5 fb6809aab87e2eba25ea6e5d3128dacc ChangeLog 11366
 MD5 f856a50dada76a4ca5cee58fbd04e76b files/file-4.13-cross-compile.patch 964
-MD5 26f26c3f7caf28f0bdb9dbb6fe83c254 files/file-4.15-libtool.patch 561
+MD5 a952f0eca26a046e4b815529d2b734ef files/misc.magic 71
+MD5 cbb2d6e5512eb5f33299107848ca9e30 files/file-4.15-empty-mime-buffer.patch 708
 MD5 407c20e1fb3186144d6c7d2788714163 files/digest-file-4.13 61
 MD5 7a96e5548d52493366ab39f1c6ae9237 files/file-4.13-ia64.patch 530
-MD5 a952f0eca26a046e4b815529d2b734ef files/misc.magic 71
 MD5 13c1a487996e5e26560f9feaae56e811 files/file-4.14-gcc2.patch 494
 MD5 56c4aa931e56a129d1c631c52a3b6d67 files/digest-file-4.15 61
+MD5 d336b3490362624aec2e30679c44a198 files/digest-file-4.12 61
+MD5 f0f2d2181cac822f0c4d4675fb1ff38c files/cracklib.magic 360
+MD5 26f26c3f7caf28f0bdb9dbb6fe83c254 files/file-4.15-libtool.patch 561
+MD5 66df8eecd30769daeb3f643dc6432db3 files/file-4.xx-mips-gentoo.patch 5578
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.1 (GNU/Linux)
+Version: GnuPG v1.4.2 (GNU/Linux)
 
-iD8DBQFDK2MgLLFUmVNQ7rkRAsqPAKCtJ48V3iwWfZ+6GzSYka5SdBz5QACeItCw
-7spDO2fvmcelU9nHaSYGbXc=
-=oKBo
+iD8DBQFDK9AwgIKl8Uu19MoRAlMyAJoCWz5sQzWzJNT1BzqbIDdVlbBJ8ACfQBt8
+xi5Ppbv9Xp4sCVmU2BK9kAk=
+=ddtK
 -----END PGP SIGNATURE-----
index 7cf2e2471e7850ffea5bb1ad457251baf816c02e..8c8cb4069096f3a0cf46cb79395c7f90b3f95ed4 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/file/file-4.15.ebuild,v 1.3 2005/09/14 04:44:00 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/file/file-4.15.ebuild,v 1.4 2005/09/17 08:13:17 vapier Exp $
 
 inherit distutils libtool
 
@@ -20,6 +20,7 @@ src_unpack() {
        unpack ${P}.tar.gz
        cd "${S}"
 
+       epatch "${FILESDIR}"/${P}-empty-mime-buffer.patch #106152
        epatch "${FILESDIR}"/${P}-libtool.patch #99593
        elibtoolize
 
diff --git a/sys-apps/file/files/file-4.15-empty-mime-buffer.patch b/sys-apps/file/files/file-4.15-empty-mime-buffer.patch
new file mode 100644 (file)
index 0000000..aff090c
--- /dev/null
@@ -0,0 +1,29 @@
+http://bugs.gentoo.org/106152
+
+--- src/magic.c
++++ src/magic.c
+@@ -316,12 +316,18 @@ magic_buffer(struct magic_set *ms, const
+ {
+       if (file_reset(ms) == -1)
+               return NULL;
+-      /*
+-       * The main work is done here!
+-       * We have the file name and/or the data buffer to be identified. 
+-       */
+-      if (file_buffer(ms, -1, buf, nb) == -1) {
+-              return NULL;
++      if (nb == 0) {
++              if (file_printf(ms, (ms->flags & MAGIC_MIME) ?
++                  "application/x-empty" : "empty") == -1)
++                      return NULL;
++      } else {
++              /*
++               * The main work is done here!
++               * We have the file name and/or the data buffer to be identified. 
++               */
++              if (file_buffer(ms, -1, buf, nb) == -1) {
++                      return NULL;
++              }
+       }
+       return file_getbuffer(ms);
+ }