History log of /freebsd-11-stable/usr.sbin/fmtree/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
356533 09-Jan-2020 bdrewery

MFC r352261,r352262,r352265:

r352261:
mtree: Fix -f -f not considering type changes.
r352262:
mtree -c: Fix username logic when getlogin(3) fails.
r352265:
mtree -O: Fix not descending on hash collisions

Relnotes: yes

319119 29-May-2017 ngie

MFC r314659,r314676:

r314659:

usr.sbin: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

r314676:

Fix build after r314656

Some of the changes I introduced to use .ALLSRC were correct in spirit,
but incorrect in reality -- in particular, ../Makefile.inc hadn't been
pulled in via bsd.init.mk (via bsd.lib.mk, bsd.prog.mk), so the value
of .ALLSRC (evaluated immediately) was empty. .include bsd.init.mk
explicitly so we can be certain that the values used as dependencies in
the targets are defined when the target recipe has been evaluated.

Reminder: thou shalt separate out separate functional changes before
committing them.

(YUGE) Pointyhat to: ngie
In collaboration with: bdrewery


/freebsd-11-stable/usr.sbin/acpi/Makefile.inc
/freebsd-11-stable/usr.sbin/amd/Makefile.inc
/freebsd-11-stable/usr.sbin/amd/amd/Makefile
/freebsd-11-stable/usr.sbin/amd/libamu/Makefile
/freebsd-11-stable/usr.sbin/ancontrol/Makefile
/freebsd-11-stable/usr.sbin/audit/Makefile
/freebsd-11-stable/usr.sbin/auditd/Makefile
/freebsd-11-stable/usr.sbin/auditdistd/Makefile
/freebsd-11-stable/usr.sbin/auditreduce/Makefile
/freebsd-11-stable/usr.sbin/authpf/Makefile
/freebsd-11-stable/usr.sbin/autofs/Makefile
/freebsd-11-stable/usr.sbin/bhyvectl/Makefile
/freebsd-11-stable/usr.sbin/bhyveload/Makefile
/freebsd-11-stable/usr.sbin/bluetooth/Makefile.inc
/freebsd-11-stable/usr.sbin/bluetooth/bthidcontrol/Makefile
/freebsd-11-stable/usr.sbin/bluetooth/rfcomm_pppd/Makefile
/freebsd-11-stable/usr.sbin/bsnmpd/bsnmpd/Makefile
/freebsd-11-stable/usr.sbin/bsnmpd/gensnmptree/Makefile
/freebsd-11-stable/usr.sbin/bsnmpd/tools/Makefile.inc
/freebsd-11-stable/usr.sbin/camdd/Makefile
/freebsd-11-stable/usr.sbin/ckdist/Makefile
/freebsd-11-stable/usr.sbin/cron/crontab/Makefile
/freebsd-11-stable/usr.sbin/cron/lib/Makefile
/freebsd-11-stable/usr.sbin/ctladm/Makefile
/freebsd-11-stable/usr.sbin/ctld/Makefile
/freebsd-11-stable/usr.sbin/ctm/Makefile.inc
/freebsd-11-stable/usr.sbin/ctm/ctm/Makefile
/freebsd-11-stable/usr.sbin/ctm/ctm_dequeue/Makefile
/freebsd-11-stable/usr.sbin/ctm/ctm_smail/Makefile
/freebsd-11-stable/usr.sbin/dconschat/Makefile
/freebsd-11-stable/usr.sbin/editmap/Makefile
/freebsd-11-stable/usr.sbin/eeprom/Makefile
/freebsd-11-stable/usr.sbin/fdcontrol/Makefile
/freebsd-11-stable/usr.sbin/fdformat/Makefile
Makefile
/freebsd-11-stable/usr.sbin/fstyp/Makefile
/freebsd-11-stable/usr.sbin/ftp-proxy/Makefile
/freebsd-11-stable/usr.sbin/fwcontrol/Makefile
/freebsd-11-stable/usr.sbin/gpioctl/Makefile
/freebsd-11-stable/usr.sbin/gssd/Makefile
/freebsd-11-stable/usr.sbin/hyperv/tools/kvp/Makefile
/freebsd-11-stable/usr.sbin/hyperv/tools/vss/Makefile
/freebsd-11-stable/usr.sbin/iovctl/Makefile
/freebsd-11-stable/usr.sbin/iscsid/Makefile
/freebsd-11-stable/usr.sbin/mailstats/Makefile
/freebsd-11-stable/usr.sbin/mailwrapper/Makefile
/freebsd-11-stable/usr.sbin/makemap/Makefile
/freebsd-11-stable/usr.sbin/mlxcontrol/Makefile
/freebsd-11-stable/usr.sbin/mount_smbfs/Makefile
/freebsd-11-stable/usr.sbin/mountd/Makefile
/freebsd-11-stable/usr.sbin/mpsutil/Makefile
/freebsd-11-stable/usr.sbin/ndiscvt/Makefile
/freebsd-11-stable/usr.sbin/ndp/Makefile
/freebsd-11-stable/usr.sbin/nmtree/Makefile
/freebsd-11-stable/usr.sbin/pkg/Makefile
/freebsd-11-stable/usr.sbin/pnpinfo/Makefile
/freebsd-11-stable/usr.sbin/praliases/Makefile
/freebsd-11-stable/usr.sbin/praudit/Makefile
/freebsd-11-stable/usr.sbin/pwd_mkdb/Makefile
/freebsd-11-stable/usr.sbin/rip6query/Makefile
/freebsd-11-stable/usr.sbin/rpcbind/tests/Makefile
/freebsd-11-stable/usr.sbin/rtadvctl/Makefile
/freebsd-11-stable/usr.sbin/sa/Makefile
/freebsd-11-stable/usr.sbin/sendmail/Makefile
/freebsd-11-stable/usr.sbin/tcpdump/tcpdump/Makefile
/freebsd-11-stable/usr.sbin/timed/timedc/Makefile
312072 13-Jan-2017 kib

