Commit Graph

35 Commits

Author SHA1 Message Date
Ed Schouten
99742a231f Change all our own code to use st_*tim instead of st_*timespec.
Also remove some local patches to diff(1) which are now unneeded.
2010-03-28 13:16:08 +00:00
Anton Berezin
b6a9d20adc Adds sha256 support. While it is a good idea to also add sha384 and
sha512, I did not do that since it is not entirely clear where "the one
true place" to hold their implementations is going to be.  Sha256 is
different since mtree already links against libmd.

Make recommended procedure for integrity checking in the manpage
consistent.

Fix a bug with -f spec1 -f spec2 comparison, which prevented
test/tes03.sh from running successfully.

Reviewed by:	phk, cperciva
2005-03-29 11:44:17 +00:00
Poul-Henning Kamp
d8e4c710eb collect all "extern bla" stuff in extern.h in order to get cross-file
type checking.  No bugs found.
2004-01-11 19:25:56 +00:00
Poul-Henning Kamp
b3e66ec9df Give mtree(8) the ability to take [two -f spec] arguments and compare
the two specifications to each other.
2003-11-05 22:26:08 +00:00
Bruce Evans
7ee49c89f7 Fixed breakage of my world in rev.1.30. #include <sys/time.h> instead of
depending on namespace pollution in <sys/stat.h> for the declarations of
struct timeval and utimes().

Fixed some style bugs in rev.1.30 and some nearby style bugs (mainly
unsorting and missing or extra blank lines).

Removed a wrong comment that was obtained from NetBSD in rev.1.14.  It said
that chflags() reset the times that were set "above" by utimes(), but
utimes wasn't "above" in FreeBSD until rev.1.30, and chflags() does't
actually reset the times.
2003-11-01 08:43:54 +00:00
Poul-Henning Kamp
671d15ef2a Make mtree's update function update the modification time too.
Submitted by:	Dan Nelson <dnelson@allantgroup.com>
PR:	53063
2003-10-31 13:39:19 +00:00
Poul-Henning Kamp
5d9f6ca65c Use vis(3) to encode/decode the target for symlinks.
Make vis(3) decode errors fatal for both symlink targets and fienames.
2003-10-30 12:03:25 +00:00
Poul-Henning Kamp
3206e56993 Remove clause 3 in the copyrights (according to permission in src/COPYRIGHT)
Remove trailing whitespace.
2003-10-21 08:27:05 +00:00
Poul-Henning Kamp
4d169ae131 Remove "register" keywords.
Use newspeak functions definitions.
2003-10-21 07:58:52 +00:00
David E. O'Brien
b728350ee6 Use __FBSDID over rcsid[]. Protect copyright[] where needed. 2003-05-03 21:06:42 +00:00
Robert Drehmel
0357726594 - Align the function prototype of the external `crc' function with
how `crc' is actually defined.
 - Remove an unnecessary `extern' variable declaration.
Data type corrections:
 - Define a variable which contains a file byte offset value as type
   off_t as required by the `crc' function.
 - Change the type of a variable carrying a CRC checksum from `u_long'
   to `uint32_t'.
 - Substitute the wrong `extern' variable declaration of `crc_total'
   by putting a correct one in the shared header extern.h.
   `crc_total' is defined as an `uint32_t', thus fixing
   incorrect mtree checksums on big-endian LP64 machines.
2003-03-13 23:35:30 +00:00
Anton Berezin
53bd74b7e9 Fix two minor mismatch reporting output errors.
Reviewed by:	phk
MFC After:		3 weeks
2003-03-13 15:14:56 +00:00
Dag-Erling Smørgrav
b3f379f65f Get rid of %qd, and unbreak Alpha build. 2002-07-15 12:17:31 +00:00
Alfred Perlstein
67d357f89b fixup for WARNS=4. 2002-07-11 18:42:53 +00:00
Alfred Perlstein
d89167b4ea de-__P() 2002-07-11 18:31:16 +00:00
Poul-Henning Kamp
016f1c3e23 Don't try to compare other attributes if the type doesn't match, it's
nothing but trouble, and no use anyway.
2000-10-06 12:48:55 +00:00
Poul-Henning Kamp
25465a047c Don't whine about modes on symlinks. 2000-10-06 12:27:36 +00:00
Poul-Henning Kamp
bd39966d9b Make the output of mtree(8) more systematic and machine readable.
The new format is:

        filename        {changed,missing,extra}
                $field expected $foo found $bar
                ...

