History log of /freebsd-10-stable/usr.sbin/mtree/create.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 255483 11-Sep-2013 delphij

Do not emit size for non-regular files. There is nothing that
mtree(1) can do in this situation and would cause confusion.

MFC candidate.

Approved by: re (hrs)


# 205793 28-Mar-2010 ed

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.


# 187940 31-Jan-2009 kientzle

Write timestamps with exactly 9 digits after the period.
This ensures that the value written is both compatible with
older mtree versions (which expect the value after the period
to be an integer count of nanoseconds after the whole second)
and is a correct floating-point value.

Leave the parsing code unchanged so it will continue to read
older files.


# 144295 29-Mar-2005 tobez

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


# 124389 11-Jan-2004 phk

Get rid of "lineno: 0" in error messages from create mode.

Add -w(arning) flag which makes failure to look up uid/gid
a nonfatal warning instead of an error.


# 124387 11-Jan-2004 phk

collect all "extern bla" stuff in extern.h in order to get cross-file
type checking. No bugs found.


# 124265 08-Jan-2004 phk

Do not emit comments when -n is specified.


# 122134 05-Nov-2003 phk

Take advantage of the fact that we know the err(3) function does not
return to eliminate some else clauses and gain some "outdenting".


# 121731 30-Oct-2003 phk

Fix bug in mtree(8)'s create mode where files or directories with had
names containing glob(3) expressions would appear verbatim in the
output.

If such an mtree file were used by mtree in update mode, wrong things
would happen.


# 121300 21-Oct-2003 phk

Remove clause 3 in the copyrights (according to permission in src/COPYRIGHT)
Remove trailing whitespace.


# 121299 21-Oct-2003 phk

Remove "register" keywords.
Use newspeak functions definitions.


# 114601 03-May-2003 obrien

Use __FBSDID over rcsid[]. Protect copyright[] where needed.


# 112214 13-Mar-2003 robert

- 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.


# 103726 20-Sep-2002 wollman

Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
hack, thereby allowing future extensions to the structure (e.g., for extended
attributes) without rebreaking the ABI. FTSENT now contains a pointer to the
parent stream, which fts_compar() can then take advantage of, avoiding the
undefined behavior previously warned about. As a consequence of this change,
the prototype of the comparison function passed to fts_open() has changed
to reflect the required amount of constness for its use. All callers in the
tree are updated to use the correct prototype.

Comparison functions can now make use of the new parent pointer to access
the new stream-specific private data pointer, which is intended to assist
creation of reentrant library routines which use fts(3) internally.

Not objected to in spirit by: -arch


# 100070 15-Jul-2002 des

Get rid of %qd, and unbreak Alpha build.


# 99802 11-Jul-2002 alfred

fixup for WARNS=4.


# 99800 11-Jul-2002 alfred

de-__P()


# 97421 28-May-2002 alfred

Assume __STDC__, remove non-__STDC__ code.


# 79291 05-Jul-2001 kris

Mark a static function as __printflike()

MFC After: 1 week


# 66584 03-Oct-2000 phk

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.


# 61749 17-Jun-2000 joe

Switch over to using the new fflagstostr and strtofflags library calls.


# 60418 12-May-2000 wollman

Give mtree the ability to exclude files and directories from its traversal.

PR: 16944


# 56692 27-Jan-2000 joe

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 ;)


# 54375 09-Dec-1999 joe

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


# 51705 26-Sep-1999 billf

-Wall fixes.

Submitted by: nrahlstr


# 50479 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 44303 26-Feb-1999 wollman

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.


# 42787 18-Jan-1999 jkoshy

Move to a uniform '\ooo' (VIS_OCTAL) encoding for special characters.
The previous commit broke mtree(8) when file names using certain 8-bit
characters ended up being encoded with '/', '*', and other shell
metacharacters.

PR: bin/9538
Submitted by: "Eugene M. Kim" <astralblue@usa.net>
Reviewed by: jkoshy
Bug-missed-last-time-by: jkoshy


# 42561 12-Jan-1999 jkoshy

Teach mtree(8) to handle whitespace in filenames. Uses strvis(3).

PR: bin/3246
Submitted by: Eugene M. Kim <astralblue@usa.net>
Reviewed by: jkoshy, wollman


# 38020 02-Aug-1998 bde

Fixed printf format errors.


# 36670 05-Jun-1998 peter

Create a new flag, "nochange", which will specify that a directory is
to be created if it's missing, otherwise completely ignore it's modes and
owners. Primary intended targets: /usr/src and /usr/obj.

Adjust the 'not created: File exists' message to mention that it's a
directory that's the problem, otherwise it doesn't make sense.

I had created chown-style -L and -P flag to control logical/physical mode
(ie: whether symlinks were followed), but the nochange flag is enough to
get the blasted thing out of my hair so I took them back out.


# 30027 01-Oct-1997 charnier

Use err(3) instead of local redefinition.


# 18404 20-Sep-1996 nate

ts_sec -> tv_sec
ts_nsec -> tv_nsec

Pointed out by: bde


# 9674 24-Jul-1995 bde

Report `fts_errno' instead of `errno' when the former applies.


# 9490 12-Jul-1995 phk

Fix to match new MD5 api, faster.


# 8857 30-May-1995 rgrimes

Remove trailing whitespace.


# 6286 10-Feb-1995 wollman

mtree * MD5 = better security

Idea from: Dr. John T. Wroclawski


# 2877 18-Sep-1994 rgrimes

My optimization to eliminate /set records was a little too aggressive, it
optimized away the first one :-(.


# 2860 18-Sep-1994 rgrimes

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.


# 1554 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1553,
which included commits to RCS files with non-trunk default branches.


# 1553 26-May-1994 rgrimes

BSD 4.4 Lite usr.sbin Sources