update to 1.14i.ac20210926

originally from maintainer, some tweaks needed with cluebat stick provided by
both sthen and espie@

ok sthen@
This commit is contained in:
mestre 2021-11-04 12:29:11 +00:00
parent 178ca069da
commit 94ef46b55e
9 changed files with 14 additions and 208 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.39 2019/07/14 00:39:34 naddy Exp $
# $OpenBSD: Makefile,v 1.40 2021/11/04 12:29:11 mestre Exp $
COMMENT= archive files using LZW compression (.lzh files)
DISTNAME= lha-1.14i-ac20050924p1
PKGNAME= lha-1.14i.ac20050924.1
REVISION= 3
VERSION= 1.14i-ac20210926
DISTNAME= lha-${VERSION}
PKGNAME= lha-${VERSION:C/-/./}
CATEGORIES= archivers
HOMEPAGE= https://lha.osdn.jp/
@ -15,12 +15,12 @@ MAINTAINER= Yozo Toda <yozo@v007.vaio.ne.jp>
PERMIT_PACKAGE= Yes
WANTLIB= c
MASTER_SITES= ${MASTER_SITE_OSDN_JP:=lha/22231/}
GH_ACCOUNT = jca02266
GH_PROJECT = lha
GH_TAGNAME = release-20210926
CONFIGURE_STYLE=gnu
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
CONFIGURE_STYLE= autoreconf
AUTOCONF_VERSION = 2.71
AUTOMAKE_VERSION = 1.16
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (lha-1.14i-ac20050924p1.tar.gz) = tSYen5hTiBaqnmR5HyPLg/FjLs2mHwLlS2dJ6cpenuQ=
SIZE (lha-1.14i-ac20050924p1.tar.gz) = 285518
SHA256 (lha-1.14i-ac20210926.tar.gz) = t6WO6kRk3BGo0v+MYAKCoduAK7Vb5PjyP4/b/DOvUfs=
SIZE (lha-1.14i-ac20210926.tar.gz) = 228249

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-Makefile_in,v 1.2 2014/04/18 22:59:32 jasper Exp $
--- tests/Makefile.in.orig Mon Oct 16 16:50:10 2006
+++ tests/Makefile.in Sat Apr 19 00:52:34 2014
@@ -311,7 +311,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,19 +0,0 @@
$OpenBSD: patch-src_getopt_long_c,v 1.1 2017/04/17 14:32:55 espie Exp $
--- src/getopt_long.c.orig Mon Apr 17 00:45:00 2017
+++ src/getopt_long.c Mon Apr 17 00:45:17 2017
@@ -66,11 +66,11 @@ puts_argv(char **argv)
#include <stdio.h>
#include <getopt_long.h>
-char *optarg;
-int optind;
+extern char *optarg;
+extern int optind;
-int opterr;
-int optopt;
+extern int opterr;
+extern int optopt;
/*
return value 0: no option (include '-')

View File

@ -1,62 +0,0 @@
$OpenBSD: patch-src_header_c,v 1.3 2016/01/27 13:36:35 jasper Exp $
Security fix for CVE-2016-1925
http://seclists.org/oss-sec/2016/q1/132
https://osdn.jp/projects/lha/scm/git/lha/commits/bf2471f
--- src/header.c.orig Wed Jan 27 14:31:45 2016
+++ src/header.c Wed Jan 27 14:34:05 2016
@@ -688,6 +688,7 @@ get_header_level0(fp, hdr, data)
char *data;
{
size_t header_size;
+ ssize_t remain_size;
ssize_t extend_size;
int checksum;
int name_length;
@@ -697,9 +698,15 @@ get_header_level0(fp, hdr, data)
hdr->header_size = header_size = get_byte();
checksum = get_byte();
- if (fread(data + COMMON_HEADER_SIZE,
- header_size + 2 - COMMON_HEADER_SIZE, 1, fp) == 0) {
- error("Invalid header (LHarc file ?)");
+ /* The data variable has been already read as COMMON_HEADER_SIZE bytes.
+ So we must read the remaining header size by the header_size. */
+ remain_size = header_size + 2 - COMMON_HEADER_SIZE;
+ if (remain_size <= 0) {
+ error("Invalid header size (LHarc file ?)");
+ return FALSE;
+ }
+ if (fread(data + COMMON_HEADER_SIZE, remain_size, 1, fp) == 0) {
+ error("Invalid header (LHarc file ?)");
return FALSE; /* finish */
}
@@ -804,6 +811,7 @@ get_header_level1(fp, hdr, data)
char *data;
{
size_t header_size;
+ ssize_t remain_size;
ssize_t extend_size;
int checksum;
int name_length;
@@ -813,9 +821,15 @@ get_header_level1(fp, hdr, data)
hdr->header_size = header_size = get_byte();
checksum = get_byte();
- if (fread(data + COMMON_HEADER_SIZE,
- header_size + 2 - COMMON_HEADER_SIZE, 1, fp) == 0) {
- error("Invalid header (LHarc file ?)");
+ /* The data variable has been already read as COMMON_HEADER_SIZE bytes.
+ So we must read the remaining header size by the header_size. */
+ remain_size = header_size + 2 - COMMON_HEADER_SIZE;
+ if (remain_size <= 0) {
+ error("Invalid header size (LHarc file ?)");
+ return FALSE;
+ }
+ if (fread(data + COMMON_HEADER_SIZE, remain_size, 1, fp) == 0) {
+ error("Invalid header (LHarc file ?)");
return FALSE; /* finish */
}

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-tests-lha-test1,v 1.2 2014/04/18 22:59:32 jasper Exp $
--- 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

@ -1,25 +0,0 @@
$OpenBSD: patch-tests-lha-test13,v 1.2 2014/04/18 22:59:32 jasper Exp $
--- tests/lha-test13.orig Tue Jul 29 14:15:43 2003
+++ tests/lha-test13 Sat Apr 19 00:52:34 2014
@@ -46,17 +46,17 @@ diff test-tmp-euc test-tmp-euc-d2/test-tmp-euc
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

@ -1,59 +0,0 @@
$OpenBSD: patch-tests-lha-test_in,v 1.2 2014/04/18 22:59:32 jasper Exp $
--- 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,4 +1,3 @@
@comment $OpenBSD: PLIST,v 1.7 2018/05/12 09:22:27 espie Exp $
@comment $OpenBSD: PLIST,v 1.8 2021/11/04 12:29:11 mestre Exp $
@bin bin/lha
@man man/ja_JP.EUC/man1/lha.1
@comment @man man/mann/lha.n
@man man/man1/lha.1