1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-03 06:04:53 +00:00

the autoconfig-version of lha

maintained as seperate project

Suggested by:	Shigekazu Kimura
This commit is contained in:
Dirk Meyer 2006-08-17 04:59:00 +00:00
parent bbe039fc1a
commit 22ce31f636
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=170834
8 changed files with 5065 additions and 0 deletions

View File

@ -36,6 +36,7 @@
SUBDIR += lbrate
SUBDIR += lcab
SUBDIR += lha
SUBDIR += lha-ac
SUBDIR += libarc
SUBDIR += libarchive
SUBDIR += libcabinet

42
archivers/lha-ac/Makefile Normal file
View File

@ -0,0 +1,42 @@
# New ports collection makefile for: lha-autoconf
# Date created: 24 Sep 2004
# Whom: dirk.meyer@dinoex.sub.org
#
# $FreeBSD$
#
PORTNAME= lha
PORTVERSION= 1.14i
PORTREVISION= 7
CATEGORIES= archivers
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP} \
http://qgpop.dl.sourceforge.jp/%SUBDIR%/ \
http://osdn.dl.sourceforge.jp/%SUBDIR%/
MASTER_SITE_SUBDIR= lha/6052
PKGNAMESUFFIX= -ac${PKGNAMESUFFIX2}
DISTNAME= ${PORTNAME}-${PORTVERSION}-ac20030921
MAINTAINER= dinoex@FreeBSD.org
COMMENT= Archive files using LZSS and Huffman compression (.lzh files)
MAN1= lha.1
MANLANG= ja
PLIST_FILES= bin/lha
PLIST_DIRS= man/ja/man1
GNU_CONFIGURE= yes
RESTRICTED= "no permission to redistribute"
NO_PACKAGE= ${RESTRICTED}
.if !defined(WITHOUT_NLS)
CONFIGURE_ARGGS+= --disable-multibyte-filename
.else
CONFIGURE_ARGGS+= --enable-multibyte-filename=auto
.endif
do-install:
-${MKDIR} ${MANPREFIX}/man/ja/man1
${INSTALL_PROGRAM} ${WRKSRC}/src/lha ${PREFIX}/bin/lha
${INSTALL_MAN} ${WRKSRC}/man/lha.n ${MANPREFIX}/man/ja/man1/lha.1
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
MD5 (lha-1.14i-ac20030921.tar.gz) = 7cbf0599683547b64f44076def988c55
SHA256 (lha-1.14i-ac20030921.tar.gz) = c81ba351411dd935ec6be0e051dc1558a41d68e0180ae2ae90f06c09c43ed9e1
SIZE (lha-1.14i-ac20030921.tar.gz) = 216238

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
--- src/lha.h.orig Sun Sep 21 15:58:52 2003
+++ src/lha.h Thu Sep 23 07:10:33 2004
@@ -16,6 +16,7 @@
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <errno.h>
#include <ctype.h>
#include <sys/types.h>

View File

@ -0,0 +1,51 @@
--- src/lharc.c.orig Sun Sep 21 15:58:52 2003
+++ src/lharc.c Thu Sep 23 07:22:19 2004
@@ -994,9 +994,10 @@
struct stat tmp_stbuf, arc_stbuf, fil_stbuf;
int exist_tmp = 1, exist_arc = 1;
- strcpy(newname, name);
+ strncpy(newname, name, sizeof(newname));
+ newname[sizeof(newname)-1] = 0;
len = strlen(name);
- if (len > 0 && newname[len - 1] != '/') {
+ if (len > 0 && newname[len - 1] != '/' && len < (sizeof(newname)-1)) {
newname[len++] = '/';
newname[len] = 0;
}
@@ -1014,12 +1015,16 @@
while ((dp = readdir(dirp)) != NULL) {
n = NAMLEN(dp);
+ if (len >= (sizeof(newname)-1)
+ || (len+n) >= (sizeof(newname)-1)
+ || n <= 0
+ || (len+n) <= 0)
+ break;
/* exclude '.' and '..' */
if (strncmp(dp->d_name, ".", n) == 0
|| strncmp(dp->d_name, "..", n) == 0)
continue;
-
/* exclude exclude_files supplied by user */
for (i = 0; exclude_files && exclude_files[i]; i++) {
if (fnmatch(exclude_files[i], dp->d_name,
@@ -1092,10 +1097,16 @@
#else
char *p, *s;
- strcpy(temporary_name, archive_name);
+ strncpy(temporary_name, archive_name, sizeof(temporary_name));
+ temporary_name[sizeof(temporary_name)-1] = 0;
for (p = temporary_name, s = (char *) 0; *p; p++)
if (*p == '/')
s = p;
+
+ if( sizeof(temporary_name) - ((size_t) (s-temporary_name)) - 1
+ <= strlen("lhXXXXXX"))
+ exit(-1);
+
strcpy((s ? s + 1 : temporary_name), "lhXXXXXX");
#endif
#ifdef HAVE_MKSTEMP

View File

@ -0,0 +1,25 @@
--- src/lhext.c.orig Thu Sep 23 09:01:34 2004
+++ src/lhext.c Thu Sep 23 09:01:34 2004
@@ -88,7 +88,8 @@
register char *p;
/* make parent directory name into PATH for recursive call */
- strcpy(path, name);
+ memset(path, 0, sizeof(path));
+ strncpy(path, name, sizeof(path)-1);
for (p = path + strlen(path); p > path; p--)
if (p[-1] == '/') {
*--p = '\0';
@@ -249,8 +250,10 @@
if (extract_directory)
xsnprintf(name, sizeof(name), "%s/%s", extract_directory, q);
- else
- strcpy(name, q);
+ else {
+ strncpy(name, q, sizeof(name));
+ name[sizeof(name) - 1] = '\0';
+ }
/* LZHDIRS_METHODを持つヘッダをチェックする */

View File

@ -0,0 +1,3 @@
LHa for UNIX with autoconf
WWW: http://sourceforge.jp/projects/lha/