Fix various bugs along the way:
        Don't complain about directory sizes differing.
        Correctly check flags.
2000-10-03 13:13:47 +00:00
Sheldon Hearn
82cb0dd6de Pass a useful pathname to rlink(). Many thanks to the PR originator
for all the debugging work.

PR:		21017
Reported by:	Gerhard Sittig <Gerhard.Sittig@gmx.net>
Submitted by:	Jos Backus <josb@cncdsl.com>,
2000-09-13 12:54:33 +00:00
Josef Karthauser
141d77b8cb Switch over to using the new fflagstostr and strtofflags library calls. 2000-06-17 14:19:33 +00:00
Josef Karthauser
18c0eeddf7 Historically file flags (schg, uschg, etc) have been converted from
string to u_long and back using two functions, flags_to_string and
string_to_flags, which co-existed with 'ls'.  As time has progressed
more and more other tools have used these private functions to
manipulate the file flags.

Recently I moved these functions from /usr/src/bin/ls to libutil,
but after some discussion with bde it's been decided that they
really ought to go in libc.

There are two already existing libc functions for manipulating file
modes:  setmode and getmode.  In keeping with these flags_to_string
has been renamed getflags and string_to_flags to setflags.

The manual page could probably be improved upon ;)
2000-01-27 21:17:01 +00:00
Josef Karthauser
68bc9a5737 Added support for file flags, mostly merged from the NetBSD version.
The way is now open to schg and sappnd key files and directories in
our tree.  There are recommendations in bin/15229.

PR:		bin/15229
Reviewed by:	imp, brian
1999-12-09 20:38:36 +00:00
Bill Fumerola
a590ad80ac -Wall fixes.
Submitted by:	nrahlstr
1999-09-27 00:36:03 +00:00
Peter Wemm
97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Garrett Wollman
2c2bc092fa Add support for SHA-1 and RIPEMD160, now that libmd includes them. Make
all of the hashes (including MD5) conditionalized in case we want
to turn one of them off later.
1999-02-26 18:44:56 +00:00
Bruce Evans
92f896a9cc Fixed printf format errors. 1998-08-02 14:41:34 +00:00
Warner Losh
d944ccabfc Use correct size for readlink buffer. This is the size of the
buffer -1 since readlink adds its own NUL to the end.

Inspired by: Similar changes in OpenBSD
1998-06-09 05:02:29 +00:00
Philippe Charnier
de1ef5eb94 Use err(3) instead of local redefinition. 1997-10-01 06:30:02 +00:00
Nate Williams
2514dd6975 ts_sec -> tv_sec
ts_nsec -> tv_nsec

Pointed out by:	bde
1996-09-20 04:13:44 +00:00
Poul-Henning Kamp
9010366de8 Fix to match new MD5 api, faster. 1995-07-12 09:15:15 +00:00
Rodney W. Grimes
709e8f9ae1 Remove trailing whitespace. 1995-05-30 03:57:47 +00:00
Garrett Wollman
8075d17ee2 mtree * MD5 = better security
Idea from: Dr. John T. Wroclawski
1995-02-10 03:12:42 +00:00
David Greenman
89f81043d0 Fixed bug caused by missing set of paranthesis when checking the modification
time. This caused differences in the nanosecond portion of the time to
screwup the logic and made mtree think it should compare  the modtime even
though "time" wasn't specified. The end result is that mtree couldn't deal
with procfs because procfs sets the mtime with high accuracy via microtime().
1994-09-24 16:52:42 +00:00
Rodney W. Grimes
10c4c64eb7 1. Remove commented out CFLAGS+=-DDEBUG from Makefile
2.  Clean up code so it compiles -Wall (except for sccsid's and copyright).
    This included fixing several printf formats that where not correct,
    and changing the data types of a few things.

3.  Implement new option -i that produces indented mtree output files.

4.  Implement new option -n that turns off directory comments.

5.  Only emit /set records if something has changed since the last one.
1994-09-18 21:17:40 +00:00
Rodney W. Grimes
dea673e932 BSD 4.4 Lite usr.sbin Sources 1994-05-26 05:23:31 +00:00