head	1.23;
access;
symbols
	RELEASE_8_3_0:1.21
	RELEASE_9_0_0:1.21
	RELEASE_7_4_0:1.20
	RELEASE_8_2_0:1.20
	RELEASE_6_EOL:1.20
	RELEASE_8_1_0:1.19
	RELEASE_7_3_0:1.19
	RELEASE_8_0_0:1.19
	RELEASE_7_2_0:1.19
	RELEASE_7_1_0:1.19
	RELEASE_6_4_0:1.19
	RELEASE_5_EOL:1.19
	RELEASE_7_0_0:1.18
	RELEASE_6_3_0:1.18
	PRE_XORG_7:1.17
	RELEASE_4_EOL:1.17
	RELEASE_6_2_0:1.15
	RELEASE_6_1_0:1.14
	RELEASE_5_5_0:1.14
	RELEASE_6_0_0:1.14
	RELEASE_5_4_0:1.12
	RELEASE_4_11_0:1.12
	RELEASE_5_3_0:1.11
	RELEASE_4_10_0:1.11
	RELEASE_5_2_1:1.9
	RELEASE_5_2_0:1.9
	RELEASE_4_9_0:1.9
	RELEASE_5_1_0:1.7
	RELEASE_4_8_0:1.7
	RELEASE_5_0_0:1.6
	RELEASE_4_7_0:1.6
	RELEASE_4_6_2:1.5
	RELEASE_4_6_1:1.5
	RELEASE_4_6_0:1.5
	RELEASE_5_0_DP1:1.5
	RELEASE_4_5_0:1.5
	RELEASE_4_4_0:1.5
	RELEASE_4_3_0:1.2;
locks; strict;
comment	@# @;


1.23
date	2012.12.21.06.04.16;	author svnexp;	state Exp;
branches;
next	1.22;

1.22
date	2012.11.17.05.54.20;	author svnexp;	state Exp;
branches;
next	1.21;

1.21
date	2011.06.11.21.04.59;	author gabor;	state Exp;
branches;
next	1.20;

1.20
date	2010.07.29.22.45.51;	author gabor;	state Exp;
branches;
next	1.19;

1.19
date	2008.03.20.09.19.32;	author pav;	state Exp;
branches;
next	1.18;

1.18
date	2007.08.07.18.21.25;	author sobomax;	state Exp;
branches;
next	1.17;

1.17
date	2007.01.02.21.12.04;	author gabor;	state Exp;
branches;
next	1.16;

1.16
date	2006.12.08.13.46.25;	author gabor;	state Exp;
branches;
next	1.15;

1.15
date	2006.09.10.17.53.55;	author erwin;	state Exp;
branches;
next	1.14;

1.14
date	2005.04.12.03.24.46;	author obrien;	state Exp;
branches;
next	1.13;

1.13
date	2005.04.11.08.01.16;	author obrien;	state Exp;
branches;
next	1.12;

1.12
date	2004.10.23.08.35.51;	author okazaki;	state Exp;
branches;
next	1.11;

1.11
date	2004.03.16.13.14.57;	author krion;	state Exp;
branches;
next	1.10;

1.10
date	2004.02.05.20.36.51;	author trevor;	state Exp;
branches;
next	1.9;

1.9
date	2003.07.29.09.12.21;	author sobomax;	state Exp;
branches;
next	1.8;

1.8
date	2003.07.14.02.52.54;	author sf;	state Exp;
branches;
next	1.7;

1.7
date	2003.03.07.05.55.10;	author ade;	state Exp;
branches;
next	1.6;

1.6
date	2002.08.30.12.08.16;	author sobomax;	state Exp;
branches;
next	1.5;

1.5
date	2001.08.27.08.35.40;	author sobomax;	state Exp;
branches;
next	1.4;

1.4
date	2001.08.20.08.13.32;	author sobomax;	state Exp;
branches;
next	1.3;

1.3
date	2001.08.07.11.57.53;	author sobomax;	state Exp;
branches;
next	1.2;

