Deleted Added
full compact
compare.c (124387) compare.c (144295)
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

--- 19 unchanged lines hidden (view full) ---

28 */
29
30#if 0
31#ifndef lint
32static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
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

--- 19 unchanged lines hidden (view full) ---

28 */
29
30#if 0
31#ifndef lint
32static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/usr.sbin/mtree/compare.c 124387 2004-01-11 19:25:56Z phk $");
36__FBSDID("$FreeBSD: head/usr.sbin/mtree/compare.c 144295 2005-03-29 11:44:17Z tobez $");
37
38#include <sys/param.h>
39#include <sys/stat.h>
40#include <sys/time.h>
41
42#include <err.h>
43#include <errno.h>
44#include <fcntl.h>
45#include <fts.h>
46#ifdef MD5
47#include <md5.h>
48#endif
49#ifdef RMD160
50#include <ripemd.h>
51#endif
52#ifdef SHA1
53#include <sha.h>
54#endif
37
38#include <sys/param.h>
39#include <sys/stat.h>
40#include <sys/time.h>
41
42#include <err.h>
43#include <errno.h>
44#include <fcntl.h>
45#include <fts.h>
46#ifdef MD5
47#include <md5.h>
48#endif
49#ifdef RMD160
50#include <ripemd.h>
51#endif
52#ifdef SHA1
53#include <sha.h>
54#endif
55#ifdef SHA256
56#include <sha256.h>
57#endif
55#include <stdint.h>
56#include <stdio.h>
57#include <time.h>
58#include <unistd.h>
59#include <vis.h>
60
61#include "mtree.h"
62#include "extern.h"

--- 226 unchanged lines hidden (view full) ---

289 } else if (strcmp(new_digest, s->rmd160digest)) {
290 LABEL;
291 printf("%sRIPEMD160 expected %s found %s\n",
292 tab, s->rmd160digest, new_digest);
293 tab = "\t";
294 }
295 }
296#endif /* RMD160 */
58#include <stdint.h>
59#include <stdio.h>
60#include <time.h>
61#include <unistd.h>
62#include <vis.h>
63
64#include "mtree.h"
65#include "extern.h"

--- 226 unchanged lines hidden (view full) ---

292 } else if (strcmp(new_digest, s->rmd160digest)) {
293 LABEL;
294 printf("%sRIPEMD160 expected %s found %s\n",
295 tab, s->rmd160digest, new_digest);
296 tab = "\t";
297 }
298 }
299#endif /* RMD160 */
300#ifdef SHA256
301 if (s->flags & F_SHA256) {
302 char *new_digest, buf[65];
297
303
304 new_digest = SHA256_File(p->fts_accpath, buf);
305 if (!new_digest) {
306 LABEL;
307 printf("%sSHA-256: %s: %s\n", tab, p->fts_accpath,
308 strerror(errno));
309 tab = "\t";
310 } else if (strcmp(new_digest, s->sha256digest)) {
311 LABEL;
312 printf("%sSHA-256 expected %s found %s\n",
313 tab, s->sha256digest, new_digest);
314 tab = "\t";
315 }
316 }
317#endif /* SHA256 */
318
298 if (s->flags & F_SLINK &&
299 strcmp(cp = rlink(p->fts_accpath), s->slink)) {
300 LABEL;
301 (void)printf("%slink_ref expected %s found %s\n",
302 tab, s->slink, cp);
303 }
304 return (label);
305}

--- 62 unchanged lines hidden ---
319 if (s->flags & F_SLINK &&
320 strcmp(cp = rlink(p->fts_accpath), s->slink)) {
321 LABEL;
322 (void)printf("%slink_ref expected %s found %s\n",
323 tab, s->slink, cp);
324 }
325 return (label);
326}

--- 62 unchanged lines hidden ---