From d85f5ecfaad9b400f1990b0ac5aa7ef83e50fe20 Mon Sep 17 00:00:00 2001 From: kili Date: Thu, 4 Jan 2007 23:38:23 +0000 Subject: [PATCH] Update to 2.1. Also, change maintainer's address. From maintainer (Lawrence Teo). ok, steven@ --- archivers/rzip/Makefile | 8 +++--- archivers/rzip/distinfo | 8 +++--- archivers/rzip/patches/patch-main_c | 44 ++++++++++++++++------------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/archivers/rzip/Makefile b/archivers/rzip/Makefile index 82ddf2e3f90..5293898176b 100644 --- a/archivers/rzip/Makefile +++ b/archivers/rzip/Makefile @@ -1,13 +1,13 @@ -# $OpenBSD: Makefile,v 1.3 2006/02/14 10:18:37 steven Exp $ +# $OpenBSD: Makefile,v 1.4 2007/01/04 23:38:23 kili Exp $ COMMENT= "file compressor with a high compression ratio" -DISTNAME= rzip-2.0 -PKGNAME= ${DISTNAME}p0 +DISTNAME= rzip-2.1 +PKGNAME= ${DISTNAME} CATEGORIES= archivers HOMEPAGE= http://rzip.samba.org/ -MAINTAINER= Lawrence Teo +MAINTAINER= Lawrence Teo # GPL PERMIT_PACKAGE_CDROM= Yes diff --git a/archivers/rzip/distinfo b/archivers/rzip/distinfo index 10dd82a2f17..63d66a7b000 100644 --- a/archivers/rzip/distinfo +++ b/archivers/rzip/distinfo @@ -1,4 +1,4 @@ -MD5 (rzip-2.0.tar.gz) = 8a88b445afba919b122a3899d6d26b2a -RMD160 (rzip-2.0.tar.gz) = a3bc1bb5afe9025ec53cc03bf5f55d65728c0529 -SHA1 (rzip-2.0.tar.gz) = 65d3d95689d14a6fb3b7c805768bf34868de5c17 -SIZE (rzip-2.0.tar.gz) = 42699 +MD5 (rzip-2.1.tar.gz) = 0a3ba55085661647c12f2b014c51c406 +RMD160 (rzip-2.1.tar.gz) = 7ef5299cd526c8c49a779e050ad515a53180c1c5 +SHA1 (rzip-2.1.tar.gz) = efeafc7a5bdd7daa0cea8d797ff21aa28bdfc8d9 +SIZE (rzip-2.1.tar.gz) = 46785 diff --git a/archivers/rzip/patches/patch-main_c b/archivers/rzip/patches/patch-main_c index 3bcd64ebaf2..9fff7b6094a 100644 --- a/archivers/rzip/patches/patch-main_c +++ b/archivers/rzip/patches/patch-main_c @@ -1,7 +1,7 @@ -$OpenBSD: patch-main_c,v 1.1.1.1 2005/03/30 00:02:08 naddy Exp $ ---- main.c.orig Thu Feb 12 01:01:08 2004 -+++ main.c Tue Mar 29 22:53:26 2005 -@@ -50,7 +50,7 @@ static void write_magic(int fd_in, int f +$OpenBSD: patch-main_c,v 1.2 2007/01/04 23:38:23 kili Exp $ +--- main.c.orig Mon Feb 13 19:38:23 2006 ++++ main.c Mon Jan 1 18:26:21 2007 +@@ -51,7 +51,7 @@ static void write_magic(int fd_in, int f uint32_t v; memset(magic, 0, sizeof(magic)); @@ -10,11 +10,7 @@ $OpenBSD: patch-main_c,v 1.1.1.1 2005/03/30 00:02:08 naddy Exp $ magic[4] = RZIP_MAJOR_VERSION; magic[5] = RZIP_MINOR_VERSION; -@@ -127,9 +127,13 @@ static void decompress_file(struct rzip_ - { - int fd_in, fd_out = -1, fd_hist = -1; - off_t expected_size; -+ size_t n; +@@ -131,6 +131,9 @@ static void decompress_file(struct rzip_ if (control->outname) { control->outfile = strdup(control->outname); @@ -24,23 +20,17 @@ $OpenBSD: patch-main_c,v 1.1.1.1 2005/03/30 00:02:08 naddy Exp $ } else { if (strlen(control->suffix) >= strlen(control->infile) || strcmp(control->suffix, -@@ -138,9 +142,12 @@ static void decompress_file(struct rzip_ - fatal("%s: unknown suffix\n", control->infile); +@@ -140,6 +143,9 @@ static void decompress_file(struct rzip_ } -- control->outfile = strndup(control->infile, -- strlen(control->infile) - -- strlen(control->suffix)); -+ n = strlen(control->infile) - strlen(control->suffix) + 1; -+ control->outfile = malloc(n); + control->outfile = strdup(control->infile); + if (control->outfile == NULL) { + fatal("Failed to allocate memory for output filename"); + } -+ strlcpy(control->outfile, control->infile, n); + control->outfile[strlen(control->infile) - strlen(control->suffix)] = 0; } - fd_in = open(control->infile,O_RDONLY); -@@ -208,6 +215,9 @@ static void compress_file(struct rzip_co +@@ -208,14 +214,19 @@ static void compress_file(struct rzip_co if (control->outname) { control->outfile = strdup(control->outname); @@ -48,5 +38,19 @@ $OpenBSD: patch-main_c,v 1.1.1.1 2005/03/30 00:02:08 naddy Exp $ + fatal("Failed to allocate memory for output filename"); + } } else { - asprintf(&control->outfile, "%s%s", control->infile, control->suffix); +- control->outfile = malloc(strlen(control->infile) + +- strlen(control->suffix) + 1); ++ size_t len; ++ ++ len = strlen(control->infile) + strlen(control->suffix) + 1; ++ control->outfile = malloc(len); + if (!control->outfile) { + fatal("Failed to allocate outfile name\n"); + } +- strcpy(control->outfile, control->infile); +- strcat(control->outfile, control->suffix); ++ strlcpy(control->outfile, control->infile, len); ++ strlcat(control->outfile, control->suffix, len); } + + fd_in = open(control->infile,O_RDONLY);