1.2
date	2001.03.06.13.29.20;	author sobomax;	state Exp;
branches;
next	1.1;

1.1
date	2000.11.30.14.21.28;	author sobomax;	state Exp;
branches;
next	;


desc
@@


1.23
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/309340
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r309340 | danfe | 2012-12-21 05:32:17 +0000 (Fri, 21 Dec 2012) | 8 lines
## SVN ##
## SVN ## - Trim Makefile header per new bylaws
## SVN ## - Drop indefinite article from COMMENT
## SVN ## - Define LICENSE (and remove COPYING from portdocs)
## SVN ## - Unmute installation commands
## SVN ## - Convert NOPORTDOCS -> PORT_OPTIONS:MDOCS
## SVN ##
## SVN ## Approved by:	maintainer (gabor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@# Created by: Maxim Sobolev <sobomax@@FreeBSD.org>
# $FreeBSD: head/archivers/cabextract/Makefile 309340 2012-12-21 05:32:17Z danfe $

PORTNAME=	cabextract
PORTVERSION=	1.4
CATEGORIES=	archivers
MASTER_SITES=	http://www.cabextract.org.uk/

MAINTAINER=	gabor@@FreeBSD.org
COMMENT=	Program to extract Microsoft cabinet (.CAB) files

LICENSE=	GPLv3

GNU_CONFIGURE=	yes

MANLANG=	"" ja
MAN1=		cabextract.1

PLIST_FILES=	bin/cabextract
DOCS=		AUTHORS ChangeLog NEWS README TODO
DOC_DOCS=	magic wince_cab_format.html
SRC_DOCS=	wince_info wince_rename
PORTDOCS=	${DOCS} ${DOC_DOCS} ${SRC_DOCS}

OPTIONS_DEFINE=	DOCS

.include <bsd.port.options.mk>

post-install:
	${INSTALL_MAN} ${WRKSRC}/doc/cabextract.1 ${MAN1PREFIX}/man/man1
	${INSTALL_MAN} ${WRKSRC}/doc/ja/cabextract.1 ${MAN1PREFIX}/man/ja/man1
.if ${PORT_OPTIONS:MDOCS}
	@@${MKDIR} ${DOCSDIR}