MFC r311522:
Use type-independent formats for printing nlink_t and ino_t.

302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

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


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
298028 15-Apr-2016 araujo

Use NULL instead of 0 for pointers.

fopen(3) returns NULL in case it can't open the STREAM.
fgetln(3) returns NULL if it can't get a line from a STREAM.
malloc returns NULL if it can't allocate memory.


290623 09-Nov-2015 bdrewery

Rename usr.sbin/mtree to usr.sbin/fmtree since it is not what /usr/sbin/mtree
actually is (which is usr.sbin/nmtree).

This has tricked me numerous times.


284345 13-Jun-2015 sjg

Add META_MODE support.

Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision: D2796
Reviewed by: brooks imp


277273 16-Jan-2015 will

Add a ${CP} alias for copying files in the build.

Some users build FreeBSD as non-root in Perforce workspaces. By default,
Perforce sets files read-only unless they're explicitly being edited.
As a result, the -f argument must be used to cp in order to override the
read-only flag when copying source files to object directories. Bare use of
'cp' should be avoided in the future.

Update all current users of 'cp' in the src tree.

Reviewed by: emaste
MFC after: 1 week
Sponsored by: Spectra Logic


275650 09-Dec-2014 sjg

-u and -U are supposed to affect existing files too.

Reviewed by: marcel


275054 25-Nov-2014 bapt

Convert usr.sbin to LIBADD
Reduce overlinking


271771 18-Sep-2014 will

Fix incremental builds involving non-root users with read-only source files.

Makefiles should not assume that source files can be overwritten. This is the
common case for Perforce source trees.

This is a followup commit to r211243 in the same vein.

MFC after: 1 month
Sponsored by: Spectra Logic
MFSpectraBSD: r1036319 on 2014/01/29, r1046711 on 2014/03/06


261298 30-Jan-2014 brooks

Merge from CheriBSD:
commit 70b8f0c127db6b80411789d237b403cc64a93573
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date: Mon Jan 27 22:53:57 2014 +0000

Move mtree.5 to usr.sbin/nmtree.
Remove note that mtree 2.0 format files aren't supported.

MFC after: 4 weeks
Sponsored by: DARPA, AFRL


261297 30-Jan-2014 brooks

Merge from CheriBSD:
commit 6b569451b92c48ccf1768da32e7e89189e1aa253
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date: Mon Jan 27 22:50:46 2014 +0000

Always install nmtree as mtree.
For compability, link mtree to nmtree.

X-MFC after: never
Sponsored by: DARPA, AFRL


255483 12-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)


245241 09-Jan-2013 brooks

Always install our mtree as /usr/sbin/fmtree and link it as
/usr/sbin/mtree by default.

Add a src.conf option WITH_NMTREE that causes NetBSD's mtree to be linked
as /usr/sbin/mtree as well as /usr/sbin/nmtree.


241777 20-Oct-2012 ed

More -Wmissing-variable-declarations fixes.

