fix some minor off-by-ones in url parsing
authorTavis Ormandy <taviso@gentoo.org>
Fri, 30 Mar 2007 19:52:10 +0000 (19:52 +0000)
committerTavis Ormandy <taviso@gentoo.org>
Fri, 30 Mar 2007 19:52:10 +0000 (19:52 +0000)
Package-Manager: portage-2.1.2.2

net-misc/snarf/ChangeLog
net-misc/snarf/Manifest
net-misc/snarf/files/digest-snarf-7.0-r3 [new file with mode: 0644]
net-misc/snarf/files/snarf-fix-off-by-ones.diff [new file with mode: 0644]
net-misc/snarf/snarf-7.0-r1.ebuild
net-misc/snarf/snarf-7.0-r3.ebuild [new file with mode: 0644]

index 9e3a0de8c45de339c2489ed96d1276b78716b9f6..e90d807b044c84a648169d1b0cacabbfd07478e5 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for net-misc/snarf
 # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/snarf/ChangeLog,v 1.20 2007/02/10 02:54:29 beandog Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/snarf/ChangeLog,v 1.21 2007/03/30 19:52:10 taviso Exp $
+
+*snarf-7.0-r3 (30 Mar 2007)
+
+  30 Mar 2007; Tavis Ormandy <taviso@gentoo.org>
+  +files/snarf-fix-off-by-ones.diff, +snarf-7.0-r3.ebuild:
+  fix some off by ones
 
   10 Feb 2007; Steve Dibb <beandog@gentoo.org> snarf-7.0-r2.ebuild:
   amd64 stable, bug 165534
index 3dcbd3820e19abf60053d5e8265670750ff841a3..05764a7b23237e664656177c925cd0ff2ea49b5b 100644 (file)
@@ -1,24 +1,35 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
 AUX snarf-basename-patch.diff 4438 RMD160 0acf2d57af81a6ff14e1080a6945d21f5ca0860a SHA1 58f390b02b9773d8c4b51d11b465772964f1a4a7 SHA256 623a480b8e558f6d4146e1ef767edf77aa2907da84d1157c701e5212f1e743bd
 MD5 6c62e7ab396ad7a82749b3cce1db41f6 files/snarf-basename-patch.diff 4438
 RMD160 0acf2d57af81a6ff14e1080a6945d21f5ca0860a files/snarf-basename-patch.diff 4438
 SHA256 623a480b8e558f6d4146e1ef767edf77aa2907da84d1157c701e5212f1e743bd files/snarf-basename-patch.diff 4438
+AUX snarf-fix-off-by-ones.diff 1592 RMD160 856ee4f63b12fa663adad7a815a99f9cf45bd455 SHA1 26155ecf9d6f405a193b131788c081a4e1a1890b SHA256 fda2a91bed2f4b617cd75c3d7c4e01c8c21a7ba76090dca6723d65b3c935f137
+MD5 7ca1cddbf0778cdfe9920280f3c4b3c0 files/snarf-fix-off-by-ones.diff 1592
+RMD160 856ee4f63b12fa663adad7a815a99f9cf45bd455 files/snarf-fix-off-by-ones.diff 1592
+SHA256 fda2a91bed2f4b617cd75c3d7c4e01c8c21a7ba76090dca6723d65b3c935f137 files/snarf-fix-off-by-ones.diff 1592
 AUX snarf-unlink-empty.diff 1581 RMD160 d5a1ca598a1d97eb7e66d4c63a99d3bd3e5d6027 SHA1 4fd31d081bc0d87b8d99e793467871c9908855d4 SHA256 fb6de2f9dc11bbab2ab693ddc848edbbab4ae6434036de576c8467a9cbfd6e28
 MD5 38c27038e70a5727fc7ae3e511b8c459 files/snarf-unlink-empty.diff 1581
 RMD160 d5a1ca598a1d97eb7e66d4c63a99d3bd3e5d6027 files/snarf-unlink-empty.diff 1581
 SHA256 fb6de2f9dc11bbab2ab693ddc848edbbab4ae6434036de576c8467a9cbfd6e28 files/snarf-unlink-empty.diff 1581
 DIST snarf-7.0.tar.gz 64495 RMD160 f546eab5a5d250686306c50f4c676868c6ada32e SHA1 9449810483707745377327fa74e8b62ce09c51c2 SHA256 85a0846d452b02eaff225bf68fb36e68dfc55be5a58fda38dcb3602dcc300a89