.for i in ${DOCS}
	${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
.for i in ${DOC_DOCS}
	${INSTALL_DATA} ${WRKSRC}/doc/${i} ${DOCSDIR}
.endfor
.for i in ${SRC_DOCS}
	${INSTALL_DATA} ${WRKSRC}/src/${i} ${DOCSDIR}
.endfor
.endif

.include <bsd.port.mk>
@


1.22
log
@Switch exporter over
@
text
@d1 2
a2 6
# New ports collection makefile for:	cabextract
# Date Created:				30 November 2000
# Whom:					Maxim Sobolev <sobomax@@FreeBSD.org>
#
# $FreeBSD: head/archivers/cabextract/Makefile 300895 2012-07-14 12:56:14Z beat $
#
d10 3
a12 1
COMMENT=	A program to extract Microsoft cabinet (.CAB) files
d20 1
a20 1
DOCS=		AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
d25 4
d32 1
a32 1
.if !defined(NOPORTDOCS)
d35 1
a35 1
	@@${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
d38 1
a38 1
	@@${INSTALL_DATA} ${WRKSRC}/doc/${i} ${DOCSDIR}
d41 1
a41 1
	@@${INSTALL_DATA} ${WRKSRC}/src/${i} ${DOCSDIR}
@


1.21
log
@- Update to 1.4
@
text
@d5 1
a5 1
# $FreeBSD$
@


1.20
log
@Update to 1.3, which fixes two security bugs. Detailed description
from the author follows.

Bug 1: Infinite loop in MS-ZIP decoder [1]

The MS-ZIP and Quantum decoders read bits in roughly the same way as the LZX
decoder, however they don't have "inject two fake bytes" code.

In the situation where read() provides zero bytes, e.g. at the end of file or
end of a CAB block, the LZX decoder handles this by injecting two fake bytes,
then returns an error on subsequent calls. MS-ZIP and Quantum instead return
zero bytes without error. However, all three decoders are written to presume
they will get at least one byte. So this could lead to an infinite loop in
MS-ZIP and Quantum. An infinite loop has definitely been seen in MS-ZIP -
there is a while loop in inflate() of an uncompressed block (block type 0)
which won't end until enough input is provided.

Partial solution: change "if (read < 0)" to "if (read <= 0)" in mszipd.c and
qtmd.c.
- http://libmspack.svn.sourceforge.net/viewvc/libmspack?view=revision&revision=90

However, this breaks compatibility with a number of MS-ZIP/Quantum encoded
files. A full solution would be to implement the same bit-reading system as
LZX. I've done this now, merging all the bit-reading and huffman-reading
code into two new files; readbits.h and readhuff.h
- http://libmspack.svn.sourceforge.net/viewvc/libmspack?view=revision&revision=95

There are several further changes made to integrate readbits.h and readhuff.h,
I recommend you look at the latest version in the source repository.
- http://libmspack.svn.sourceforge.net/viewvc/libmspack/libmspack/trunk/mspack/

Bug 2: Segmentation fault in "cabextract -t"

This bug may not affect you, depending on your implementation of
mspack_system->write(). It does cause a segfault in cabextract's
cabx_write() in "-t" (test archive) mode.

In the Quantum decoder, when the window wrap is reached, all currently
unwritten data is flushed to disk. Sometimes, less data is needed than
is flushed, which makes the variable out_bytes negative.

When the main decoding loop finishes, a final call to write() is made if
out_bytes is not zero. In that situation, it calls mspack_system->write() with
a negative byte count, e.g. -129 bytes. You should reject this. In
cabextract's "-t" mode, this is not caught, but instead converted to an
unsigned integer and passed to md5_process_bytes(), which tries to
read e.g. 4294967167 bytes, causing it to read beyond the end of
valid process space and thus segfault.

Solution:
- Break out to the end of the decoding loop immediately if the flush would be more than needed.
   http://libmspack.svn.sourceforge.net/viewvc/libmspack/libmspack/trunk/mspack/qtmd.c?r1=114&r2=113
- Add checking of the "bytes" argument in mspack_system read() / write() implementations, just to be sure.
   http://libmspack.svn.sourceforge.net/viewvc/libmspack?view=revision&revision=118

Security:	SA40719 [1]
@
text
@d9 1
a9 1
PORTVERSION=	1.3
@


1.19
log
@- Remove USE_GETOPT_LONG which is a no-op since March 2007
@
text
@d9 1
a9 1
PORTVERSION=	1.2
d28 1
@


1.18
log
@Update MASTER_SITE and description to point to the new home page.

Submitted by:	Stuart Caie (author)
@
text
@a15 1
USE_GETOPT_LONG=	yes
@


1.17
log
@- Update to 1.2
- Remove unnecessary patch
- Style

Approved by:	erwin (mentor)
@
text
@d11 1
a11 1
MASTER_SITES=	http://www.kyz.uklinux.net/downloads/
@


1.16
log
@Change my e-mail address.

Approved by:	erwin (mentor)
@
text
@d9 1
a9 2
PORTVERSION=	1.1
PORTREVISION=	1
d21 1
a21 2
PORTDOCS=	magic wince_cab_format.html wince_info wince_rename \
		AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
d23 4
d32 8
a39 6
	${INSTALL_DATA} ${WRKSRC}/doc/magic ${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/wince_cab_format.html ${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/src/wince_info ${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/src/wince_rename ${DOCSDIR}
.for i in AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
	${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
@


1.15
log
@- Don't override CONFIGURE_TARGET, it compiles without that
- Add some more PORTDOCS
- Respect MAN1PREFIX
- Bump PORTREVISION
- Take maintainership

PR:		103103
Submitted by:	Gabor Kovesdan <gabor@@FreeBSD.org>
@
text
@d14 1
a14 1
MAINTAINER=	gkovesdan@@t-hosting.hu
@


1.14
log
@At Kris's request, back out the MACHINE_ARCH spelling correction until
after 5.4-RELEASE.
@
text
@d10 1
d14 1
a14 1
MAINTAINER=	ports@@FreeBSD.org
a18 1
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
d22 2
a23 1
PORTDOCS=	magic wince_cab_format.html wince_info wince_rename
d27 1
a27 1
	${INSTALL_MAN} ${WRKSRC}/doc/ja/cabextract.1 ${MANPREFIX}/man/ja/man1
d34 3
@


1.13
log
@Assist getting more ports working on AMD64 by obeying the
Ports Collection documentation and use 'ARCH' rather than 'MACHINE_ARCH'.
@
text
@d18 1
a18 1
CONFIGURE_TARGET=	--build=${ARCH}-portbld-freebsd${OSREL}
@


1.12
log
@Update to version 1.1.

PR:		72817
Submitted by:	KATO Tsuguru
@
text
@d18 1
a18 1
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
@


1.11
log
@- Update to version 1.0

PR:		ports/64328
Submitted by:	Ports Fury
@
text
@d9 1
a9 1
PORTVERSION=	1.0
@


1.10
log
@Use PLIST_FILES.

Reviewed by:	marcus
@
text
@d9 1
a9 2
PORTVERSION=	0.6
PORTREVISION=	1
d16 1
a16 2
PLIST_FILES=	bin/cabextract
USE_GETOPT_LONG=yes
d18 1
d20 1
d22 12
@


1.9
log
@Let be hohest: I really don't have a time now to properly maintain all
these great pieces of software, so that let others with more free time
to take over them.
@
text
@d17 1
@


1.8
log
@get rid of libgnugetopt dependency for -CURRENT,
use USE_GETOPT_LONG instead.
@
text
@d14 1
a14 1
MAINTAINER=	sobomax@@FreeBSD.org
@


1.7
log
@Clear moonlight beckons.
Requiem mors pacem pkg-comment,
And be calm ports tree.

E Nomini Patri, E Fili, E Spiritu Sancti.
@
text
@d10 1
d17 1
a17 2
LIB_DEPENDS=	gnugetopt.1:${PORTSDIR}/devel/libgnugetopt

a18 2
CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
		LDFLAGS="-L${LOCALBASE}/lib -lgnugetopt"
@


1.6
log
@Update to 0.6.

PR:		41729
Submitted by:	Ports Fury
@
text
@d14 1
@


1.5
log
@Update to 0.5.

Submitted by:	petef
@
text
@d9 1
a9 1
PORTVERSION=	0.5
d18 2
a19 2
CONFIGURE_ENV=	CPPFLAGS=-I${LOCALBASE}/include \
		LDFLAGS=-L${LOCALBASE}/lib
@


1.4
log
@Update to 0.4.
@
text
@d9 1
a9 1
PORTVERSION=	0.4
@


1.3
log
@Update to 0.3.
@
text
@d9 1
a9 1
PORTVERSION=	0.3
@


1.2
log
@Update to 0.2.
@
text
@d9 1
a9 1
PORTVERSION=	0.2
d15 2
d18 2
@


1.1
log
@Add cabextract - a program to extract Microsoft cabinet (.CAB) files.
@
text
@d9 1
a9 1
PORTVERSION=	0.1
a11 2
EXTRACT_SUFX=	.c.gz
EXTRACT_ONLY=
d15 1
a15 1
WRKSRC=		${WRKDIR}
d17 1
a17 11
SRCFILE=	${WRKSRC}/${PORTNAME}.c
PROGFILE=	${SRCFILE:S/.c$//}

post-extract:
	@@${GZIP_CMD} -d -c ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} > ${SRCFILE}

do-build:
	${CC} ${CFLAGS} -o ${PROGFILE} ${SRCFILE}

do-install:
	${INSTALL_PROGRAM} ${PROGFILE} ${PREFIX}/bin
@

