History log of /freebsd-10-stable/usr.sbin/mtree/verify.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

# 174403 07-Dec-2007 des

When applying a spec, traverse the existing directory tree in lexical
order. This allows direct comparison of the output of two different
runs, regardless of the order in which readdir(2) returns directory
entries.

MFC after: 3 weeks


# 160083 03-Jul-2006 maxim

o Add an 'optional' keyword, which allows files to be in the
specification, but not in the file hierarchy.

PR: bin/99531
Submitted by: skv
Obtained from: NetBSD, originally from Ed Symanzik
Regress. test: test/test05.sh
MFC after: 1 month


# 148966 11-Aug-2005 brian

If we fail in chown(2), try to just change the group and continue on to
change the permissions. Failures are still recorded.

This allows mtree to do a generally better job of things when uid != 0.

Sponsored by: ActiveState/Sophos
Partially submitted by: neilw at ActiveState dot com
Reviewed by: neilw at ActiveState dot com
MFC after: 3 weeks


# 124387 11-Jan-2004 phk

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


# 122135 05-Nov-2003 phk

Rename spec() and verify() functions to have mtree_ prefix and take
explicit file descriptor instead of assuming stdin.


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


# 99802 11-Jul-2002 alfred

fixup for WARNS=4.


# 99800 11-Jul-2002 alfred

de-__P()


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


# 63853 25-Jul-2000 imp

Add -q. this will cause the warning messages about missing
directories to not be printed. This is from OpenBSD (and I think
NetBSD also) and makes our mtree more compatible with other BSDs.
This makes cross compilation easier than it was before. Other changes
will be needed to allow NetBSD or OpenBSD to cross build on FreeBSD,
but this is a start.

Reviewed by: andrey
Obtained from: OpenBSD
Concentric Red Circles by: My own stupidity


# 63087 13-Jul-2000 joe

Allow symlinks to be created if they appear in the mtree specification.

PR: bin/14171


# 63086 13-Jul-2000 joe

Added a flag (-S) to mtree to specify that symlinks shouldn't be
followed. This allows type=link matches to work properly and match
the link itself, instead of the file/directory that the link is
pointing to.


# 60418 12-May-2000 wollman

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

PR: 16944


# 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$


# 36841 10-Jun-1998 peter

There is no need to make nochange imply ignore as well.

Suggested by: bde


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


# 9675 24-Jul-1995 bde

Use p->fts_level instead of unsuccessfully trying to keep track of the
level ourself. We failed for unreadable directories. E.g.,
`mtree -d -f /etc/mtree/BSD.usr.dist -p /usr' run by `nobody' was
confused after it couldn't descend into /usr/games/hide. It looked
for /usr/include and subsequent directories in /usr/games.

Don't search for `extra' files when the spec depth is less than the
fts level. The spec depth isn't incremented for leaf nodes because
that would give a NULL level pointer and make it inconvenient to go
back to the parent level. Leaf nodes are built for directories that
are empty in the spec. Since they are empty in the spec, all files
in them are extra. The search looked for files one spec level
too high, so for `mtree -d -f /etc/mtree/BSD.usr.dist -p /usr',
obj/sbin matched ./sbin and wasn't considered extra, so it was
descended into and lots of bogus extra things in it were found.
This was harmful for `mtree -U' (as reported in pr623) and worse
for `mtree -r'.

Use rmdir(), not unlink(), to remove `extra' directories. unlink()
succeeds for root but unlinking directories normally damages the
file system.

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


# 8857 30-May-1995 rgrimes

Remove trailing whitespace.


# 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