diff options
Diffstat (limited to 'games-util/dzip')
-rw-r--r-- | games-util/dzip/Manifest | 8 | ||||
-rw-r--r-- | games-util/dzip/dzip-2.9-r3.ebuild | 30 | ||||
-rw-r--r-- | games-util/dzip/files/dzip-2.9-scrub-names.patch | 88 | ||||
-rw-r--r-- | games-util/dzip/files/dzip-2.9-system-zlib-r2.patch | 72 | ||||
-rw-r--r-- | games-util/dzip/files/dzip-amd64.diff | 30 | ||||
-rw-r--r-- | games-util/dzip/metadata.xml | 11 |
6 files changed, 239 insertions, 0 deletions
diff --git a/games-util/dzip/Manifest b/games-util/dzip/Manifest new file mode 100644 index 000000000000..4be38ae08d70 --- /dev/null +++ b/games-util/dzip/Manifest @@ -0,0 +1,8 @@ +AUX dzip-2.9-scrub-names.patch 1816 SHA256 a55eed49939cb4b5b2b8268562081d8ed4a4365424ad43482ebd3db7a573bebb SHA512 94fceecee4538bb0d0aac460d864ebb4bbbb3ad3aa6be7593115bc850e19b1630bceb2df9268e569a30457e8b2483b3678199629b78d192dcdf3bee0b00178c8 WHIRLPOOL bc97b25f329d1c03743fc682592be96be57288d43f33f1ef01080eca8a0952efa8f79e17e1c0920cc0e5cc7c765410d976e7cb4b3514eeb0d6f26067c2c692f0 +AUX dzip-2.9-system-zlib-r2.patch 1844 SHA256 50fa4c9de1f8db7242cb75876d368bb410b32f627dc824186117af5f98739f3c SHA512 04e95334b03b1590bfd73cd5905186a8ba28a36655b9c829dcd913842c0f2c2802133d453134080f3a4664ec106e7693482b43981c5849ecc1a781a7f37b0625 WHIRLPOOL a10994958a025cc3e3f66f8370a03d0a9330d07f86ebcb0e6f2cc706668827a0842a37b2dca976e0103aab75d0209f5bf6b861a859015c13b0523e23fbcd7734 +AUX dzip-amd64.diff 643 SHA256 099f28dc7fbbb0f91ebf43f1264eb56e5d924b5f7bda55b7a9b2d1a4882088d9 SHA512 30a381f95807cc61b8c393f3e5fb5c1f250e4578b1601f5ee8944c7b94a3d3f983478075cee3c76858b5d0df768b6bd3e91578e6679f443fb8d6f7fa30b48f18 WHIRLPOOL 3214d4bee58f6dc784542859275722962cd29606db8f761e25a41e68d2a10c2d37be01ce0df0fb96f15aeb4546ae7a11e2befa347a8e30cdde0f65d0190a7af7 +DIST dz29src.zip 100354 SHA256 de858f6a811096ebd099301cb4acd21eaf9eb1b3f95c1b21ec9e910bcf6f0f17 SHA512 3e1071da6ae5c9064b7222f1bb553b787ded4acbfe8463a7a94f17e60748b68cdfc17672ef7220deddd394c6709efe632e53e61508fd48bfa9001e43a37e788f WHIRLPOOL 550585852d2c950a5bc893ca134d4cc96c896b5960d8d37235d77a8fa8e31496f7e1634ae4c5e5d3c8709e9fcace1319652aa7b306634a3e7fcaa2451581b3b0 +EBUILD dzip-2.9-r3.ebuild 647 SHA256 ca9f318f86ff2079bd082ff20adc4eb7e4b2d3ae1956d7f5d15f26c9a51668af SHA512 76bbba4ddfa4c473535591e80d486e2ff27043b639b76fb8f090df1ddec1cf9375e025df1eafbfc100ccef4069501a99098d01af4eb7f663e56d5856b065ae01 WHIRLPOOL 062b2ea1853db5e97c3944c2cf47c1917010ddff41ce9bcd9cecaf64a3014a187fa48495943214b4bfab02598e595a85a94a52ef0226208bfb44f37d8f749bd2 +MISC ChangeLog 2967 SHA256 17a6301c355ff67ee023f1efa3a9a0b10a9c3a55eb460c2d85411c3197539acc SHA512 92af7c1a72815ce91e0935fd1497fd3534ea6bf269f4a55afeea2627dcd14929f58fbbf72223d4d2c5862fcb740ebdc6b6d374cd1d31d9d27c7a652d03f72f2f WHIRLPOOL 3c650cadfc6f492053bada767676b9d78f9a53fe602c77f0598ec75d5a0cb173f249dedbd2833ff763743d68b56f91c79f162f09dffb2e2dcf683fcf87981c38 +MISC ChangeLog-2015 1898 SHA256 77199bfc2a721ce60d62a1bcd4310cc9c5291c304d3ba52b5a1c5e3a61238664 SHA512 579e54b4df8b4fddd75bb8cc7e80d95719a73efe5de6f6a87a6c923f8328130e996550e552723201472fb93261d4d6e7f59ab73924b84453640c634911dc33d9 WHIRLPOOL f59eb52ccc9c7e91131cd6cd64cfd2d2501291cffb9138451e591e82781ae853a3ddd936af8dd85afc43b142541f70ff824d25e93301150c1f900c8bb632e76e +MISC metadata.xml 326 SHA256 467f437a486aa477f6ec9e6865eca1655c9dac66e1a31380ed6c5cca5c9caaa8 SHA512 a1550e2953010f4593e3c7cbe54783f4e0a5859f58e756b6cde50c0d404ca10f8eb0f43df223c6f7df454429d90f496a99aee08f68c8830a1aa396e1febcbe7c WHIRLPOOL e1f6e8375e6bee4a4639fef9f8e0ea2f9558aeb1798c0ba4695c667d4832cb3c6c2144be0022eb985df9a42eb5206ee1336f30353f07adce4e98f5edc39d49b0 diff --git a/games-util/dzip/dzip-2.9-r3.ebuild b/games-util/dzip/dzip-2.9-r3.ebuild new file mode 100644 index 000000000000..ded35f14665d --- /dev/null +++ b/games-util/dzip/dzip-2.9-r3.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +inherit eutils + +DESCRIPTION="compressor/uncompressor for demo recordings from id's Quake" +HOMEPAGE="http://speeddemosarchive.com/dzip/" +SRC_URI="http://speeddemosarchive.com/dzip/dz${PV/./}src.zip" + +LICENSE="ZLIB" +SLOT="0" +KEYWORDS="~amd64 x86" +IUSE="" +DEPEND="app-arch/unzip" +RDEPEND="" + +S="${WORKDIR}" + +src_prepare() { + epatch "${FILESDIR}"/${P}-system-zlib-r2.patch + epatch "${FILESDIR}"/${P}-scrub-names.patch #93079 + epatch "${FILESDIR}/dzip-amd64.diff" + mv -f Makefile{.linux,} +} + +src_install () { + dobin dzip + dodoc Readme +} diff --git a/games-util/dzip/files/dzip-2.9-scrub-names.patch b/games-util/dzip/files/dzip-2.9-scrub-names.patch new file mode 100644 index 000000000000..079fae3fd070 --- /dev/null +++ b/games-util/dzip/files/dzip-2.9-scrub-names.patch @@ -0,0 +1,88 @@ +Fix directory traversals issues. + +Since .dz files normally just have relative directory trees: +pak/ +pak/file +pak/subdir/file + +we strip out all the components which ascend in the directory tree + +http://bugs.gentoo.org/93079 + +--- main.c ++++ main.c +@@ -77,6 +77,48 @@ int dzRead (int inlen) + return 1;
+ } +
++#define IS_SEP(c) (c == '/' || c == ':' || c == '\\') ++void scrub_name(char *smee) ++{ ++ char *paths[] = { "../", "..\\", "..:", NULL}; ++ size_t p, i, len; ++ char scrubit, scrubbed; ++ ++ scrubbed = 0; ++ len = strlen(smee); ++ i = 0; ++ scrubit = 1; ++ ++ /* search the path and scrub out all relative paths */ ++ while (i + 3 < len) { ++ for (p = 0; paths[p]; ++p) { ++ if (scrubit && !strncmp(paths[p], smee+i, 3)) { ++ scrubbed = 1; ++ memset(smee+i, '\0', 3); ++ i += 2; ++ break; ++ } ++ } ++ scrubit = IS_SEP(smee[i]) || smee[i] == '\0'; ++ ++i; ++ } ++ ++ if (!scrubbed) ++ return; ++ ++ /* condense the string over all the scrubbed bits */ ++ p = 0; ++ for (i = 0; i < len; ++i) { ++ while (p < len && smee[p] == '\0') ++ ++p; ++ if (p == len) { ++ smee[i] = '\0'; ++ break; ++ } ++ smee[i] = smee[p++]; ++ } ++} ++
+ int dzReadDirectoryEntry (direntry_t *de) + { + char *s; +@@ -102,6 +144,7 @@ int dzReadDirectoryEntry (direntry_t *de + s = Dzip_malloc(de->len);
+ dzFile_Read(s, de->len);
+ de->name = s; ++ scrub_name(de->name); + if (de->pak && de->type != TYPE_PAK) + return 1; /* dont mess with dirchar inside pakfiles */ + do +--- v1code.c ++++ v1code.c +@@ -201,6 +201,7 @@ void demv1_dxentities(void) + + } +
++extern void scrub_name(char *smee); + void dzUncompressV1 (int testing)
+ {
+ int i, inlen = 0;
+@@ -221,6 +222,7 @@ void dzUncompressV1 (int testing)
+ {
+ de = directory + i;
+ crcval = INITCRC;
++ scrub_name(de->name); + printf("%s %s",action,de->name);
+ fflush(stdout);
+
diff --git a/games-util/dzip/files/dzip-2.9-system-zlib-r2.patch b/games-util/dzip/files/dzip-2.9-system-zlib-r2.patch new file mode 100644 index 000000000000..4bf10f8b98f6 --- /dev/null +++ b/games-util/dzip/files/dzip-2.9-system-zlib-r2.patch @@ -0,0 +1,72 @@ +--- dzip.h ++++ dzip.h +@@ -2,7 +2,7 @@ + #include <stdlib.h>
+ #include <string.h>
+
+-#include "zlib/zlib.h"
++#include <zlib.h>
+
+ typedef unsigned char uchar;
+
+@@ -177,4 +177,4 @@ + #else
+ #define DIRCHAR '/'
+ #define WRONGCHAR '\\'
+-#endif +\ No newline at end of file ++#endif
+--- Makefile.linux ++++ Makefile.linux +@@ -1,18 +1,17 @@ + # Makefile for linux
+
+-CC = gcc
+-CFLAGS = -Wall -O3
++CC ?= gcc
++CFLAGS ?= -O3
++CFLAGS += -Wall
+ TARGET = dzip
+ OBJECTS = main.o compress.o uncompress.o list.o crc32.o \
+- encode.o decode.o v1code.o conmain.o delete.o \
+- zlib/adler32.o zlib/deflate.o zlib/trees.o \
+- zlib/inflate.o zlib/infblock.o zlib/inftrees.o zlib/infcodes.o \
+- zlib/infutil.o zlib/inffast.o
++ encode.o decode.o v1code.o conmain.o delete.o
++LIBS = -lz
+
+ TMPFILES = gmon.out frag*
+
+ $(TARGET): $(OBJECTS)
+- $(CC) $(CFLAGS) $(OBJECTS) -o $(TARGET) $(LDFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
+
+ clean:
+ rm -f $(TARGET) $(OBJECTS) $(TMPFILES)
+@@ -24,4 +23,4 @@ + encode.o: encode.c dzip.h
+ list.o: list.c dzip.h dzipcon.h
+ decode.o: decode.c dzip.h dzipcon.h
+-v1code.o: v1code.c dzip.h dzipcon.h +\ No newline at end of file ++v1code.o: v1code.c dzip.h dzipcon.h
+--- conmain.c.orig 2010-01-17 15:10:20.938605770 +0000 ++++ conmain.c 2010-01-17 15:10:34.180603846 +0000 +@@ -507,8 +507,8 @@ + if (!strcmp(argv[i],"-o")) i++;
+ }
+
+- zs.zalloc = Dzip_calloc;
+- zs.zfree = free;
++ zs.zalloc = Z_NULL; // Dzip_calloc; <- wrong number of arguments, reverting to default
++ zs.zfree = Z_NULL; // free; <- wrong number of arguments, reverting to default
+
+ if (flag[SW_LIST] || flag[SW_EXTRACT] || flag[SW_VERIFY])
+ {
+@@ -618,4 +618,4 @@ + dzDeleteFiles_MakeList(files + 1, fileargs - 1);
+ free(files);
+ exit(0);
+-} +\ No newline at end of file ++}
diff --git a/games-util/dzip/files/dzip-amd64.diff b/games-util/dzip/files/dzip-amd64.diff new file mode 100644 index 000000000000..ef49ff330570 --- /dev/null +++ b/games-util/dzip/files/dzip-amd64.diff @@ -0,0 +1,30 @@ +--- dzip/crc32.c 2002-07-12 06:07:54.000000000 +0200 ++++ dz/crc32.c 2010-01-20 23:23:43.000000000 +0100 +@@ -1,10 +1,12 @@ ++#include <stdint.h> ++ + unsigned long crcval; + unsigned long crctable[256]; + +-unsigned long crc_reflect(unsigned long x, int bits) +-{
+- int i; +- unsigned long v = 0, b = 1 << (bits - 1); ++unsigned long crc_reflect(uint32_t x, int bits) ++{ ++ uint32_t i; ++ uint32_t v = 0, b = 1 << (bits - 1); + + for (i = 0; i < bits; i++) + { +@@ -16,8 +18,8 @@ + + void crc_init(void) + { +- unsigned long crcpol = 0x04c11db7; +- unsigned long i, j, k; ++ uint32_t crcpol = 0x04c11db7; ++ uint32_t i, j, k; + + for (i = 0; i < 256; i++) + { diff --git a/games-util/dzip/metadata.xml b/games-util/dzip/metadata.xml new file mode 100644 index 000000000000..d3c0508f60cd --- /dev/null +++ b/games-util/dzip/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> + <email>hanno@gentoo.org</email> +</maintainer> +<maintainer type="project"> + <email>games@gentoo.org</email> + <name>Gentoo Games Project</name> +</maintainer> +</pkgmetadata> |