Update to 1.14i.ac20050924

From Yozo Toda <yozo@v007.vaio.ne.jp> (MAINTAINER)
This commit is contained in:
alek 2005-12-04 17:05:50 +00:00
parent 8e72681609
commit 92cb94d553
12 changed files with 124 additions and 178 deletions

View File

@ -1,13 +1,12 @@
# $OpenBSD: Makefile,v 1.24 2004/11/21 12:50:32 espie Exp $
# $OpenBSD: Makefile,v 1.25 2005/12/04 17:05:50 alek Exp $
COMMENT= "archive files using LZW compression (.lzh files)"
VERSION= 1.14i
DISTNAME= lha-${VERSION:S/.//}
PKGNAME= lha-${VERSION}.p0
DISTNAME= lha-1.14i-ac20050924
PKGNAME= lha-1.14i.ac20050924
CATEGORIES= archivers
HOMEPAGE= http://www2m.biglobe.ne.jp/~dolphin/lha/lha.htm
HOMEPAGE= http://www.sourceforge.jp/projects/lha/
MAINTAINER= Yozo Toda <yozo@v007.vaio.ne.jp>
@ -18,19 +17,14 @@ PERMIT_DISTFILES_CDROM= "requires advance notification"
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c
MASTER_SITES= http://www2m.biglobe.ne.jp/~dolphin/lha/prog/ \
ftp://ftp.win.ne.jp/pub/misc/
MASTER_SITES= http://keihanna.dl.sourceforge.jp/lha/16650/ \
http://osdn.dl.sourceforge.jp/lha/16650/
MAKE_FLAGS= CC="${CC}" OPTIMIZE="${CFLAGS}" \
MACHINE="-DSYSTIME_HAS_NO_TM -DSYSV_SYSTEM_DIR -DMKTIME \
-DUSESTRCASECMP" \
SWITCHES="-DNEED_INCREMENTAL_INDICATOR -DEUC -DSUPPORT_LH7"
CONFIGURE_STYLE=gnu
FAKE_FLAGS= BINDIR="${WRKINST}${PREFIX}/bin" \
MANDIR="${WRKINST}${PREFIX}/man/ja_JP.EUC" MANSECT="1" \
INSTALL="" INSTALLBIN="${INSTALL_PROGRAM}" \
INSTALLMAN="${INSTALL_MAN}"
post-install:
${INSTALL_MAN_DIR} ${PREFIX}/man/ja_JP.EUC/man1
${INSTALL_MAN} ${WRKSRC}/man/lha.n ${PREFIX}/man/ja_JP.EUC/man1/lha.1
NO_REGRESS= Yes
.include <bsd.port.mk>

View File

@ -1,4 +1,4 @@
MD5 (lha-114i.tar.gz) = 5225884d557b91f04124693e2c5c9e94
RMD160 (lha-114i.tar.gz) = c561e0758b467a61f45d287582effc53df29f01d
SHA1 (lha-114i.tar.gz) = 79e35271f2cf783f946db3f22e304fef72dbac99
SIZE (lha-114i.tar.gz) = 64608
MD5 (lha-1.14i-ac20050924.tar.gz) = e152850807e524bdac54373e16bac290
RMD160 (lha-1.14i-ac20050924.tar.gz) = bc01e71de43e1c160526679a7d4579c5193239cc
SHA1 (lha-1.14i-ac20050924.tar.gz) = edcbbba64d3b6cbb218057acddeeea9424ee4071
SIZE (lha-1.14i-ac20050924.tar.gz) = 275236

View File

@ -0,0 +1,11 @@
--- tests/Makefile.in.orig Sat Sep 24 15:05:21 2005
+++ tests/Makefile.in Sun Dec 4 17:40:11 2005
@@ -281,7 +281,7 @@ uninstall-am: uninstall-info-am
check-local:
- bash ./lha-test
+ sh ./lha-test
lha-test: $(top_builddir)/config.status $(srcdir)/lha-test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@

View File

@ -1,25 +0,0 @@
$OpenBSD: patch-src_header_c,v 1.1 2004/05/06 23:07:57 naddy Exp $
--- src/header.c.orig 2000-10-05 19:36:03.000000000 +0200
+++ src/header.c 2004-05-07 00:48:44.000000000 +0200
@@ -538,6 +538,10 @@ get_header(fp, hdr)
/*
* filename
*/
+ if (header_size >= 256) {
+ fprintf(stderr, "Possible buffer overflow hack attack, type #1\n");
+ exit(109);
+ }
for (i = 0; i < header_size - 3; i++)
hdr->name[i] = (char) get_byte();
hdr->name[header_size - 3] = '\0';
@@ -547,6 +551,10 @@ get_header(fp, hdr)
/*
* directory
*/
+ if (header_size >= FILENAME_LENGTH) {
+ fprintf(stderr, "Possible buffer overflow hack attack, type #2\n");
+ exit(110);
+ }
for (i = 0; i < header_size - 3; i++)
dirname[i] = (char) get_byte();
dirname[header_size - 3] = '\0';

View File

@ -1,11 +0,0 @@
$OpenBSD: patch-src_lha_h,v 1.1 2002/12/18 21:13:52 naddy Exp $
--- src/lha.h.orig Wed Dec 18 22:05:52 2002
+++ src/lha.h Wed Dec 18 22:06:09 2002
@@ -11,6 +11,7 @@
lharc.h interface.h slidehuf.h
*/
#include <stdio.h>
+#include <stdlib.h>
#include <errno.h>
#include <ctype.h>
#include <sys/types.h>

View File

@ -1,41 +0,0 @@
$OpenBSD: patch-src_lhadd_c,v 1.1 2002/02/04 22:16:17 naddy Exp $
--- src/lhadd.c.orig Wed Oct 4 16:57:38 2000
+++ src/lhadd.c Mon Feb 4 17:52:03 2002
@@ -270,13 +270,35 @@ build_temporary_file()
{
int old_umask;
FILE *afp;
+ int tempfd;
+
+ #ifdef TMP_FILENAME_TEMPLATE
+ if (extract_directory == NULL) {
+ strcpy(temporary_name, TMP_FILENAME_TEMPLATE);
+ }
+ else {
+ sprintf(temporary_name, "%s/lhXXXXXX", extract_directory);
+ }
+ tempfd = mkstemp(temporary_name);
+ #else
+ char *p, *s;
+
+ strcpy(temporary_name, archive_name);
+ for (p = temporary_name, s = (char *) 0; *p; p++)
+ if (*p == '/')
+ s = p;
+ strcpy((s ? s + 1 : temporary_name), "lhXXXXXX");
+ tempfd = mkstemp(temporary_name);
+ #endif
+ if (tempfd == -1)
+ return NULL;
- build_temporary_name();
signal(SIGINT, interrupt);
signal(SIGHUP, interrupt);
old_umask = umask(077);
- afp = xfopen(temporary_name, WRITE_BINARY);
+ /*afp = xfopen(temporary_name, WRITE_BINARY);*/
+ afp = fdopen(tempfd, "w+");
remove_temporary_at_error = TRUE;
temporary_fp = afp;
umask(old_umask);

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-src_lharc_c,v 1.1 2002/02/04 22:16:17 naddy Exp $
--- src/lharc.c.orig Thu Oct 5 19:33:34 2000
+++ src/lharc.c Mon Feb 4 17:52:03 2002
@@ -894,6 +894,7 @@ free_files(filec, filev)
/* */
/* ------------------------------------------------------------------------ */
/* Build temporary file name and store to TEMPORARY_NAME */
+#if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
void
build_temporary_name()
{
@@ -925,7 +926,7 @@ build_temporary_name()
#endif
#endif
}
-
+#endif
/* ------------------------------------------------------------------------ */
static void
modify_filename_extention(buffer, ext)

View File

@ -1,60 +0,0 @@
$OpenBSD: patch-src_lhext_c,v 1.1 2004/05/06 23:07:57 naddy Exp $
--- src/lhext.c.orig 2000-10-04 16:57:38.000000000 +0200
+++ src/lhext.c 2004-05-07 01:00:10.000000000 +0200
@@ -190,8 +190,13 @@ extract_one(afp, hdr)
q = (char *) rindex(hdr->name, '/') + 1;
}
else {
+ if (is_directory_traversal(q)) {
+ fprintf(stderr, "Possible directory traversal hack attempt in %s\n", q);
+ exit(111);
+ }
+
if (*q == '/') {
- q++;
+ while (*q == '/') { q++; }
/*
* if OSK then strip device name
*/
@@ -351,6 +356,7 @@ extract_one(afp, hdr)
}
unlink(bb1);
+ make_parent_path(bb1);
l_code = symlink(bb2, bb1);
if (l_code < 0) {
if (quiet != TRUE)
@@ -419,6 +425,33 @@ cmd_extract()
return;
}
+int
+is_directory_traversal(char *string)
+{
+ unsigned int type = 0; /* 0 = new, 1 = only dots, 2 = other chars than dots */
+ char *temp;
+
+ temp = string;
+
+ while (*temp != 0) {
+ if (temp[0] == '/') {
+ if (type == 1) { return 1; }
+ type = 0;
+ temp++;
+ continue;
+ }
+
+ if ((temp[0] == '.') && (type < 2))
+ type = 1;
+ if (temp[0] != '.')
+ type = 2;
+
+ temp++;
+ } /* while */
+
+ return (type == 1);
+}
+
/* Local Variables: */
/* mode:c */
/* tab-width:4 */

View File

@ -0,0 +1,15 @@
--- tests/lha-test1.orig Sun Jul 27 18:13:34 2003
+++ tests/lha-test1 Sun May 9 10:03:28 2004
@@ -2,10 +2,10 @@
message testing to create/list/extract lha archive.
i=0
-while (( i < 100 ))
+while [ $i -lt 100 ]
do
echo foo
- ((i = i + 1))
+ i=`expr $i + 1`
done > test-a
sed 's/foo/bar/g' < test-a > test-b
sed 's/foo/baz/g' < test-a > test-c

View File

@ -0,0 +1,24 @@
--- tests/lha-test13.orig Tue Jul 29 14:15:43 2003
+++ tests/lha-test13 Sun Dec 4 17:40:11 2005
@@ -46,17 +46,17 @@ diff test-tmp-euc test-tmp-euc-d2/test-t
check $? $LINENO
i=0
-while ((i < 10))
+while [ $i -lt 10 ]
do
cat test-tmp-euc
- ((i = i + 1))
+ i=`expr $i + 1`
done > test-tmp-euc2
i=0
-while ((i < 10))
+while [ $i -lt 10 ]
do
cat test-tmp-sjis
- ((i = i + 1))
+ i=`expr $i + 1`
done > test-tmp-sjis2
# no convert

View File

@ -0,0 +1,58 @@
--- tests/lha-test.in.orig Sun Jul 27 19:37:51 2003
+++ tests/lha-test.in Sun Dec 4 17:40:11 2005
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
: ${lha_dir=@top_builddir@/src}
: ${lha_cmd=$(cd $lha_dir && pwd)/lha}
@@ -6,8 +6,8 @@
trap '_stat=$?; rm -rf test-*; exit $_stat' 0 1 2 3 15
-typeset -i i # for loop
-typeset -i test_number=0 error_num=0
+## typeset -i i # for loop
+test_number=0 error_num=0
error_tests=""
# fd 1: for logging
@@ -30,15 +30,15 @@ message()
check()
{
- ((test_number = test_number + 1))
- typeset status=$1
- typeset lineno=$2
- if [[ $status -eq 0 ]]; then
+ test_number=`expr ${test_number} + 1`
+ status=$1
+ lineno=$2
+ if [ $status -eq 0 ]; then
echo "$FILENAME #$test_number ... ok" >&2
echo "$FILENAME #$test_number ... ok at line $lineno"
else
message "$FILENAME #$test_number ... failed at line $lineno"
- ((error_num = error_num + 1))
+ error_num=`expr ${error_num} + 1`
error_tests="$error_tests $FILENAME #$test_number"
result=1
fi
@@ -63,7 +63,7 @@ testsuite()
change_timestamp()
{
- typeset time=$1; shift
+ time=$1; shift
# assume that `touch' command supports POSIX's -t switch.
@@ -101,7 +101,7 @@ case `$lha --version 2>&1` in
esac
testsuite lha-test15
-if (( $error_num != 0 )); then
+if [ $error_num != 0 ]; then
message $error_num tests failed!
message test number: $error_tests
fi

View File

@ -1,3 +1,4 @@
@comment $OpenBSD: PLIST,v 1.5 2004/08/03 11:30:01 espie Exp $
@comment $OpenBSD: PLIST,v 1.6 2005/12/04 17:05:50 alek Exp $
bin/lha
@man man/ja_JP.EUC/man1/lha.1
@comment @man man/mann/lha.n