-EBUILD snarf-7.0-r1.ebuild 591 RMD160 5702a77501200b0fefef30fc7f1e74edc6e9ebe5 SHA1 9936d07e30c65aaa99a91fdf43b26aad43eb2e85 SHA256 3eeb8cf3761790fe6d996522bae8d944c05dc0fe12a91f874916e99cf34abbc5
-MD5 79882ab406978870829de6114effa4ed snarf-7.0-r1.ebuild 591
-RMD160 5702a77501200b0fefef30fc7f1e74edc6e9ebe5 snarf-7.0-r1.ebuild 591
-SHA256 3eeb8cf3761790fe6d996522bae8d944c05dc0fe12a91f874916e99cf34abbc5 snarf-7.0-r1.ebuild 591
+EBUILD snarf-7.0-r1.ebuild 589 RMD160 1e474f06ae13508d2165d6130d340a83f74fc2cb SHA1 88600d9ece463a75770dac42d52f4e0f49f4ebf9 SHA256 270b9ba3278bbda1893b049cc41f544ad57e232169d2b4061730ec14686483f7
+MD5 1fd7bccd46f793ff0f1954831ae093b1 snarf-7.0-r1.ebuild 589
+RMD160 1e474f06ae13508d2165d6130d340a83f74fc2cb snarf-7.0-r1.ebuild 589
+SHA256 270b9ba3278bbda1893b049cc41f544ad57e232169d2b4061730ec14686483f7 snarf-7.0-r1.ebuild 589
 EBUILD snarf-7.0-r2.ebuild 982 RMD160 8dfd4a0f097c09d5a6742ca753b9ed658a3708a6 SHA1 99919a1f4d19e7a828cc7fae6c5825e0364c41b8 SHA256 2f0c832304a3060cab51343300dc204eff628653c30ed25836a1b5d5b99ded10
 MD5 0e63ccd5c924e05262b90ebd360d66f6 snarf-7.0-r2.ebuild 982
 RMD160 8dfd4a0f097c09d5a6742ca753b9ed658a3708a6 snarf-7.0-r2.ebuild 982
 SHA256 2f0c832304a3060cab51343300dc204eff628653c30ed25836a1b5d5b99ded10 snarf-7.0-r2.ebuild 982
