ports/83181: Update port: security/rdigest to be up to date with digest

Vsevolod Stakhov vsevolod at highsecure.ru
Sat Jul 9 13:50:20 UTC 2005


>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 <locale.h>
  #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:



More information about the freebsd-ports-bugs mailing list