summaryrefslogtreecommitdiff
path: root/app-arch/fastjar
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-arch/fastjar
reinit the tree, so we can have metadata
Diffstat (limited to 'app-arch/fastjar')
-rw-r--r--app-arch/fastjar/Manifest7
-rw-r--r--app-arch/fastjar/fastjar-0.98-r2.ebuild24
-rw-r--r--app-arch/fastjar/fastjar-0.98-r3.ebuild24
-rw-r--r--app-arch/fastjar/files/0.98-traversal.patch112
-rw-r--r--app-arch/fastjar/metadata.xml13
5 files changed, 180 insertions, 0 deletions
diff --git a/app-arch/fastjar/Manifest b/app-arch/fastjar/Manifest
new file mode 100644
index 000000000000..2d94c71b689a
--- /dev/null
+++ b/app-arch/fastjar/Manifest
@@ -0,0 +1,7 @@
+AUX 0.98-traversal.patch 3010 SHA256 8dab968b23684cd2ea5d5d876bd6e35c8e4aec7be52c2fa00c85635dc620984d SHA512 7bfcfebd681f9556e8231786da3326d12ee7ab071e2cadf9a4c17ba4e4e750aeb7e3d7cd78634c36e05179df4a369aae2e04a22533d1954668ada95f1d53d311 WHIRLPOOL b46fbff1a62a5170929536005507b419e9bbfe870b0dafe1021d0e32d38346dffe9b324604f3c6382df1a8b6d650099cf9f887d9bcbd534c72cac547b78a66c1
+DIST fastjar-0.98.tar.gz 717984 SHA256 f156abc5de8658f22ee8f08d7a72c88f9409ebd8c7933e9466b0842afeb2f145 SHA512 c0f9fca7b58d6acd00b90a5184dbde9ba3ffc5bf4d69512743e450649a272baf1f6af98b15d79d2b53990eaf84ef402c986035e6b615a19e35ed424348143903 WHIRLPOOL 6e1053713995532aa58b935f2935cc6d81331f35c1c6870f4758f7abd856d9976082553e74bebc43476ae48f64d6b7154264cc1bdcd0b9bee0230a5c07a6be3e
+EBUILD fastjar-0.98-r2.ebuild 518 SHA256 8ab3fdcaf65e939c4f63ac34cf29b73616df8b295cfea0c981a6e4373b9cddc8 SHA512 7ef3b44fc6a5384666c9d5b36f38dc2f2c128b7d57f968f16f6c5d6f332ed4f9d80e98a946b4a9120993d5e89996c5e875a5d9d5cf44ed56434d896fab3693ce WHIRLPOOL f40d5e36754c67c6beb6bf8d1048c75150bb1d169ce3c514e49fdca5aa20f6831c1197b275c22376f7e37ed3bc1ec581ca2161a766aa0ce51368c8f37b4eff2e
+EBUILD fastjar-0.98-r3.ebuild 522 SHA256 a3f635e6229cbbe3aeb9a103baec4b4f220c88d981497d7170f61dff641210cd SHA512 4026aea676b408699769ade56ce8a107199429afc8d68b3de6b5d60b8552b57ca8f1098223c9f71e99bc5b66aa4a1e86859cf89518b00c3e4feb9210c5fdfc2a WHIRLPOOL 8156a053fcc3762d9904a5fd3cac40d462b703fff31a987a7a112b2ddbdb77417acca7243835fa4b1b604a11dc9a88e1e433cd2dd88b870e49df86d86d8936aa
+MISC ChangeLog 2516 SHA256 c18790feca4968a8009bf1ca7f7c89ca84a876cb68eda25c59085d1ced9cf4fc SHA512 ad9f6e937f8c73c253dc955bf96e60afc8a79b4fe17918c09354b4ee4a25fd349da4970c709392af06b5e4caf8ca1622f2be2e8505e3d44c5c849fd4a770d5fd WHIRLPOOL 3d72967b67beb48323dda75a1aa23a4566dc5f5b80d5d25d343e3234589f513a85fab80b85c5f4c0f7d4139f36105f197b93307f3523791376b91f5714497465
+MISC ChangeLog-2015 3760 SHA256 f6a152d23b41972f3816fe2e363fb38bcc1b51d9595fbd4c45816a7a9750ebc6 SHA512 73913d65c6f33f5560ee5044181fee3d4db3729435eeeaaa7b10dfddb6280b67066a0098c4ddfa310004ae4081c2692eaac931ae6d0253bd0e47b001277f6fdb WHIRLPOOL 59018d13dc361895c4894089b2279069f4cb6d4e5a0338e9034932db1da7c3489e4690d04cf77c78ddcaea1067d677d42f595ab1a99e79e16c97e5309a4f555f
+MISC metadata.xml 478 SHA256 3d831c28c05f5245ba70c268d530ad5d596ad7c1daae8c9f0f59e829187a9018 SHA512 3b1f8a2998d8496947b8e6c60698db4311ca1afe7ddcd0fe9d4f7ae762acf4204a87f8ebcb9e0b0677727eb82fdda22a299cf3cafcdf83bd348d98ba16ff4214 WHIRLPOOL 9df19b5ae36e3d9bbb77df05f1d9a3163e84c1ad019de4436a22e7bcef285a5fa3f433ca7bd15f5b36ed429603468a1b3bca931ad57748165131fc10f589ca75
diff --git a/app-arch/fastjar/fastjar-0.98-r2.ebuild b/app-arch/fastjar/fastjar-0.98-r2.ebuild
new file mode 100644
index 000000000000..37599ed0d5ba
--- /dev/null
+++ b/app-arch/fastjar/fastjar-0.98-r2.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="A jar program written in C"
+HOMEPAGE="https://savannah.nongnu.org/projects/fastjar"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris"
+
+IUSE=""
+
+# bug #188542
+RDEPEND="!<=dev-java/kaffe-1.1.7-r5"
+
+src_prepare() {
+ # bug #325557
+ epatch "${FILESDIR}/0.98-traversal.patch"
+}
diff --git a/app-arch/fastjar/fastjar-0.98-r3.ebuild b/app-arch/fastjar/fastjar-0.98-r3.ebuild
new file mode 100644
index 000000000000..2b71543f2a0d
--- /dev/null
+++ b/app-arch/fastjar/fastjar-0.98-r3.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="A jar program written in C"
+HOMEPAGE="https://savannah.nongnu.org/projects/fastjar"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris"
+
+IUSE=""
+
+# bug #188542
+RDEPEND="!<=dev-java/kaffe-1.1.7-r5"
+
+src_prepare() {
+ # bug #325557
+ epatch "${FILESDIR}/0.98-traversal.patch"
+}
diff --git a/app-arch/fastjar/files/0.98-traversal.patch b/app-arch/fastjar/files/0.98-traversal.patch
new file mode 100644
index 000000000000..511f4c6cd838
--- /dev/null
+++ b/app-arch/fastjar/files/0.98-traversal.patch
@@ -0,0 +1,112 @@
+--- fastjar-0.98.orig/jartool.c
++++ fastjar-0.98/jartool.c
+@@ -790,6 +790,7 @@
+ progname, jarfile);
+ return 1;
+ }
++ ze->filename[len] = '\0';
+ len = UNPACK_UB4(header, CEN_EFLEN);
+ len += UNPACK_UB4(header, CEN_COMLEN);
+ if (lseek (fd, len, SEEK_CUR) == -1)
+@@ -1257,7 +1258,7 @@
+ exit_on_error("write");
+
+ /* write the file name to the zip file */
+- if (1 == write(jfd, fname, file_name_length))
++ if (-1 == write(jfd, fname, file_name_length))
+ exit_on_error("write");
+
+ if(verbose){
+@@ -1730,7 +1731,17 @@
+ struct stat sbuf;
+ int depth = 0;
+
+- tmp_buff = malloc(sizeof(char) * strlen((const char *)filename));
++ if(*filename == '/'){
++ fprintf(stderr, "Absolute path names are not allowed.\n");
++ exit(EXIT_FAILURE);
++ }
++
++ tmp_buff = malloc(strlen((const char *)filename));
++
++ if(tmp_buff == NULL) {
++ fprintf(stderr, "Out of memory.\n");
++ exit(EXIT_FAILURE);
++ }
+
+ for(;;){
+ const ub1 *idx = (const unsigned char *)strchr((const char *)start, '/');
+@@ -1738,25 +1749,28 @@
+ if(idx == NULL)
+ break;
+ else if(idx == start){
++ tmp_buff[idx - filename] = '/';
+ start++;
+ continue;
+ }
+- start = idx + 1;
+
+- strncpy(tmp_buff, (const char *)filename, (idx - filename));
+- tmp_buff[(idx - filename)] = '\0';
++ memcpy(tmp_buff + (start - filename), (const char *)start, (idx - start));
++ tmp_buff[idx - filename] = '\0';
+
+ #ifdef DEBUG
+ printf("checking the existance of %s\n", tmp_buff);
+ #endif
+- if(strcmp(tmp_buff, "..") == 0){
++ if(idx - start == 2 && memcmp(start, "..", 2) == 0){
+ --depth;
+ if (depth < 0){
+ fprintf(stderr, "Traversal to parent directories during unpacking!\n");
+ exit(EXIT_FAILURE);
+ }
+- } else if (strcmp(tmp_buff, ".") != 0)
++ } else if (idx - start != 1 || *start != '.')
+ ++depth;
++
++ start = idx + 1;
++
+ if(stat(tmp_buff, &sbuf) < 0){
+ if(errno != ENOENT)
+ exit_on_error("stat");
+@@ -1765,6 +1779,7 @@
+ #ifdef DEBUG
+ printf("Directory exists\n");
+ #endif
++ tmp_buff[idx - filename] = '/';
+ continue;
+ }else {
+ fprintf(stderr, "Hmmm.. %s exists but isn't a directory!\n",
+@@ -1781,10 +1796,11 @@
+ if(verbose && handle)
+ printf("%10s: %s/\n", "created", tmp_buff);
+
++ tmp_buff[idx - filename] = '/';
+ }
+
+ /* only a directory */
+- if(strlen((const char *)start) == 0)
++ if(*start == '\0')
+ dir = TRUE;
+
+ #ifdef DEBUG
+@@ -1792,7 +1808,7 @@
+ #endif
+
+ /* If the entry was just a directory, don't write to file, etc */
+- if(strlen((const char *)start) == 0)
++ if(*start == '\0')
+ f_fd = -1;
+
+ free(tmp_buff);
+@@ -1876,7 +1892,8 @@
+ exit(EXIT_FAILURE);
+ }
+
+- close(f_fd);
++ if (f_fd != -1)
++ close(f_fd);
+
+ if(verbose && dir == FALSE && handle)
+ printf("%10s: %s\n",
diff --git a/app-arch/fastjar/metadata.xml b/app-arch/fastjar/metadata.xml
new file mode 100644
index 000000000000..0d201b2da538
--- /dev/null
+++ b/app-arch/fastjar/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>java@gentoo.org</email>
+ <name>Java</name>
+ </maintainer>
+ <longdescription lang="en">
+ Fastjar is a version of Sun's 'jar' utility, written entirely in C,
+ and therefore quite a bit faster. Fastjar can be up to 100x faster
+ than the stock 'jar' program running without a JIT.
+ </longdescription>
+</pkgmetadata>