From owner-svn-ports-all@freebsd.org Tue Feb 9 22:47:00 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E822AAA3B47; Tue, 9 Feb 2016 22:47:00 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A69FD11C1; Tue, 9 Feb 2016 22:47:00 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19MkxpB093936; Tue, 9 Feb 2016 22:46:59 GMT (envelope-from ak@FreeBSD.org) Received: (from ak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19MkwVr093929; Tue, 9 Feb 2016 22:46:58 GMT (envelope-from ak@FreeBSD.org) Message-Id: <201602092246.u19MkwVr093929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ak set sender to ak@FreeBSD.org using -f From: Alex Kozlov Date: Tue, 9 Feb 2016 22:46:58 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r408602 - in head/archivers/unarj: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 22:47:01 -0000 Author: ak Date: Tue Feb 9 22:46:58 2016 New Revision: 408602 URL: https://svnweb.freebsd.org/changeset/ports/408602 Log: - Update port description - Tidy up patches Added: head/archivers/unarj/files/patch-CVE-2004-0947 - copied, changed from r408601, head/archivers/unarj/files/patch-00-over-unarj.c head/archivers/unarj/files/patch-CVE-2004-1027 - copied, changed from r408601, head/archivers/unarj/files/patch-01-path-unarj.c head/archivers/unarj/files/patch-environ.c - copied unchanged from r408601, head/archivers/unarj/files/patch-ac head/archivers/unarj/files/patch-unarj.c - copied unchanged from r408601, head/archivers/unarj/files/patch-ab head/archivers/unarj/files/patch-unarj.h - copied unchanged from r408601, head/archivers/unarj/files/patch-aa Deleted: head/archivers/unarj/files/patch-00-over-unarj.c head/archivers/unarj/files/patch-01-path-Makefile head/archivers/unarj/files/patch-01-path-unarj.c head/archivers/unarj/files/patch-aa head/archivers/unarj/files/patch-ab head/archivers/unarj/files/patch-ac head/archivers/unarj/files/sanitize.c Modified: head/archivers/unarj/Makefile head/archivers/unarj/pkg-descr Modified: head/archivers/unarj/Makefile ============================================================================== --- head/archivers/unarj/Makefile Tue Feb 9 22:27:53 2016 (r408601) +++ head/archivers/unarj/Makefile Tue Feb 9 22:46:58 2016 (r408602) @@ -17,9 +17,6 @@ PORTDOCS= unarj.txt technote.txt OPTIONS_DEFINE= DOCS -post-patch: - ${CP} ${FILESDIR}/sanitize.c ${WRKSRC} - do-install: ${INSTALL_PROGRAM} ${WRKSRC}/unarj ${STAGEDIR}${PREFIX}/bin @${MKDIR} ${STAGEDIR}${DOCSDIR} Copied and modified: head/archivers/unarj/files/patch-CVE-2004-0947 (from r408601, head/archivers/unarj/files/patch-00-over-unarj.c) ============================================================================== --- head/archivers/unarj/files/patch-00-over-unarj.c Tue Feb 9 22:27:53 2016 (r408601, copy source) +++ head/archivers/unarj/files/patch-CVE-2004-0947 Tue Feb 9 22:46:58 2016 (r408602) @@ -1,5 +1,5 @@ ---- unarj-2.65.orig/unarj.c -+++ unarj.c +- Fix buffer overflow problem in filename handling (CAN-2004-0947) +Index: unarj.c @@ -217,7 +217,7 @@ static uchar arj_flags; static short method; static uint file_mode; Copied and modified: head/archivers/unarj/files/patch-CVE-2004-1027 (from r408601, head/archivers/unarj/files/patch-01-path-unarj.c) ============================================================================== --- head/archivers/unarj/files/patch-01-path-unarj.c Tue Feb 9 22:27:53 2016 (r408601, copy source) +++ head/archivers/unarj/files/patch-CVE-2004-1027 Tue Feb 9 22:46:58 2016 (r408602) @@ -1,5 +1,5 @@ ---- unarj-2.65.orig/unarj.c -+++ unarj.c +- Fix unchecked path extraction problem (CAN-2004-1027) +Index: unarj.c @@ -235,6 +235,8 @@ static UCRC crctable[UCHAR_MAX + 1]; /* Functions */ @@ -23,3 +23,98 @@ } if (host_os != OS) +Index: Makefile +@@ -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 +Index: sanitize.c +@@ -0,0 +1,81 @@ ++/* ++ * Path sanitation code by Ludwig Nussel . Public Domain. ++ */ ++ ++#include "unarj.h" ++ ++#include ++#include ++#include ++ ++#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'; ++} Copied: head/archivers/unarj/files/patch-environ.c (from r408601, head/archivers/unarj/files/patch-ac) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unarj/files/patch-environ.c Tue Feb 9 22:46:58 2016 (r408602, copy of r408601, head/archivers/unarj/files/patch-ac) @@ -0,0 +1,83 @@ +--- environ.c.orig Mon Sep 29 14:00:24 1997 ++++ environ.c Thu Feb 18 01:14:35 1999 +@@ -430,16 +430,24 @@ + + #define SUBS_DEFINED + ++#include ++#include + #include ++#include ++#include + +-#ifndef time_t +-#define time_t long +-#endif ++/*#ifndef time_t ++ #define time_t long ++ #endif*/ ++ ++#include + ++#if !(defined(BSD) && BSD >= 199306) + extern struct tm *localtime(); + extern time_t time(); + extern char *strcpy(); + extern voidp *malloc(); ++#endif + + FILE * + file_open(name, mode) +@@ -535,8 +543,12 @@ + } + + long +-gettz() /* returns the offset from GMT in seconds */ ++gettz(stamp) /* returns the offset from GMT in seconds */ ++time_t stamp; + { ++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) ++ return -localtime(&stamp)->tm_gmtoff; ++#else + #define NOONOFFSET 43200L + #define SEC_IN_DAY (24L * 60L * 60L) + #define INV_VALUE (SEC_IN_DAY + 1L) +@@ -552,6 +564,7 @@ + noontm = localtime(&noon); + retval = NOONOFFSET - 60 * (60 * noontm->tm_hour - noontm->tm_min); + return retval; ++#endif + } + + long +@@ -600,19 +613,29 @@ + { + time_t m_time; + struct utimbuf ++#ifndef __FreeBSD__ + { + time_t atime; /* New access time */ + time_t mtime; /* New modification time */ + } tb; ++#else ++ tb; ++#endif + + (char *) name; + (uint) attribute; + (uint) host; + +- m_time = mstonix(tstamp) + gettz(); ++ m_time = mstonix(tstamp); ++ m_time += gettz(m_time); + ++#ifndef __FreeBSD__ + tb.mtime = m_time; /* Set modification time */ + tb.atime = m_time; /* Set access time */ ++#else ++ tb.modtime = m_time; /* Set modification time */ ++ tb.actime = m_time; /* Set access time */ ++#endif + + /* set the time stamp on the file */ + return utime(name, &tb); Copied: head/archivers/unarj/files/patch-unarj.c (from r408601, head/archivers/unarj/files/patch-ab) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unarj/files/patch-unarj.c Tue Feb 9 22:46:58 2016 (r408602, copy of r408601, head/archivers/unarj/files/patch-ab) @@ -0,0 +1,44 @@ +--- unarj.c.orig Wed Jun 5 12:28:06 2002 ++++ unarj.c Mon Nov 29 17:48:27 2004 +@@ -54,6 +54,10 @@ + #include + #include + #include ++#include ++#include ++#include ++#include + #else /* !MODERN */ + extern void free(); + extern void exit(); +@@ -718,6 +722,8 @@ + extract() + { + char name[FNAME_MAX]; ++ char dir[FNAME_MAX]; ++ char *pos; + + if (check_flags()) + { +@@ -736,6 +742,21 @@ + + if (host_os != OS) + default_case_path(name); ++ ++ ++ /* ++ 8/8/2000 Phil Knirsch: Bugfix to create subdirectories. Unarj didn't ++ do this for a long time, so it's finally fixed. ++ */ ++ pos = strchr(name, PATH_CHAR); ++ ++ while (pos != NULL) ++ { ++ strncpy(dir, name, pos-name); ++ dir[pos-name] = '\0'; ++ mkdir(dir, 0777); ++ pos = strchr(pos+1, PATH_CHAR); ++ } + + if (file_exists(name)) + { Copied: head/archivers/unarj/files/patch-unarj.h (from r408601, head/archivers/unarj/files/patch-aa) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/unarj/files/patch-unarj.h Tue Feb 9 22:46:58 2016 (r408602, copy of r408601, head/archivers/unarj/files/patch-aa) @@ -0,0 +1,15 @@ +--- unarj.h.orig Mon Sep 29 14:00:24 1997 ++++ unarj.h Thu Feb 18 01:06:10 1999 +@@ -106,8 +106,12 @@ + #endif + + typedef unsigned char uchar; /* 8 bits or more */ ++#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) + typedef unsigned int uint; /* 16 - 32 bits or more */ + typedef unsigned short ushort; /* 16 bits or more */ ++#else ++# include ++#endif + typedef unsigned long ulong; /* 32 bits or more */ + + #define USHRT_BIT (CHAR_BIT * sizeof(ushort)) Modified: head/archivers/unarj/pkg-descr ============================================================================== --- head/archivers/unarj/pkg-descr Tue Feb 9 22:27:53 2016 (r408601) +++ head/archivers/unarj/pkg-descr Tue Feb 9 22:46:58 2016 (r408602) @@ -1,7 +1,5 @@ -This is an extract-only program which allows access to the contents of ARJ -archives. You cannot specify a base directory or select individual files -to extract. UNARJ does not support empty directories or volume labels. -UNARJ is much slower than ARJ because ARJ is highly optimized using -assembly language. +This is an extract-only program which allows access to the contents of ARJ +archives. You cannot specify a base directory or select individual files +to extract. UNARJ does not support empty directories or volume labels. WWW: http://www.arjsoftware.com/