-MISC ChangeLog 2712 RMD160 9e13b6307dd6b24062890a6eca5ceae339c3b73e SHA1 6f2acc461d07d928e461dac90a6943a5c30e37d3 SHA256 e668bfb5e710324f5faa7747177d2f603ee0acaaf1466d9a3421c4cff76a8865
-MD5 d607912b058bab2732cd06ce1bd35c0f ChangeLog 2712
-RMD160 9e13b6307dd6b24062890a6eca5ceae339c3b73e ChangeLog 2712
-SHA256 e668bfb5e710324f5faa7747177d2f603ee0acaaf1466d9a3421c4cff76a8865 ChangeLog 2712
+EBUILD snarf-7.0-r3.ebuild 1032 RMD160 1a0b78adff709282731d20b93bc2d89d9ccd6a8d SHA1 81e7e612a1adcfd9bb2ca245a7014ba3f7470f98 SHA256 4582d9853843753f4d35597808f98d9a95e49905ca8e09619ebb1e584672cd38
+MD5 0a854113d7f500e8126a9f543d6b54cf snarf-7.0-r3.ebuild 1032
+RMD160 1a0b78adff709282731d20b93bc2d89d9ccd6a8d snarf-7.0-r3.ebuild 1032
+SHA256 4582d9853843753f4d35597808f98d9a95e49905ca8e09619ebb1e584672cd38 snarf-7.0-r3.ebuild 1032
+MISC ChangeLog 2872 RMD160 761f088ea090259bd0c9eea64d11783fd252ab74 SHA1 7743a7f89ca35da72161496de19b9902b8071b28 SHA256 c32ac796434f4059400c45221f452f7796e4042b5b206f812296c12faf0c9fc4
+MD5 d292ba3730080801e1fe7302ec71423b ChangeLog 2872
+RMD160 761f088ea090259bd0c9eea64d11783fd252ab74 ChangeLog 2872
+SHA256 c32ac796434f4059400c45221f452f7796e4042b5b206f812296c12faf0c9fc4 ChangeLog 2872
 MISC metadata.xml 452 RMD160 f30d6100e0730159c95643eea184ca237dd81f75 SHA1 7059711419ccf0ff21ef930a445a54c604642407 SHA256 06f54d94ff363f9e797268acd39d776154db9bed6a7a4e683647afc3ef228d48
 MD5 db12e15fc605f25b9c7cc2ee19891bdf metadata.xml 452
 RMD160 f30d6100e0730159c95643eea184ca237dd81f75 metadata.xml 452
@@ -29,3 +40,13 @@ SHA256 2687538f801236d7d5fe5fec7d68fb429a9bb28d64382cef9a18f10ef72905eb files/di
 MD5 4f4e8c6e7ca9a791d959d39f29375319 files/digest-snarf-7.0-r2 226
 RMD160 ba38ed0bdbaec9dca9a84392d66b844f355f01ca files/digest-snarf-7.0-r2 226
 SHA256 2687538f801236d7d5fe5fec7d68fb429a9bb28d64382cef9a18f10ef72905eb files/digest-snarf-7.0-r2 226
