compare.c (38020) | compare.c (44303) |
---|---|
1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; 37#endif 38static const char rcsid[] = | 1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; 37#endif 38static const char rcsid[] = |
39 "$Id: compare.c,v 1.9 1998/06/09 05:02:29 imp Exp $"; | 39 "$Id: compare.c,v 1.10 1998/08/02 14:41:34 bde Exp $"; |
40#endif /* not lint */ 41 42#include <sys/param.h> 43#include <sys/stat.h> 44#include <err.h> 45#include <errno.h> 46#include <fcntl.h> 47#include <fts.h> | 40#endif /* not lint */ 41 42#include <sys/param.h> 43#include <sys/stat.h> 44#include <err.h> 45#include <errno.h> 46#include <fcntl.h> 47#include <fts.h> |
48#ifdef MD5 |
|
48#include <md5.h> | 49#include <md5.h> |
50#endif 51#ifdef SHA1 52#include <sha.h> 53#endif 54#ifdef RMD160 55#include <ripemd.h> 56#endif |
|
49#include <stdio.h> 50#include <time.h> 51#include <unistd.h> 52#include "mtree.h" 53#include "extern.h" 54 55extern int uflag; 56extern int lineno; --- 145 unchanged lines hidden (view full) --- 202 (void)close(fd); 203 if (s->cksum != val) { 204 LABEL; 205 (void)printf("%scksum (%lu, %lu)\n", 206 tab, s->cksum, val); 207 } 208 tab = "\t"; 209 } | 57#include <stdio.h> 58#include <time.h> 59#include <unistd.h> 60#include "mtree.h" 61#include "extern.h" 62 63extern int uflag; 64extern int lineno; --- 145 unchanged lines hidden (view full) --- 210 (void)close(fd); 211 if (s->cksum != val) { 212 LABEL; 213 (void)printf("%scksum (%lu, %lu)\n", 214 tab, s->cksum, val); 215 } 216 tab = "\t"; 217 } |
218#ifdef MD5 |
|
210 if (s->flags & F_MD5) { 211 char *new_digest, buf[33]; 212 | 219 if (s->flags & F_MD5) { 220 char *new_digest, buf[33]; 221 |
213 new_digest = MD5File(p->fts_accpath,buf); | 222 new_digest = MD5File(p->fts_accpath, buf); |
214 if (!new_digest) { 215 LABEL; 216 printf("%sMD5File: %s: %s\n", tab, p->fts_accpath, 217 strerror(errno)); 218 tab = "\t"; 219 } else if (strcmp(new_digest, s->md5digest)) { 220 LABEL; 221 printf("%sMD5 (%s, %s)\n", tab, s->md5digest, 222 new_digest); 223 tab = "\t"; 224 } 225 } | 223 if (!new_digest) { 224 LABEL; 225 printf("%sMD5File: %s: %s\n", tab, p->fts_accpath, 226 strerror(errno)); 227 tab = "\t"; 228 } else if (strcmp(new_digest, s->md5digest)) { 229 LABEL; 230 printf("%sMD5 (%s, %s)\n", tab, s->md5digest, 231 new_digest); 232 tab = "\t"; 233 } 234 } |
235#endif /* MD5 */ 236#ifdef SHA1 237 if (s->flags & F_SHA1) { 238 char *new_digest, buf[41]; |
|
226 | 239 |
240 new_digest = SHA1_File(p->fts_accpath, buf); 241 if (!new_digest) { 242 LABEL; 243 printf("%sSHA1_File: %s: %s\n", tab, p->fts_accpath, 244 strerror(errno)); 245 tab = "\t"; 246 } else if (strcmp(new_digest, s->sha1digest)) { 247 LABEL; 248 printf("%sSHA-1 (%s, %s)\n", tab, s->sha1digest, 249 new_digest); 250 tab = "\t"; 251 } 252 } 253#endif /* SHA1 */ 254#ifdef RMD160 255 if (s->flags & F_RMD160) { 256 char *new_digest, buf[41]; 257 258 new_digest = RIPEMD160_File(p->fts_accpath, buf); 259 if (!new_digest) { 260 LABEL; 261 printf("%sRIPEMD160_File: %s: %s\n", tab, 262 p->fts_accpath, strerror(errno)); 263 tab = "\t"; 264 } else if (strcmp(new_digest, s->rmd160digest)) { 265 LABEL; 266 printf("%sRIPEMD160 (%s, %s)\n", tab, s->rmd160digest, 267 new_digest); 268 tab = "\t"; 269 } 270 } 271#endif /* RMD160 */ 272 |
|
227 if (s->flags & F_SLINK && strcmp(cp = rlink(name), s->slink)) { 228 LABEL; 229 (void)printf("%slink ref (%s, %s)\n", tab, cp, s->slink); 230 } 231 return (label); 232} 233 234char * --- 61 unchanged lines hidden --- | 273 if (s->flags & F_SLINK && strcmp(cp = rlink(name), s->slink)) { 274 LABEL; 275 (void)printf("%slink ref (%s, %s)\n", tab, cp, s->slink); 276 } 277 return (label); 278} 279 280char * --- 61 unchanged lines hidden --- |