create.c (124389) | create.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[] = "@(#)create.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[] = "@(#)create.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/create.c 124389 2004-01-11 19:38:48Z phk $"); | 36__FBSDID("$FreeBSD: head/usr.sbin/mtree/create.c 144295 2005-03-29 11:44:17Z tobez $"); |
37 38#include <sys/param.h> 39#include <sys/stat.h> 40#include <dirent.h> 41#include <err.h> 42#include <errno.h> 43#include <fcntl.h> 44#include <fts.h> 45#include <grp.h> 46#ifdef MD5 47#include <md5.h> 48#endif 49#ifdef SHA1 50#include <sha.h> 51#endif 52#ifdef RMD160 53#include <ripemd.h> 54#endif | 37 38#include <sys/param.h> 39#include <sys/stat.h> 40#include <dirent.h> 41#include <err.h> 42#include <errno.h> 43#include <fcntl.h> 44#include <fts.h> 45#include <grp.h> 46#ifdef MD5 47#include <md5.h> 48#endif 49#ifdef SHA1 50#include <sha.h> 51#endif 52#ifdef RMD160 53#include <ripemd.h> 54#endif |
55#ifdef SHA256 56#include <sha256.h> 57#endif |
|
55#include <pwd.h> 56#include <stdint.h> 57#include <stdio.h> 58#include <time.h> 59#include <unistd.h> 60#include <vis.h> 61#include "mtree.h" 62#include "extern.h" --- 181 unchanged lines hidden (view full) --- 244 char *digest, buf[41]; 245 246 digest = RIPEMD160_File(p->fts_accpath, buf); 247 if (!digest) 248 err(1, "%s", p->fts_accpath); 249 output(indent, &offset, "ripemd160digest=%s", digest); 250 } 251#endif /* RMD160 */ | 58#include <pwd.h> 59#include <stdint.h> 60#include <stdio.h> 61#include <time.h> 62#include <unistd.h> 63#include <vis.h> 64#include "mtree.h" 65#include "extern.h" --- 181 unchanged lines hidden (view full) --- 247 char *digest, buf[41]; 248 249 digest = RIPEMD160_File(p->fts_accpath, buf); 250 if (!digest) 251 err(1, "%s", p->fts_accpath); 252 output(indent, &offset, "ripemd160digest=%s", digest); 253 } 254#endif /* RMD160 */ |
255#ifdef SHA256 256 if (keys & F_SHA256 && S_ISREG(p->fts_statp->st_mode)) { 257 char *digest, buf[65]; 258 259 digest = SHA256_File(p->fts_accpath, buf); 260 if (!digest) 261 err(1, "%s", p->fts_accpath); 262 output(indent, &offset, "sha256digest=%s", digest); 263 } 264#endif /* SHA256 */ |
|
252 if (keys & F_SLINK && 253 (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) 254 output(indent, &offset, "link=%s", rlink(p->fts_accpath)); 255 if (keys & F_FLAGS && p->fts_statp->st_flags != flags) { 256 fflags = flags_to_string(p->fts_statp->st_flags); 257 output(indent, &offset, "flags=%s", fflags); 258 free(fflags); 259 } --- 156 unchanged lines hidden --- | 265 if (keys & F_SLINK && 266 (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) 267 output(indent, &offset, "link=%s", rlink(p->fts_accpath)); 268 if (keys & F_FLAGS && p->fts_statp->st_flags != flags) { 269 fflags = flags_to_string(p->fts_statp->st_flags); 270 output(indent, &offset, "flags=%s", fflags); 271 free(fflags); 272 } --- 156 unchanged lines hidden --- |