In addition to adding missing `static' keywords:
- bin/dd: Pull in `extern.h' to guarantee consistency with source file.
- libexec/rpc.rusersd: Move shared globals into an extern.h.
- libexec/talkd: Move `debug' and `hostname' into extern.h.
- usr.bin/cksum: Put counters in extern.h, as they are used by ckdist/mtree.
- usr.bin/m4: Move `end_result' into extern.h.
- usr.sbin/services_mkdb: Move shared globals into an extern.h.


233455 25-Mar-2012 joel

Remove superfluous paragraph macro.


229403 03-Jan-2012 ed

Replace index() and rindex() calls with strchr() and strrchr().

The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.


227489 13-Nov-2011 eadler

- fix duplicate "a a" in some comments

Submitted by: eadler
Approved by: simon
MFC after: 3 days


208056 14-May-2010 brueffer

Wording fixes.

PR: 143454
Submitted by: Warren Block <wblock@wonkity.com>
MFC after: 3 days


208027 13-May-2010 uqs

mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by: mdocml lint run
Reviewed by: ru


206118 03-Apr-2010 yar

Keep the list of default keywords sorted so that paranoid folks like me
don't try to find a hidden meaning in the strange order. The list used
to be sorted in rev. 1.1 from 4.4BSD but the order was broken as soon as
in rev. 1.2 by a single-character fix.

MFC after: 3 days


205873 30-Mar-2010 maxim

o Remove a duplicate reference to -f flag in the SYNOPSYS section.
o Improve wording.

PR: docs/144407
Submitted by: gcooper
MFC after: 1 week


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.


204111 20-Feb-2010 uqs

Fix common misspelling of hierarchy

Pointed out by: bf1783 at gmail
Approved by: np (cxgb), kientzle (tar, etc.), philip (mentor)


201390 02-Jan-2010 ed

The last big commit: let usr.sbin/ use WARNS=6 by default.


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.


187910 30-Jan-2009 kientzle

Accept integer times. Previously, the field "time=1233294539" would be
rejected as invalid.


175030 01-Jan-2008 kientzle

Add the mtree.5 manpage. I'll come back soon and
remove the format specification from mtree.8.
I also need to reconcile a few issues between this
mtree.5 and what is actually implemented in FreeBSD's
mtree utility.

MFC after: 30 days


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


173282 02-Nov-2007 keramida

mtree should use getcwd() instead of getwd(). getcwd() is safer,
because it includes checks for the length of the buffer it uses.

Reviewed by: phk, cperciva
MFC after: 3 days


170822 16-Jun-2007 maxim

o Add an example how to create /etc/mtree style mtree(8) files.

PR: docs/113667
Submitted by: edwin
MFC after: 1 week


162806 29-Sep-2006 ru

Markup fixes.


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


148580 31-Jul-2005 keramida

Fix all the spelling mistakes I could find in the man pages for words
that have at least 3 characters.

MFC after: 1 week
Thanks to: Music band ``Chingon''
for keeping me company while searching for these.


147377 14-Jun-2005 ru

Markup fixes.

Approved by: re (blanket)


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


141846 13-Feb-2005 ru

Expand *n't contractions.


140442 18-Jan-2005 ru

Sort sections.


140368 17-Jan-2005 ru

Added the EXIT STATUS section where appropriate.


133264 07-Aug-2004 simokawa

Remove extra "*/".


133249 07-Aug-2004 imp

Per letter dated July 22, 1999 remove 3rd clause of Berkeley derived software
(with permission of addtional copyright holders where appropriate)


131531 03-Jul-2004 ru

Eliminated double whitespace.


131500 02-Jul-2004 ru

Mechanically kill hard sentence breaks.


130455 14-Jun-2004 phk

Improve spec to spec comparison output.


130094 04-Jun-2004 ru

Added forgotten -w to the usage().


130092 04-Jun-2004 ru

Added forgotten -w to the SYNOPSIS.
Trim whitespace at EOL.


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.


123067 30-Nov-2003 phk

The new "spec against spec" comparison code was yet another time
victim of the special sort order employed where files come before
directories and alphabetic inside these two groups.

Approved by: re@


122896 19-Nov-2003 phk

Off by one error in malloc.

Approved by: re@


122612 13-Nov-2003 phk

Fix a bug relating to the "files before directories" sort order when
comparing two spec files.


122142 05-Nov-2003 phk

Add a small testcase for the new -f-f mode.


122141 05-Nov-2003 phk

Give mtree(8) the ability to take [two -f spec] arguments and compare
the two specifications to each other.


122135 05-Nov-2003 phk

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


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


121853 01-Nov-2003 bde

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.


121798 31-Oct-2003 phk

Make mtree's update function update the modification time too.

Submitted by: Dan Nelson <dnelson@allantgroup.com>
PR: 53063


121736 30-Oct-2003 phk

Update test-case to also fail on filenames containing '#'


121734 30-Oct-2003 phk

Use vis(3) to encode/decode the target for symlinks.

Make vis(3) decode errors fatal for both symlink targets and fienames.


121733 30-Oct-2003 phk

Add another test-script for mtree(8): Check symlinks with space in them.


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.


121730 30-Oct-2003 phk

Add a test script which Mtree fails.


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.


120054 14-Sep-2003 ru

Get rid of duplicates.


114601 03-May-2003 obrien

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


112403 19-Mar-2003 tobez

The -s option should not assume -U.

MFC After: 2 weeks


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.


112194 13-Mar-2003 tobez

Fix two minor mismatch reporting output errors.

Reviewed by: phk
MFC After: 3 weeks


107788 12-Dec-2002 ru

Uniformly refer to a file system as "file system".

Approved by: re


106849 13-Nov-2002 ru

mtree(8) wasn't a bootstrap tool since 2000/07/23 (Makefile.inc1,v 1.161).


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


99968 14-Jul-2002 charnier

The .Nm utility


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.


96705 16-May-2002 trhodes

Consistancy check: s/file system/filesystem/g


96326 10-May-2002 max

Typo.


83890 24-Sep-2001 ru

Only compile with strtofflags.c from libc if bootstrapping.


83572 17-Sep-2001 ru

Fix the bootstrapping aid from revision 1.9.
WORLD was renamed to BOOTSTRAPPING.


81687 15-Aug-2001 ru

mdoc(7) police: utilize the new .Ex macro.


81298 08-Aug-2001 sheldonh

can not -> cannot


80029 20-Jul-2001 obrien

Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.


79755 15-Jul-2001 dd

Remove whitespace at EOL.


79291 05-Jul-2001 kris

Mark a static function as __printflike()

MFC After: 1 week


74816 26-Mar-2001 ru

- Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.


74532 20-Mar-2001 ru

Set the default manual section for usr.sbin/ to 8.


70486 29-Dec-2000 ben

Convert to use the <sys/queue.h> macros rather than fiddling with the queue
structure internals.

Reviewed by: markm


70403 27-Dec-2000 ru

Prepare for mdoc(7)NG.


68965 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


68575 10-Nov-2000 ru

Avoid use of direct troff requests in mdoc(7) manual pages.


66747 06-Oct-2000 phk

Don't try to compare other attributes if the type doesn't match, it's
nothing but trouble, and no use anyway.


66746 06-Oct-2000 phk

Don't whine about modes on symlinks.


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.


66357 25-Sep-2000 ache

Re-add -P option (for POSIX-like command line interface)


65882 15-Sep-2000 ache

Restore standard symlink default, return -L, remove -P, add missing -q to getopt
This is part of whole subsystem fixing

Reviewed by: imp


65812 13-Sep-2000 sheldonh

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


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


63786 24-Jul-2000 marcel

Revert the reversion of the default mtree behaviour. The mtree
command now follows symlinks again.

Requested by: jkh


63767 23-Jul-2000 imp

First attempt to fix a buildworld from -stable machine. Explicitly
include strtofflags.c from lib/libc/gen when building mtree until the
current dependency mess with mtree is fixed.


63305 17-Jul-2000 sheldonh

Correct the usage() message as per rev 1.25 of mtree.8 .


63304 17-Jul-2000 sheldonh

* Order options in the SYNOPSIS correctly.
* Re-order the list of options in teh DESCRIPTION as per
the SYNOPSIS.
* Move the description of exit conditions from the
DESCRIPTION section to a new DIAGNOSTICS section.
* Typo fix: "effect" -> "affect" when used as a verb.
* Clear the Nm macro as appropriate.
* Typo fix: "consider" -> "considers" for a singular subject.
* Use Nx instead of NetBSD.


63261 16-Jul-2000 ache

Fix getopt string I forget


63255 16-Jul-2000 ache

Revert back to original mtree default behaviour to not follow symlinks, to be
compatible with other *BSD camp. Add -L option to follow symlinks, so remove
-P option which is now default. The next step will be to add -L to building
process.

Asked-by: bde


63135 14-Jul-2000 sheldonh

Fix the NAME section. Order the options which do not take arguments,
add the -P option (introduced in rev 1.22), and use mdoc word keeps
(Bk -words / Ek) for those options which do take arguments.


63127 14-Jul-2000 joe

Use -P instead of -S to specify that no symlinks should be followed.
There's no reason to make it different from cp(1), chmod(1), chown(1)
etc.

Requested by: sheldonh


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.


61749 17-Jun-2000 joe

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


61025 28-May-2000 charnier

Use .Fx


60938 26-May-2000 jake

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others


60833 23-May-2000 jake

Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by: phk
Reviewed by: phk
Approved by: mdodd


60648 16-May-2000 wollman

Punctuation fix.


60647 16-May-2000 wollman

Add used includes.


60491 13-May-2000 wollman

Add excludes.c (missed in previous commit).

PR: 16944


60418 12-May-2000 wollman

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

PR: 16944


57003 05-Feb-2000 joe

Revert part of the last commit, remove {g|s}etflags from the libc
interface, and statically link them to the programs using them.
These functions, upon reflection and discussion, are too generically
named for a library interface with such specific functionality.
Also the api that they use, whilst ok for private use, isn't good
enough for a libc function.

Additionally there were complications with the build/install-world
process. It depends heavily upon xinstall, which got broken by
the change in api, and caused bootstrap problems and general mayhem.

There is work in progress to address future problems that may be
caused by changes in install-chain tools, and better names for
{g|s}etflags can be derived when some future program requires them.
For now the code has been left in src/lib/libc/gen (it started off
in src/bin/ls).

It's important to provide library functions for manipulating file
flag strings if we ever want this interface to be adopted outside
of the source tree, but now isn't necessarily the right moment
with 4.0-release just around the corner.

Approved: jkh


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


55302 01-Jan-2000 joe

Added missing DPADD's. Removed unrequired SRCS's.

Obtained from: bde


55270 30-Dec-1999 joe

Moved flags_to_string and string_to_flags into libutil. It's used in
many places nowadays.


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 27-Sep-1999 billf

-Wall fixes.

Submitted by: nrahlstr


50479 28-Aug-1999 peter

$Id$ -> $FreeBSD$


44358 01-Mar-1999 wollman

When bootstrapping mtree, don't depend on there being a libmd at all.


44312 27-Feb-1999 jkh

mtree is a "bootstrap tool", don't use the fancy new world-breaking features
if we're building it as part of the bootstrap toolset.


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


41848 16-Dec-1998 imp

Free memory from getmode.

Obtained from: OpenBSD


38020 02-Aug-1998 bde

Fixed printf format errors.


36841 10-Jun-1998 peter

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

Suggested by: bde


36796 09-Jun-1998 imp

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


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.


25831 15-May-1997 ache

Change FTS_PHYSICAL (not follow symlinks but return them)
to FTS_LOGICAL (follow symlinks and return their targets)

Because
1) In the real system there is a lot of symlinks nowdays over
/var, /spool, etc. Mtree can't do anything for them, i.e. change
permissions/owner. I.e. if you have /var/mail -> /somewhere
it will never be changed to group "mail" 775 like -current does now,
symlink totally confuses mtree.

2) Mtree can't deal with symlinks properly in any case (they are created
separately in other places now), so we lost no functionality by making
them invisible for mtree.


24428 31-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


22997 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


21880 20-Jan-1997 wosch

Sort cross references.


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


18404 20-Sep-1996 nate

ts_sec -> tv_sec
ts_nsec -> tv_nsec

Pointed out by: bde


14038 11-Feb-1996 mpp

Correct a bunch of man page cross references and generally
try and silence "manck".

ncurses, rpc, and some of the gnu stuff are still a big mess, however.


13744 30-Jan-1996 mpp

Fix a bunch of spelling errors in a bunch of man pages.


11282 06-Oct-1995 torstenb

st_size in struct stat has type off_t (long long) and not unsigned long
change strtoul() to strtoq()


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.


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


3468 09-Oct-1994 rgrimes

Add -U option which does the same things as -u except exits with 0
instead of 2 on MISMATCH.


3052 24-Sep-1994 dg

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


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


2473 03-Sep-1994 adam

fixed typos
Reviewed by:
Submitted by:


1863 05-Aug-1994 wollman

Get rid of update. Make man page installation work with our scheme
(and rename a few in the process).


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.