summaryrefslogtreecommitdiff
path: root/usr.sbin/mtree/compare.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-07-18 05:46:15 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-07-18 05:46:15 +0000
commit746f76d401703e14909551c837fbeb052487791d (patch)
treecce7faa22238eff99cdfcdd5ddb57c3a2ea05422 /usr.sbin/mtree/compare.c
parent6d5a8c2c7cc9516711cea7f6f9e9740c550d645e (diff)
Add rmd160 support. Sheesh, you'd think this was tripwire.
Diffstat (limited to 'usr.sbin/mtree/compare.c')
-rw-r--r--usr.sbin/mtree/compare.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/usr.sbin/mtree/compare.c b/usr.sbin/mtree/compare.c
index accef0a0177..16ab1d9494c 100644
--- a/usr.sbin/mtree/compare.c
+++ b/usr.sbin/mtree/compare.c
@@ -1,5 +1,5 @@
/* $NetBSD: compare.c,v 1.11 1996/09/05 09:56:48 mycroft Exp $ */
-/* $OpenBSD: compare.c,v 1.7 1997/07/12 23:05:34 millert Exp $ */
+/* $OpenBSD: compare.c,v 1.8 1997/07/18 05:46:11 millert Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: compare.c,v 1.7 1997/07/12 23:05:34 millert Exp $";
+static char rcsid[] = "$OpenBSD: compare.c,v 1.8 1997/07/18 05:46:11 millert Exp $";
#endif
#endif /* not lint */
@@ -52,6 +52,7 @@ static char rcsid[] = "$OpenBSD: compare.c,v 1.7 1997/07/12 23:05:34 millert Exp
#include <unistd.h>
#include <md5.h>
#include <sha1.h>
+#include <rmd160.h>
#include "mtree.h"
#include "extern.h"
@@ -242,6 +243,22 @@ typeerr: LABEL;
tab = "\t";
}
}
+ if (s->flags & F_RMD160) {
+ char *new_digest, buf[41];
+
+ new_digest = RMD160File(p->fts_accpath, buf);
+ if (!new_digest) {
+ LABEL;
+ printf("%sRMD160File: %s: %s\n", tab, p->fts_accpath,
+ strerror(errno));
+ tab = "\t";
+ } else if (strcmp(new_digest, s->rmd160digest)) {
+ LABEL;
+ printf("%sRMD160 (%s, %s)\n", tab, s->rmd160digest,
+ new_digest);
+ tab = "\t";
+ }
+ }
if (s->flags & F_SHA1) {
char *new_digest, buf[41];