+MD5 4f4e8c6e7ca9a791d959d39f29375319 files/digest-snarf-7.0-r3 226
+RMD160 ba38ed0bdbaec9dca9a84392d66b844f355f01ca files/digest-snarf-7.0-r3 226
+SHA256 2687538f801236d7d5fe5fec7d68fb429a9bb28d64382cef9a18f10ef72905eb files/digest-snarf-7.0-r3 226
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.6 (GNU/Linux)
+
+iQBVAwUBRg1qd9ommWwmkP1xAQJ7HgH+JTvgKC5+h2fXa3oe/DhaHWvtCVN8GSBD
+Yg4fFXr6aJYUng2jAalricfI2BHJ5lzRbozCR6TuRK4sgai/rVERqg==
+=c/v1
+-----END PGP SIGNATURE-----
diff --git a/net-misc/snarf/files/digest-snarf-7.0-r3 b/net-misc/snarf/files/digest-snarf-7.0-r3
new file mode 100644 (file)
index 0000000..13ca50e
--- /dev/null
@@ -0,0 +1,3 @@
+MD5 7470d8457bc0d347b5cd8668c9e735c4 snarf-7.0.tar.gz 64495
+RMD160 f546eab5a5d250686306c50f4c676868c6ada32e snarf-7.0.tar.gz 64495
+SHA256 85a0846d452b02eaff225bf68fb36e68dfc55be5a58fda38dcb3602dcc300a89 snarf-7.0.tar.gz 64495
diff --git a/net-misc/snarf/files/snarf-fix-off-by-ones.diff b/net-misc/snarf/files/snarf-fix-off-by-ones.diff
new file mode 100644 (file)
index 0000000..c0556b3
--- /dev/null
@@ -0,0 +1,45 @@
+diff -ruNp snarf-7.0.orig/ftp.c snarf-7.0/ftp.c
+--- snarf-7.0.orig/ftp.c       2000-08-09 00:27:24.000000000 +0100
++++ snarf-7.0/ftp.c    2007-03-30 20:47:46.046783664 +0100
+@@ -89,7 +89,7 @@ get_line(UrlResource *rsrc, int control)
+         char *end;
+         char buf[BUFSIZE+1];
+-        while( (bytes_read = read(control, buf, BUFSIZE)) ) {
++        while( (bytes_read = read(control, buf, BUFSIZE)) > 0 ) {
+                 if( rsrc->options & OPT_VERBOSE )
+                         fwrite(buf, 1, bytes_read, stderr);
+diff -ruNp snarf-7.0.orig/http.c snarf-7.0/http.c
+--- snarf-7.0.orig/http.c      2007-03-30 20:46:21.176685880 +0100
++++ snarf-7.0/http.c   2007-03-30 20:47:46.205759496 +0100
+@@ -365,7 +365,7 @@ http_transfer(UrlResource *rsrc)
+         bytes_read = read(sock, buf, 8);
+-        if( bytes_read == 0 ) {
++        if( bytes_read <= 0 ) {
+                 close(sock);
+                 return 0;
+         }
+diff -ruNp snarf-7.0.orig/url.c snarf-7.0/url.c
+--- snarf-7.0.orig/url.c       1998-11-16 01:29:44.000000000 +0000
++++ snarf-7.0/url.c    2007-03-30 20:47:46.205759496 +0100
+@@ -96,7 +96,7 @@ get_username(char *string, Url *u)
+                 return string;
+         }
+  
+-        username = malloc(i);
++        username = malloc(i+1);
+         memcpy(username, string, i + 1);
+         username[i] = '\0';
+@@ -135,7 +135,7 @@ get_password(char *string, Url *u)
+         for(i = 0 ; string[i] != '@'; i++);
+         
+-        password = malloc(i);
++        password = malloc(i+1);
+         /* and finally, get the password portion */
+         memcpy(password, string, i);
index b33caf4cf82b4fbaebed95a5e698549ca6434fc6..23edfd326e1d7e7d7d7c4c08a53f4692a50d016c 100644 (file)
@@ -1,6 +1,6 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/snarf/snarf-7.0-r1.ebuild,v 1.16 2004/07/15 03:36:34 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/snarf/snarf-7.0-r1.ebuild,v 1.17 2007/03/30 19:52:10 taviso Exp $
 
 DESCRIPTION="A full featured small web-spider"
 SRC_URI="http://www.xach.com/snarf/${P}.tar.gz"
diff --git a/net-misc/snarf/snarf-7.0-r3.ebuild b/net-misc/snarf/snarf-7.0-r3.ebuild
new file mode 100644 (file)
index 0000000..b462d37
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/snarf/snarf-7.0-r3.ebuild,v 1.1 2007/03/30 19:52:10 taviso Exp $
+
+inherit eutils
+
+IUSE=""
+DESCRIPTION="Small and fast command line resource grabber with support for http, gopher, finger, and ftp protocols."
+SRC_URI="http://www.xach.com/snarf/${P}.tar.gz"
+HOMEPAGE="http://www.xach.com/snarf/"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+LICENSE="GPL-2"
+SLOT="0"
+
+DEPEND="virtual/libc"
+
+src_unpack() {
+       unpack ${A}
+       epatch ${FILESDIR}/snarf-basename-patch.diff
+       epatch ${FILESDIR}/snarf-unlink-empty.diff
+       epatch ${FILESDIR}/snarf-fix-off-by-ones.diff
+}
+
+src_install() {
+       dobin snarf
+       doman snarf.1
+       dodoc COPYING ChangeLog README TODO
+}
+
+pkg_postinst() {
+       einfo 'To use snarf with portage, try these settings in your make.conf'
+       einfo
+       einfo ' FETCHCOMMAND="/usr/bin/snarf -b \${URI} \${DISTDIR}/\${FILE}"'
+       einfo ' RESUMECOMMAND="/usr/bin/snarf -rb \${URI} \${DISTDIR}/\${FILE}"'
+}