source: scripts/untested/blfs-patches/ncompress_4.2.4-15.patch@ fdfb73b

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since fdfb73b was 16fbfc51, checked in by Jim Gifford <clfs@…>, 19 years ago

r575@server (orig r573): ryan | 2005-06-09 08:51:24 -0700
Add ncompress build script


gcc-3.4 fixes patch is from gentoo
ncompress_4.2.4-15 patch (add bounds checking to fix buffer overflow) from
debian



  • Property mode set to 100644
File size: 19.8 KB
  • debian/README.debian

    Submitted By: Ryan Oliver <ryan.oliver@pha.com.au>
    Date: 2005-06-08
    Initial Package Version: 4.2.4
    Upstream Status: Unknown
    Origin: Debian 
       http://ftp.debian.org/debian/pool/main/n/ncompress/ncompress_4.2.4-15.diff.gz
    Description: Add bounds checking to fix buffer overflow
    
    old new  
     1General Notes
     2-------------
     3
     4In this package, 'uncompress' is installed as 'uncompress.real' to avoid
     5conflict with the gzip package.  Most of the utility scripts distributed with
     6the source code (zdiff, zmore, zcmp) are not installed.
     7
     8The uncompress.real program installed to /usr/bin is just a symlink to the
     9compress program.  Same goes for the uncompress.real manpage in
     10/usr/share/man/man1.
     11
     12Please note that this version of ncompress does not support files larger than
     132GB.  I have toyed with increasing this limit, but I haven't been overly
     14successful.  It looks to be possible to increase the limit up to 4GB, but
     15that's still an arbitrary limit, and given my level of understanding of this
     16code, I'm leery of doing it for no real gain.  If you need support for very
     17large files, I suggest using gzip rather than compress.
     18
     19Also, note that prior to fixing bug #220820 (in November of 2003, version
     204.2.4-13), there was a data-corruption bug with 'compress -b9'.  If you created
     21files using -b9 (maxbits of 9) prior to this version, your file was probably
     22corrupted, and you will only be able to recover parts of it.  I have "fixed"
     23this bug by disallowing maxbits less than 10.  The uncompress.real program will
     24still decompress 9-bit files created by other compress programs (such as the
     25ones from Solaris or AIX) but the compress program will not create 9-bit files.
     26
     27This package was moved to main in August of 2004.  Prior to that, it was kept
     28out of main because it implements the patented LZW algorithm.  The consensus is
     29that patents on that algorithm have expired as of July 2004.
     30
     31
     32Upstream Source Code
     33--------------------
     34
     35Christoph apparently downloaded the original tarball from:
     36
     37   ftp://sunsite.unc.edu/pub/linux/utils/compress/ncompress-4.2.4.tar.Z
     38
     39In the meantime, however, sunsite.unc.edu has disappeared, and has been
     40replaced by ibiblio.org, so the current URL is:
     41
     42   ftp://ftp.ibiblio.org/pub/linux/utils/compress/ncompress-4.2.4.tar.Z
     43
     44This probably doesn't matter much at all, since there hasn't been a new
     45"upstream" release in more than 10 years.  In any case, the contents of the
     46packgae orig.tar.gz file match exactly with the contents of the file currently
     47on ibiblio.org.
     48
     49
     50Copyright and Patent Discussion
     51-------------------------------
     52
     53The following article is from James A. Woods, one of the earlier authors of
     54compress.  The article discusses the Unisys patent on the LZW compression
     55method, and how that affects ncompress.
     56
     57From uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!wuarchive!usc!ucsd!ucbvax!agate!riacs!jaw Wed Aug  1 15:06:59 EDT 1990
     58Article: 1282 of gnu.misc.discuss
     59Path: alembic!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!wuarchive!usc!ucsd!ucbvax!agate!riacs!jaw
     60From: jaw@riacs.edu (James A. Woods)
     61Newsgroups: gnu.misc.discuss
     62Subject: Sperry patent #4,558,302 does *not* affect 'compress'
     63Keywords: data compression, algorithm, patent
     64Message-ID: <1990Jul31.220935.1424@riacs.edu>
     65Date: 31 Jul 90 22:09:35 GMT
     66Organization: RIACS, NASA Ames Research Center
     67Lines: 69
     68
     69#  "The chief defect of Henry King
     70    Was chewing little bits of string."
     71
     72        -- Hilaire Belloc, Cautionary Tales [1907]
     73
     74     As a co-author of 'compress' who has had contact with an attorney for
     75Unisys (nee Sperry), I would like to relay a very basic admission from Unisys
     76that noncommercial use of 'compress' is perfectly legal.  'Compress' is also
     77commercially distributed by AT&T as part of Unix System 5 release 4,
     78with no further restrictions placed upon the use of the binary, as far
     79as I am aware.
     80
     81     From conversations with Professor Abraham Lempel and others, it
     82appears that neither AT&T, Sun Microsystems, Hewlett Packard, nor IBM
     83are paying any sort of license fees to Unisys in conjunction with patent
     84#4,558,302.  It may be true that some organizations are paying fees for
     85data compression technology licensed from one or more of the many holders
     86of compression patents, but this is all independent from 'compress'.
     87
     88     In particular, I received a letter at NASA dated October 1, 1987 from
     89John B. Sowell of the Unisys law department, informing me for the first
     90time that some form of LZW was patented.  I naturally expressed
     91skepticism that an algorithm could be patented (a murky legal area
     92which remains so), stated that 'compress' is not identical to LZW,
     93and in fact was designed, developed, and distributed before the ink
     94on the patent was dry.  Several telephone conversations later, Mr. Sowell
     95intimated that they would *not* seek any fees from users of 'compress'
     96but instead were signing licensees for hardware implementations of LZW.
     97
     98     So, regardless of what you believe about a shady legal area, if anyone
     99from Unisys contacts you to extract tribute for the use of 'compress', please
     100tell them that, first, it is not theirs to begin with, and, second, there is
     101someone who will testify in court about the conversation above.
     102It is not even clear if anyone can "own" 'compress', since original developer
     103Spencer Thomas, myself, and others placed the code in the public domain
     104long before the adoption of the Berne copyright convention.
     105
     106     In light of the events above, it seems that the Free Software
     107Foundation is being unduly paranoid about the use of 'compress'.
     108Now I can well believe that FSF is more likely to be a legal target
     109than a behemoth like AT&T, but if they are simply redistributing
     110untouched free software developed years ago in the public sector,
     111I see no problem.
     112
     113     Aside:  I am investigating, possibly for a case history to be
     114recycled to USENET, the particulars of data compression patents.
     115I am aware of the following patents: IBM's Miller-Wegman LZ variant,
     116those of Telcor and ACT [losing candidates for the British Telecom modem
     117standard], James A. Storer's work on limited lookahead as explicated in his
     118text "Data Compression (methods and theory)", Computer Science Press, 1988,
     119and the various patents pending associated with the Fiala and Greene
     120CACM article of April, 1989 on textual substitution methods.
     121If you have any lore, send it this way.
     122
     123
     124
     125                    Sincerely,
     126
     127                    James A. Woods
     128                    NASA Ames Research Center (RIACS)
     129                    jaw@riacs.edu (or ames!jaw)
     130
     131
     132P.S.  The algorithm patent issue certainly is a "topic A" at the moment.
     133One useful reference is the review article by Anthony and Colwell --
     134"Litigating the Validity and Infringement of Software Patents" in
     135Washington and Lee Law Review, volume 41, fall 1984.  I know Robert Colwell
     136personally.  As a practicing patent attorney, he tells me that, at a minimum,
     137use of an invention "for research purposes" is legitimate.
     138
  • debian/changelog

    old new  
     1ncompress (4.2.4-15) unstable; urgency=low
     2
     3  * Move to main now that LZW patent has expired (closes: #261282).
     4  * Update debian/copyright to be clearer about public domain status.
     5  * Move James A. Woods letter from copyright file to README.Debian.
     6  * Move detailed location information from copyright file to README.Debian.
     7
     8 -- Kenneth J. Pronovici <pronovic@debian.org>  Wed, 25 Aug 2004 13:38:42 -0500
     9
     10ncompress (4.2.4-14) unstable; urgency=low
     11
     12  * Bumped standards version to 3.6.1 (no package changes).
     13  * Fix gcc-3.4 build problem (closes: #260723).
     14    - Add -DNOFUNCDEFS to gcc command, to prevent custom prototypes for
     15      standard functions from being used by the compiler.
     16
     17 -- Kenneth J. Pronovici <pronovic@debian.org>  Wed, 21 Jul 2004 20:49:01 -0500
     18
     19ncompress (4.2.4-13) unstable; urgency=low
     20
     21  * Disallow maxbits less than 10, to avoid data corruption (closes: #220820).
     22  * Added note in debian/README.Debian about 9-bit corruption.
     23
     24 -- Kenneth J. Pronovici <pronovic@debian.org>  Fri, 14 Nov 2003 15:47:08 -0600
     25
     26ncompress (4.2.4-12) unstable; urgency=low
     27
     28  * Upstream source changed (ibiblio.org replaced sunsite.unc.edu).
     29    - Updated debian/watch to use correct URL
     30    - Updated debian/copyright to note new download location
     31    - Updated debian/copyright to clarify packaging history
     32
     33 -- Kenneth J. Pronovici <pronovic@debian.org>  Fri, 19 Sep 2003 10:40:56 -0500
     34
     35ncompress (4.2.4-11) unstable; urgency=low
     36
     37  * Changed debian/README.debian to document (lack of) large file support.
     38  * Changed section to 'optional' in debian/control to match overrides.
     39
     40 -- Kenneth J. Pronovici <pronovic@debian.org>  Mon, 14 Apr 2003 15:34:36 -0500
     41
     42ncompress (4.2.4-10) unstable; urgency=low
     43
     44  * New maintainer (closes: #182937).
     45  * Updated debian/copyright to reflect new maintainer.
     46  * Removed local variables from debian/changelog.
     47  * Updated debian/control file.
     48    - Reflect new maintainer.
     49    - Change standards version to 3.5.9.
     50    - Update debhelper depends to (>= 4.0.2).
     51    - Rewrite and clarify short and long descriptions.
     52    - Fix spelling error in long description (closes: #125169).
     53  * Updated comments in debian/README.debian.
     54  * Brought debian/rules up to "modern" standards.
     55  * Updated debian/copyright to clarify download location.
     56  * Added debian/watch file.
     57  * Added debian/compat file at compatibility level 4.
     58  * Changed prototype of main() in compress42.c, to quiet gcc.
     59  * Updated compress.1 manpage (closes: #99585).
     60    - Reference 'uncompress.real' rather than 'uncompress'.
     61    - No longer reference zcat at all.
     62
     63 -- Kenneth J. Pronovici <pronovic@debian.org>  Mon,  7 Apr 2003 17:52:47 -0500
     64
     65ncompress (4.2.4-9.1) unstable; urgency=low
     66
     67  * NMU based on patch by Stephen Stafford <bagpuss@debian.org>:
     68    - FHS transition (closes: #91011, #91596).
     69    - Added build-depends on debhelper.
     70    - Uncommented call to dh_installdeb so the debhelper postinst and prerm
     71      files get installed with the FHS transition symlink stuff.
     72    - Bumped standards to 3.5.0.
     73
     74 -- Colin Watson <cjwatson@debian.org>  Wed, 25 Jul 2001 11:52:18 +0100
     75
     76ncompress (4.2.4-9) frozen unstable; urgency=low
     77
     78  * Upload for frozen.
     79
     80 -- Adam Klein <aklein@debian.org>  Thu,  3 Dec 1998 19:57:56 -0800
     81
     82ncompress (4.2.4-8) unstable; urgency=low
     83
     84  * No longer segfaults on long file names. (closes: #26416)
     85  * Standards version 2.5.0.0 (no changes).
     86
     87 -- Adam Klein <aklein@debian.org>  Wed,  2 Dec 1998 23:19:45 -0800
     88
     89ncompress (4.2.4-7) unstable; urgency=low
     90
     91  * Removed dh_du invocation from debian/rules
     92
     93 -- Adam Klein <aklein@debian.org>  Wed, 11 Mar 1998 23:17:13 -0500
     94
     95ncompress (4.2.4-6) unstable; urgency=low
     96
     97  * Moved exit status info to DIAGNOSTICS section (closes: #16640)
     98
     99 -- Adam Klein <aklein@debian.org>  Tue, 10 Feb 1998 21:27:56 -0800
     100
     101ncompress (4.2.4-5) unstable; urgency=low
     102
     103  * New maintainer
     104  * README.debian now mentions uncompress.real
     105  * Treat argv[0] value of "uncompress.real" as "uncompress" (closes: #16621)
     106  * Use debhelper (closes: #9674, #14503)
     107  * Control file now lists section as non-free/utils
     108  * Use standards version 2.4.0.0
     109
     110 -- Adam Klein <aklein@debian.org>  Tue, 27 Jan 1998 09:28:38 -0800
     111
     112ncompress (4.2.4-4) unstable; urgency=low
     113
     114  * Rebuilt for hamm
     115
     116 -- Christoph Lameter <clameter@waterf.org>  Mon, 29 Sep 1997 22:38:22 -0700
     117
     118ncompress (4.2.4-3) unstable; urgency=low
     119
     120  * new Maintainer
     121
     122 -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de>  Fri,  6 Jun 1997 07:31:46 +0200
     123
     124ncompress (4.2.4-2) unstable; urgency=low
     125
     126  * install uncompress as uncompress.real since gzip maintainer did not
     127    want to use alternative and gzip already installs a link for uncompress
     128    to gzip.
     129
     130 -- Christoph Lameter <clameter@debian.org>  Mon, 30 Dec 1996 16:24:03 -0800
     131
     132ncompress (4.2.4-1) unstable; urgency=low
     133
     134  * Initial Release.
     135
     136 -- Christoph Lameter <clameter@debian.org>  Sun, 22 Dec 1996 10:14:17 -0800
     137
  • ncompress-4.2.4

    old new  
     14
  • debian/control

    old new  
     1Source: ncompress
     2Section: utils
     3Priority: optional
     4Maintainer: Kenneth J. Pronovici <pronovic@debian.org>
     5Standards-Version: 3.6.1
     6Build-Depends: debhelper (>= 4.0.2)
     7
     8Package: ncompress
     9Architecture: any
     10Depends: ${shlibs:Depends}
     11Description: Original Lempel-Ziv compress/uncompress programs
     12 This package provides the original programs that are the de facto standard, in
     13 much of the UNIX community, for compressing and uncompressing files.  The
     14 programs implement a fast, simple LZW file compression algorithm.  The LZW
     15 algorithm does not have as high a rate of compression as some other
     16 algorithms, but LZW implementations such as this one often compress files
     17 faster than other, similar programs such as gzip.
     18 .
     19 For Debian, the standard uncompress program is installed as uncompress.real.
     20 .
     21 This package contains a copyright notice from one of the original authors in
     22 the file /usr/doc/ncompress/README.Debian.
  • debian/copyright

    old new  
     1This package was originally debianized by Christoph Lameter on 22 Dec 1996.
     2Since then, it has been maintained by Helmut Geyer, Christoph Lameter and Adam
     3Klein, and is currently maintained by Kenneth J. Pronovici <pronovic@debian.org>.
     4
     5It may be downloaded from: ftp://ftp.ibiblio.org/pub/linux/utils/compress/ncompress-4.2.4.tar.Z
     6
     7Upstream Authors: Spencer W. Thomas & James A. Woods,
     8                  Jim McKie, Steve Davies, Ken Turkowski,
     9                  Joe Orost, Dave Mack, Peter Jannesen
     10
     11Copyright:
     12
     13   Placed in the public domain by Spencer W. Thomas and James A. Woods. 
     14   See README.Debian for some more background information.
     15
  • ncompress-4.2.4

    old new  
     1usr/bin
     2usr/share/man/man1
  • ncompress-4.2.4

    old new  
     1#!/usr/bin/make -f
     2
     3binary: binary-arch
     4
     5binary-arch: build install
     6        dh_testdir
     7        dh_testroot
     8        dh_installdocs Acknowleds README
     9        dh_installchangelogs Changes
     10        dh_strip
     11        dh_fixperms
     12        dh_compress
     13        dh_installdeb
     14        dh_shlibdeps
     15        dh_gencontrol
     16        dh_md5sums
     17        dh_builddeb
     18
     19binary-indep:
     20
     21install: build
     22        dh_testdir
     23        dh_testroot
     24        dh_installdirs
     25        install -o root -g root compress debian/ncompress/usr/bin
     26        ln -s compress debian/ncompress/usr/bin/uncompress.real
     27        install -o root -g root -m 644 compress.1 debian/ncompress/usr/share/man/man1
     28        ln -s compress.1 debian/ncompress/usr/share/man/man1/uncompress.real.1
     29
     30build: build-stamp
     31build-stamp:
     32        dh_testdir
     33        gcc -O2 -g -o compress -DNOFUNCDEF -DCOMPILE_DATE="\"`date`\"" compress42.c
     34        touch build-stamp
     35
     36configure:
     37
     38clean:
     39        dh_testdir
     40        dh_testroot
     41        rm -f build-stamp
     42        rm -f compress
     43        dh_clean
     44
     45.PHONY: binary binary-arch binary-indep install build configure clean
  • ncompress-4.2.4

    old new  
     1version=2
     2ftp://ftp.ibiblio.org/pub/linux/utils/compress/ncompress-(.*)\.tar.Z    debian   uupdate
  • ncompress-4.2.4

    old new  
    11.PU
    22.TH COMPRESS 1 local
    33.SH NAME
    4 compress, uncompress, zcat \- compress and expand data (version 4.1)
     4compress, uncompress.real \- compress and expand data (version 4.2)
    55.SH SYNOPSIS
    66.ll +8
    77.B compress
     
    2323]
    2424.ll -8
    2525.br
    26 .B uncompress
     26.B uncompress.real
    2727[
    2828.B \-f
    2929] [
     
    3636.I "name \&..."
    3737]
    3838.br
    39 .B zcat
    40 [
    41 .B \-V
    42 ] [
    43 .I "name \&..."
    44 ]
    4539.SH DESCRIPTION
     40.PP
     41Note that the program that would normally be installed as
     42.I uncompress
     43is installed for Debian as
     44.I uncompress.real.
     45This has been done to avoid conflicting with the more-commonly-used
     46program with the same name that is part of the gzip package.
     47.PP
    4648.I Compress
    4749reduces the size of the named files using adaptive Lempel-Ziv coding.
    4850Whenever possible,
     
    6870the user is prompted as to whether an existing file should be overwritten.
    6971.PP
    7072Compressed files can be restored to their original form using
    71 .I uncompress
    72 or
    73 .I zcat.
     73.I uncompress.real.
    7474.PP
    75 .I uncompress
     75.I uncompress.real
    7676takes a list of files on its command line and replaces each
    7777file whose name ends with
    7878.B "\&.Z"
     
    8585The
    8686.B \-c
    8787option makes
    88 .I compress/uncompress
     88.I compress/uncompress.real
    8989write to the standard output; no files are changed.
    9090.PP
    91 .I zcat
    92 is identical to
    93 .I uncompress
    94 .B \-c.
    95 .I zcat
    96 uncompresses either a list of files on the command line or its
    97 standard input and writes the uncompressed data on standard output.
    98 .I zcat
    99 will uncompress files that have the correct magic number whether
    100 they have a
    101 .B "\&.Z"
    102 suffix or not.
    103 .PP
    10491If the
    10592.B \-r
    10693flag is specified,
     
    148135Note that the
    149136.B \-b
    150137flag is omitted for
    151 .I uncompress,
     138.I uncompress.real,
    152139since the
    153140.I bits
    154141parameter specified during compression
     
    175162option,
    176163a message is printed yielding the percentage of
    177164reduction for each file compressed.
    178 .PP
    179 Exit status is normally 0;
    180 if the last file is larger after (attempted) compression, the status is 2;
    181 if an error occurs, exit status is 1.
    182165.SH "SEE ALSO"
    183166pack(1), compact(1)
    184167.SH "DIAGNOSTICS"
     168Exit status is normally 0;
     169if the last file is larger after (attempted) compression, the status is 2;
     170if an error occurs, exit status is 1.
     171.PP
    185172Usage: compress [\-dfvcVr] [\-b maxbits] [file ...]
    186173.in +8
    187174Invalid options were specified on the command line.
     
    195182not in compressed format
    196183.in +8
    197184The file specified to
    198 .I uncompress
     185.I uncompress.real
    199186has not been compressed.
    200187.in -8
    201188.IR file :
     
    272259a small process data space (64KB or less, as exhibited by the DEC PDP
    273260series, the Intel 80286, etc.)
    274261.PP
    275 Invoking compress with a \-r
     262Invoking compress with a
     263.BR \-r
    276264flag will occasionally cause it to produce spurious error warnings of the form
    277265.PP
    278266.in 8
    279267"<filename>.Z already has .Z suffix - ignored"
    280268.in -8
    281269.PP
    282 These warnings can be ignored. See the comments in compress.c:compdir()
    283 for an explanation.
     270These warnings can be ignored. See the comments in compress42.c:compdir()
     271in the source distribution for an explanation.
    284272
  • ncompress-4.2.4

    old new  
    230230
    231231#define INIT_BITS 9                     /* initial number of bits/code */
    232232
     233#define MIN_MAXBITS 10          /* min value for -b maxbits (smaller causes corruption) */
     234
    233235#ifndef SACREDMEM
    234236        /*
    235237         * SACREDMEM is the amount of physical memory saved for others; compress
     
    638640        } ;
    639641#endif
    640642
    641 void    main                    ARGS((int,char **));
     643int     main                    ARGS((int,char **));
    642644void    Usage                   ARGS((void));
    643645void    comprexx                ARGS((char **));
    644646void    compdir                 ARGS((char *));
     
    691693 *   deterministic, and can be done on the fly.  Thus, the decompression
    692694 *   procedure needs no input table, but tracks the way the table was built.
    693695 */
    694 void
     696int
    695697main(argc, argv)
    696698        REG1    int      argc;
    697699        REG2    char    *argv[];
     
    719721                else
    720722                        progname = argv[0];
    721723
    722         if (strcmp(progname, "uncompress") == 0)
     724        if (strcmp(progname, "uncompress") == 0
     725            || strcmp(progname, "uncompress.real") == 0)
    723726                        do_decomp = 1;
    724727                else
    725728                if (strcmp(progname, "zcat") == 0)
     
    819822nextarg:        continue;
    820823        }
    821824
    822         if (maxbits < INIT_BITS)        maxbits = INIT_BITS;
     825        if (maxbits < MIN_MAXBITS)      maxbits = MIN_MAXBITS;
    823826        if (maxbits > BITS)             maxbits = BITS;
    824827
    825828        if (*filelist != NULL)
     
    883886                int             fdout;
    884887                char    tempname[MAXPATHLEN];
    885888
     889                if (strlen(*fileptr) > (MAXPATHLEN - 1)) {
     890                        fprintf(stderr, "Pathname too long: %s\n", *fileptr);
     891                        return;
     892                }
    886893                strcpy(tempname,*fileptr);
    887894                errno = 0;
    888895
Note: See TracBrowser for help on using the repository browser.