From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jul 9 13:50:20 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2ED7416A41C for ; Sat, 9 Jul 2005 13:50:20 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6EE3D43D53 for ; Sat, 9 Jul 2005 13:50:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j69DoI62000795 for ; Sat, 9 Jul 2005 13:50:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j69DoI7e000794; Sat, 9 Jul 2005 13:50:18 GMT (envelope-from gnats) Resent-Date: Sat, 9 Jul 2005 13:50:18 GMT Resent-Message-Id: <200507091350.j69DoI7e000794@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Vsevolod Stakhov Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADF9116A41C for ; Sat, 9 Jul 2005 13:47:07 +0000 (GMT) (envelope-from vsevolod@highsecure.ru) Received: from waterwall.inec.ru (waterwall.inec.ru [213.148.3.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id B28F743D55 for ; Sat, 9 Jul 2005 13:47:04 +0000 (GMT) (envelope-from vsevolod@highsecure.ru) Received: from waterwall.inec.ru (root@localhost) by waterwall.inec.ru (8.13.1/8.12.6) with SMTP id j69Dm5bf078863 for ; Sat, 9 Jul 2005 17:48:05 +0400 (MSD) Received: from core (postbox.inec.ru [213.148.3.226]) by waterwall.inec.ru (8.13.1/8.12.6) with ESMTP id j69Dm5t0078858 for ; Sat, 9 Jul 2005 17:48:05 +0400 (MSD) Received: from [213.219.249.64] (helo=spray.anyhost.ru) by core with esmtp (Exim 4.51 (FreeBSD)) id 1DrFfU-000HHq-3a for FreeBSD-gnats-submit@freebsd.org; Sat, 09 Jul 2005 17:46:56 +0400 Received: from cebka by spray.anyhost.ru with local (Exim 4.51 (FreeBSD)) id 1DrFfC-0005Nt-Du for FreeBSD-gnats-submit@freebsd.org; Sat, 09 Jul 2005 17:46:38 +0400 Message-Id: Date: Sat, 09 Jul 2005 17:46:38 +0400 From: Vsevolod Stakhov Sender: Vsevolod Stakhov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/83181: Update port: security/rdigest to be up to date with digest X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Vsevolod Stakhov List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jul 2005 13:50:20 -0000 >Number: 83181 >Category: ports >Synopsis: Update port: security/rdigest to be up to date with digest >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sat Jul 09 13:50:17 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Vsevolod Stakhov >Release: FreeBSD 5.4-RELEASE i386 >Organization: >Environment: >Description: Update to latest NetBSD snapshot. Make changes to Makefile to be up to date to the last security/digest PR. >How-To-Repeat: >Fix: diff -ruPN rdigest.orig/Makefile rdigest/Makefile --- rdigest.orig/Makefile Sat Jul 9 17:43:09 2005 +++ rdigest/Makefile Sat Jul 9 17:43:36 2005 @@ -9,6 +9,8 @@ COMMENT= Recursive message digest wrapper utility +DISTNAME= digest-${PORTVERSION} + DESCR= ${.CURDIR}/pkg-descr CONFLICTS= # none diff -ruPN rdigest.orig/files/patch-aa rdigest/files/patch-aa --- rdigest.orig/files/patch-aa Sat Jul 9 17:43:09 2005 +++ rdigest/files/patch-aa Sat Jul 9 17:43:36 2005 @@ -1,8 +1,8 @@ -$NetBSD: patch-aa,v 1.1.1.1 2003/07/24 05:21:05 atatat Exp $ +$NetBSD: patch-aa,v 1.2 2005/03/28 20:52:55 agc Exp $ ---- Makefile.in.orig 2002-12-20 23:06:12.000000000 -0500 -+++ Makefile.in -@@ -56,7 +56,7 @@ missing mkinstalldirs regress.sh +--- Makefile.in.orig 2005-03-28 21:39:38.000000000 +0100 ++++ Makefile.in 2005-03-28 21:41:02.000000000 +0100 +@@ -57,7 +57,7 @@ .c.o: $(COMPILE) -c $< -o $@ @@ -11,7 +11,7 @@ digest-types.h: bits ./bits digest-types.h -@@ -64,10 +64,10 @@ digest-types.h: bits +@@ -65,10 +65,10 @@ bits: bits.o $(LINK) $(bits_OBJS) $(LIBS) @@ -24,8 +24,8 @@ @SHELL@ $(srcdir)/regress.sh digest.o: digest-types.h -@@ -81,7 +81,7 @@ sha1.o: digest-types.h - sha1hl.o: digest-types.h +@@ -84,7 +84,7 @@ + whirlpool.o: digest-types.h clean: - rm -f *.o digest bits digest-types.h @@ -33,7 +33,7 @@ distclean: clean rm -f Makefile config.h -@@ -90,18 +90,18 @@ distclean: clean +@@ -93,18 +93,18 @@ maintainer-clean: distclean rm -f configure config.h.in diff -ruPN rdigest.orig/files/patch-ab rdigest/files/patch-ab --- rdigest.orig/files/patch-ab Sat Jul 9 17:43:09 2005 +++ rdigest/files/patch-ab Sat Jul 9 17:43:36 2005 @@ -1,14 +1,20 @@ -$NetBSD: patch-ab,v 1.1.1.1 2003/07/24 05:21:07 atatat Exp $ +$NetBSD: patch-ab,v 1.3 2005/03/31 05:02:24 atatat Exp $ ---- digest.1.orig 2002-02-16 15:24:32.000000000 -0500 +--- digest.1.orig 2005-03-30 23:40:39.000000000 -0500 +++ digest.1 -@@ -31,21 +31,29 @@ - .\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +@@ -2,5 +2,5 @@ .\" .\" --.Dd February 28, 2001 +-.\" Copyright (c) 2001 Alistair G. Crooks. All rights reserved. ++.\" Copyright (c) 2001-2005 Alistair G. Crooks. All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without +@@ -32,12 +32,13 @@ + .\" + .\" +-.Dd March 23, 2005 -.Dt DIGEST 1 -+.Dd July 24, 2003 ++.Dd March 31, 2005 +.Dt RDIGEST 1 .Os .Sh NAME @@ -21,7 +27,7 @@ +.Op Fl x Ar directory .Ar algorithm .Op file ... - .Sh DESCRIPTION +@@ -45,6 +46,13 @@ The .Nm -utility calculates message digests of files or, @@ -36,42 +42,37 @@ +.Pp The list of possible algorithms is: .Bl -tag -width Ds - .It md5 -@@ -81,11 +89,32 @@ algorithm implementations, which are loc +@@ -89,4 +97,23 @@ algorithm implementations, which are loc C library, and was designed to be scalable as new message digest algorithms are developed. - .Pp +The checksum for a directory is implemented as the hash over a list of +one or two hashes for each of the items in the tree. +.Bl -bullet +.It +For a file, the string -+.Li Dq f \& ++.Dq f \& +along with the path make up the data for one hash, and the contents of +the file is used for the second hash. +.It +For a symbolic link, the string -+.Li Dq l \& ++.Dq l \& +along with the path to the symbolic link make up the data for one +hash, and the target of the symbolic link is used for the second hash. +.It +For a directory, the string -+.Li Dq d \& ++.Dq d \& +along with the path make up the data for one hash. +There is no second hash for a directory. +.El -+.Pp + .Pp The - .Nm - utility exits 0 on success, and >0 if an error occurs. +@@ -95,4 +122,5 @@ utility exits 0 on success, and \*[Gt]0 .Sh SEE ALSO .Xr cksum 1 , +.Xr digest 1 , .Xr md5 3 , .Xr rmd160 3 , - .Xr sha1 3 -@@ -93,9 +122,13 @@ utility exits 0 on success, and >0 if an - The +@@ -102,8 +130,12 @@ The .Nm utility first appeared in -.Nx 1.6 . diff -ruPN rdigest.orig/files/patch-ac rdigest/files/patch-ac --- rdigest.orig/files/patch-ac Sat Jul 9 17:43:09 2005 +++ rdigest/files/patch-ac Sat Jul 9 17:43:36 2005 @@ -1,6 +1,6 @@ -$NetBSD: patch-ac,v 1.1.1.1 2003/07/24 05:21:07 atatat Exp $ +$NetBSD: patch-ac,v 1.2 2005/01/21 02:18:23 tv Exp $ ---- digest.c.orig 2003-07-23 20:27:09.000000000 -0400 +--- digest.c.orig 2005-01-20 21:10:03.000000000 -0500 +++ digest.c @@ -43,9 +43,14 @@ __RCSID("$NetBSD: digest.c,v 1.8 2003/07 #endif @@ -17,7 +17,7 @@ #ifdef HAVE_LOCALE_H #include #endif -@@ -147,21 +152,172 @@ digest_file(char *fn, alg_t *alg) +@@ -147,21 +152,178 @@ digest_file(char *fn, alg_t *alg) return (rc); } @@ -26,7 +26,7 @@ + const char *p; +}; + -+LIST_HEAD(, excl) excl = LIST_HEAD_INITIALIZER(excl); ++LIST_HEAD(, excl) excl; + +static void +exclude(const char *p) @@ -43,7 +43,11 @@ +{ + struct excl *e; + ++#ifdef LIST_FOREACH + LIST_FOREACH(e, &excl, n) ++#else ++ for (e = excl.lh_first; e; e = e->n.le_next) ++#endif + if (strcmp(e->p, p) == 0) + return (1); + @@ -175,6 +179,8 @@ int rval; int i; + struct stat st; ++ ++ LIST_INIT(&excl); #ifdef HAVE_SETLOCALE (void) setlocale(LC_ALL, ""); @@ -191,7 +197,7 @@ } } argc -= optind; -@@ -186,7 +342,9 @@ main(int argc, char **argv) +@@ -186,7 +348,9 @@ main(int argc, char **argv) } } else { for (i = 0 ; i < argc ; i++) { diff -ruPN rdigest.orig/pkg-descr rdigest/pkg-descr --- rdigest.orig/pkg-descr Sat Jul 9 17:43:09 2005 +++ rdigest/pkg-descr Sat Jul 9 17:43:36 2005 @@ -1,8 +1,6 @@ -This utility is a wrapper for the md5(3), sha1(3) and rmd160(3) -routines. - -It is remarkably similar to the digest package, except that it -can recursively checksum directory trees. +This utility is a wrapper for the md5(3), sha1(3), rmd160(3), and +tiger hash routines. It is remarkably similar to the digest package, +except that it can recursively checksum directory trees. While a simple checksum on a tar file is usually satisfactory, once said archive has been extracted, it is virtually impossible to @@ -11,37 +9,8 @@ changes in file ordering within directories can affect the checksum of the archive, while not really impacting the actual code at all. -The algorithm used to checksum a directory in this implementation is -as follows: - - cd into directory - initialize MASTER_HASH - walk directory tree, sorting all entries - foreach entry - if it is a directory: - skip it if it is named "RCS", "CVS", or "SCCS" - initialize SLAVE_HASH - add the string "d " into SLAVE_HASH - add the pathname of the directory into SLAVE_HASH - finish SLAVE_HASH - fold the hexified SLAVE_HASH result into MASTER_HASH - if it is a file: - initialize SLAVE_HASH - add the string "f " into SLAVE_HASH - add the pathname of the file into SLAVE_HASH - finish SLAVE_HASH - fold the hexified SLAVE_HASH result into MASTER_HASH - initialize SLAVE_HASH - add the contents of the file into SLAVE_HASH - finish SLAVE_HASH - fold the hexified SLAVE_HASH result into MASTER_HASH - if it is a symbolic link - initialize SLAVE_HASH - add the string "l " into SLAVE_HASH - add the pathname of the link into SLAVE_HASH - finish SLAVE_HASH - fold the hexified SLAVE_HASH result into MASTER_HASH - initialize SLAVE_HASH - add the contents of the link into SLAVE_HASH - finish SLAVE_HASH - fold the hexified SLAVE_HASH result into MASTER_HASH +The algorithm used to checksum a directory in this implementation +is considers only the files' pathnames, the files' types (ie, +directory vs. file vs. symbolic link), and their contents (for +the latter two). It is described in greater detail in the man +page. >Release-Note: >Audit-Trail: >Unformatted: