diff options
Diffstat (limited to 'app-arch/unarj')
-rw-r--r-- | app-arch/unarj/Manifest | 8 | ||||
-rw-r--r-- | app-arch/unarj/files/unarj-2.65-CAN-2004-0947.patch | 49 | ||||
-rw-r--r-- | app-arch/unarj/files/unarj-2.65-gentoo-fbsd.patch | 9 | ||||
-rw-r--r-- | app-arch/unarj/files/unarj-2.65-sanitation.patch | 126 | ||||
-rw-r--r-- | app-arch/unarj/metadata.xml | 14 | ||||
-rw-r--r-- | app-arch/unarj/unarj-2.65.ebuild | 32 |
6 files changed, 238 insertions, 0 deletions
diff --git a/app-arch/unarj/Manifest b/app-arch/unarj/Manifest new file mode 100644 index 000000000000..2d937c1d9e0d --- /dev/null +++ b/app-arch/unarj/Manifest @@ -0,0 +1,8 @@ +AUX unarj-2.65-CAN-2004-0947.patch 1523 SHA256 ade062a372bb40ec8965c4e3fc223edb6721057a0b7bd8ace1f0e885c15d4826 SHA512 714580c0602b12013ca39fc3850298c1fe11d48ac156a5883a3d7b0c5a8adabd96d85963e5e4500df82ebc9300366d437be0f67bf6577739da9ce880eaa44b85 WHIRLPOOL 4b7ce1fd8fd66f9bb6ea44cf870497031c1470e0caf4e674c6f6cd57fb33f5a43b8f58d73c4237c9dc7a82c7aad7f4c0ec09692def6a42ea4d90755ac9f7558f +AUX unarj-2.65-gentoo-fbsd.patch 220 SHA256 cceeb9cbeecaf1468dfd5f919982f949d99e60c262b174f77df38022d123682a SHA512 4f6949bb8c65d9cf86846cf57c6e51ef13d6d419a76b19e90ed39c776e08e3ca212ec731f13d3f209d979239a7a3302bbbdeff36af3962ac6841d2829691a6bd WHIRLPOOL 1b4af445cf8cec1a1b4feb25c27e42e0b291791c52c3f3323d4cbcc8531f0332ee3ae26c651b52f8497f7bd0548c7290f957cc09345835a0131fcaa093738eef +AUX unarj-2.65-sanitation.patch 2710 SHA256 6f6507362658dbe1629945834461c59ba6fbec097655feb40a72136efe758b1c SHA512 86c30be41bbce6a330ea95d0aff52abadd20d01a2a0a2d63d5c53006b27b23d9c37a800b44a93508e6954da8d2595e650893a1f80fe55fc92681a82af823c755 WHIRLPOOL 6850fd6f8da729bd8c9aac3cdf2f3bc2a18ba68015de4ef1581210e7c88c6ca8ba2ae40c7cf142459867c667d8c2194a0913f51fdee349b574f5b8c03096cfb4 +DIST unarj-2.65.tgz 21568 SHA256 092869f3b4d4943b3d999db4f266f39ab9e474f2984b813b20735283af068304 SHA512 1b152063017042a343f49e487e5284c3d4c548222baa52e2066cefe6d2add60213ffd2653f42e38582681a1fd89efb8f1d3a6ef6389fc33e5397760ad9e72386 WHIRLPOOL 431d8b43d58f05bf0a9213e98c5c15e3ae4b32089426d2b89b2832b0249390d8491293c0ed0f97e6c3c44f30056e497ce0f1ad807302f0d36c738e4a6085374a +EBUILD unarj-2.65.ebuild 783 SHA256 5d494ea921e9fb5ba4bca2d01c36006bb0cb2b4421386e5233837dc711d4c6b3 SHA512 bd42993bc7a866dddc7822c269d8bd64952bf4e5291b777e522668a4a44e374bec204ba2e66989805a403be1bfbf0a40337234e7f0631d264a6def4e72c4f0c7 WHIRLPOOL 975556cd9d7b77e6575913e6cc896d71ce7ec0347c9c353a8989f8b19053a6e685459257673f30cfc4e4752298c17887aa3d0cb0f3696990ce836d7375995ecf +MISC ChangeLog 2719 SHA256 b522c771e65e1238bcaab5021243d27944931497627f83c11c30e1a28e5278fa SHA512 8773911f49ecf9a2f86e4499de33e33fd3485b6278eb07f1292438406b1695a5b433be35e11bb6ae3aa9d3e8ad8fcc1d153f49b5ae0e108f55fef6a02ef03e7c WHIRLPOOL 5a1c3aba359caf9042798760b552be7a3b513fb4a3c1731477cf78bc7b3121c2662f4a52001f3131a17e543c879e854ff97c545c82382793adedaa06ce7bdcb0 +MISC ChangeLog-2015 3534 SHA256 b20753d3b7c7c4f3a38817e06cd82c4b9e752de45af17c6de70d6e56a9fd0dea SHA512 c9896d90d839163c2bcb0e02f524edb464fc2cad5e54dbc92aa03002784077d1b851aca01d8483d2cd7375f93aed05d337c85bcb36e7537ee4b83dba244c2be8 WHIRLPOOL 9ae2f3f0e1fd830b3869da471898be50b4dc3f9fd3f4de51ecb93516b299cc4ef222d59619a1854c282e09e20d366d586825cf583c50a7a1eb56eb80e961f754 +MISC metadata.xml 515 SHA256 8c7e26fc7893da95a73479be1aa5ad207554babd8af33de04f8c2db6190a58fe SHA512 72e4397504e316cca89b760d909cf151146f122e349283d4509f40036eee1272008ca8cfa2f2dc4b4204ecd450e6135f9ca1ffd8670aef6cda29d0865a61907e WHIRLPOOL e6bbfd38994847d4c3f25433486442654f079cc3cc92330e65ac60fbce9aa1248ff0a236dd2cc2d91d6785edf9225d95a757546cfe8b9d07d7e00be29e631d59 diff --git a/app-arch/unarj/files/unarj-2.65-CAN-2004-0947.patch b/app-arch/unarj/files/unarj-2.65-CAN-2004-0947.patch new file mode 100644 index 000000000000..f52af83ac2ca --- /dev/null +++ b/app-arch/unarj/files/unarj-2.65-CAN-2004-0947.patch @@ -0,0 +1,49 @@ +Index: unarj-2.65/unarj.c +=================================================================== +--- unarj-2.65.orig/unarj.c ++++ unarj-2.65/unarj.c +@@ -217,7 +217,7 @@ static uchar arj_flags; + static short method; + static uint file_mode; + static ulong time_stamp; +-static short entry_pos; ++static ushort entry_pos; + static ushort host_data; + static uchar *get_ptr; + static UCRC file_crc; +@@ -608,6 +608,7 @@ char *name; + error(M_BADHEADR, ""); + + crc = CRC_MASK; ++ memset(header, 0, sizeof(header)); + fread_crc(header, (int) headersize, fd); + header_crc = fget_crc(fd); + if ((crc ^ CRC_MASK) != header_crc) +@@ -632,9 +633,13 @@ char *name; + + if (origsize < 0 || compsize < 0) + error(M_HEADRCRC, ""); ++ if(first_hdr_size > headersize-2) /* need two \0 for file and comment */ ++ error(M_BADHEADR, ""); + + hdr_filename = (char *)&header[first_hdr_size]; + strncopy(filename, hdr_filename, sizeof(filename)); ++ if(entry_pos >= strlen(filename)) ++ error(M_BADHEADR, ""); + if (host_os != OS) + strparity((uchar *)filename); + if ((arj_flags & PATHSYM_FLAG) != 0) +@@ -733,11 +738,11 @@ extract() + + no_output = 0; + if (command == 'E') +- strcpy(name, &filename[entry_pos]); ++ strncopy(name, &filename[entry_pos], sizeof(name)); + else + { + strcpy(name, DEFAULT_DIR); +- strcat(name, filename); ++ strncopy(name+strlen(name), filename, sizeof(name)-strlen(name)); + } + + if (host_os != OS) diff --git a/app-arch/unarj/files/unarj-2.65-gentoo-fbsd.patch b/app-arch/unarj/files/unarj-2.65-gentoo-fbsd.patch new file mode 100644 index 000000000000..755b9b696cc9 --- /dev/null +++ b/app-arch/unarj/files/unarj-2.65-gentoo-fbsd.patch @@ -0,0 +1,9 @@ +--- environ.c 2007-06-19 12:44:09 +0200 ++++ environ.c.new 2007-06-19 12:44:37 +0200 +@@ -437,7 +437,6 @@ + #endif + + extern struct tm *localtime(); +-extern time_t time(); + extern char *strcpy(); + extern voidp *malloc();
\ No newline at end of file diff --git a/app-arch/unarj/files/unarj-2.65-sanitation.patch b/app-arch/unarj/files/unarj-2.65-sanitation.patch new file mode 100644 index 000000000000..f37784ed2491 --- /dev/null +++ b/app-arch/unarj/files/unarj-2.65-sanitation.patch @@ -0,0 +1,126 @@ +Index: unarj-2.65/sanitize.c +=================================================================== +--- /dev/null ++++ unarj-2.65/sanitize.c +@@ -0,0 +1,81 @@ ++/* ++ * Path sanitation code by Ludwig Nussel <ludwig.nussel@suse.de>. Public Domain. ++ */ ++ ++#include "unarj.h" ++ ++#include <string.h> ++#include <limits.h> ++#include <stdio.h> ++ ++#ifndef PATH_CHAR ++#define PATH_CHAR '/' ++#endif ++#ifndef MIN ++#define MIN(x,y) ((x)<(y)?(x):(y)) ++#endif ++ ++/* copy src into dest converting the path to a relative one inside the current ++ * directory. dest must hold at least len bytes */ ++void copy_path_relative(char *dest, char *src, size_t len) ++{ ++ char* o = dest; ++ char* p = src; ++ ++ *o = '\0'; ++ ++ while(*p && *p == PATH_CHAR) ++p; ++ for(; len && *p;) ++ { ++ src = p; ++ p = strchr(src, PATH_CHAR); ++ if(!p) p = src+strlen(src); ++ ++ /* . => skip */ ++ if(p-src == 1 && *src == '.' ) ++ { ++ if(*p) src = ++p; ++ } ++ /* .. => pop one */ ++ else if(p-src == 2 && *src == '.' && src[1] == '.') ++ { ++ if(o != dest) ++ { ++ char* tmp; ++ *o = '\0'; ++ tmp = strrchr(dest, PATH_CHAR); ++ if(!tmp) ++ { ++ len += o-dest; ++ o = dest; ++ if(*p) ++p; ++ } ++ else ++ { ++ len += o-tmp; ++ o = tmp; ++ if(*p) ++p; ++ } ++ } ++ else /* nothing to pop */ ++ if(*p) ++p; ++ } ++ else ++ { ++ size_t copy; ++ if(o != dest) ++ { ++ --len; ++ *o++ = PATH_CHAR; ++ } ++ copy = MIN(p-src,len); ++ memcpy(o, src, copy); ++ len -= copy; ++ src += copy; ++ o += copy; ++ if(*p) ++p; ++ } ++ while(*p && *p == PATH_CHAR) ++p; ++ } ++ o[len?0:-1] = '\0'; ++} +Index: unarj-2.65/unarj.c +=================================================================== +--- unarj-2.65.orig/unarj.c ++++ unarj-2.65/unarj.c +@@ -235,6 +235,8 @@ static UCRC crctable[UCHAR_MAX + 1]; + + /* Functions */ + ++void copy_path_relative(char *dest, char *src, size_t len); ++ + static void + make_crctable() + { +@@ -738,11 +740,11 @@ extract() + + no_output = 0; + if (command == 'E') +- strncopy(name, &filename[entry_pos], sizeof(name)); ++ copy_path_relative(name, &filename[entry_pos], sizeof(name)); + else + { + strcpy(name, DEFAULT_DIR); +- strncopy(name+strlen(name), filename, sizeof(name)-strlen(name)); ++ copy_path_relative(name+strlen(name), filename, sizeof(name)-strlen(name)); + } + + if (host_os != OS) +--- unarj-2.65.orig/Makefile Mon Nov 29 16:47:24 2004 ++++ unarj-2.65/Makefile Mon Nov 29 22:46:56 2004 +@@ -9,7 +9,9 @@ + + decode.o: decode.c unarj.h + +-OBJS = unarj.o decode.o environ.o ++sanitize.o: sanitize.c unarj.h ++ ++OBJS = unarj.o decode.o environ.o sanitize.o + + unarj: $(OBJS) + $(CC) $(LDFLAGS) $(OBJS) -o unarj diff --git a/app-arch/unarj/metadata.xml b/app-arch/unarj/metadata.xml new file mode 100644 index 000000000000..8f032a3fd115 --- /dev/null +++ b/app-arch/unarj/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> + <email>nitro@legroom.net</email> + <name>Jared B.</name> + <description>Proxied maintainer; set to assignee in all bugs</description> +</maintainer> +<maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> +</maintainer> +<longdescription>A utility that is designed to open arj archives.</longdescription> +</pkgmetadata> diff --git a/app-arch/unarj/unarj-2.65.ebuild b/app-arch/unarj/unarj-2.65.ebuild new file mode 100644 index 000000000000..d579027e1d33 --- /dev/null +++ b/app-arch/unarj/unarj-2.65.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit eutils toolchain-funcs + +DESCRIPTION="Utility for opening arj archives" +HOMEPAGE="http://www.arjsoftware.com/" +SRC_URI="mirror://freebsd/ports/local-distfiles/ache/${P}.tgz" + +LICENSE="arj" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" +IUSE="" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/${P}-CAN-2004-0947.patch + epatch "${FILESDIR}"/${P}-sanitation.patch + epatch "${FILESDIR}"/${P}-gentoo-fbsd.patch +} + +src_compile() { + tc-export CC + emake || die +} + +src_install() { + dobin unarj || die 'dobin failed' + dodoc unarj.txt technote.txt || die 'dodoc failed' +} |