Home | History | Annotate | Download | only in mtree
History log of /src/usr.sbin/mtree/extern.h
RevisionDateAuthorComments
 1.41  05-Dec-2024  christos PR/58875: Jose Luis Duran: Produce consistent checksums in verification
by scanning directories in the same order as usual. While here, fix some
incorrect types.
 1.40  18-Mar-2021  cheusov branches: 1.40.8;
mtree: use POSIX type uint32_t instead of u_int32_t
 1.39  24-Apr-2014  christos Pass a file pointer to write data instead of writing to stdout.
No functional change.
 1.38  03-Feb-2013  christos branches: 1.38.6;
add the ability to only output paths included in a spec file when creating
from a directory (-c)
 1.37  20-Dec-2012  christos Implement the "flavor" output discussed in tech-userlevel@, by Brooks Davis
 1.36  05-Oct-2012  christos Implement FreeBSD's -f spec1 -f spec2 spec comparision function. This
is more useful than -C and diff because it highlights the keys that have
changed value so for example, you can see that the size of a file has
not changed but the contents have. (brooks)
 1.35  05-Oct-2012  christos add -j flag to indent directory blocks (from brooks)
 1.34  05-Oct-2012  christos add -q flag to silence warnings about symlinks to existing dirs (from OpenBSD
via brooks)
 1.33  05-Oct-2012  christos add -n flag to disable comments (brook)
 1.32  29-Aug-2011  joerg branches: 1.32.2; 1.32.8;
Use __dead and __printflike
 1.31  08-Apr-2009  apb The recent addition of sorting to "mtree -C" broke some third party
scripts. Now make sorting optional, controled by the "-S" flag.
 1.30  14-Dec-2006  he branches: 1.30.20;
Complete the move of string_to_flags() and flags_to_string() from the
bin/ls sources to libutil:
o Bump libutil minor version number
o Fix uses to include <util.h> to pick up the function definitions
o Fix most uses of flags_to_string() to release the now-malloc()ed result
 1.29  22-Jul-2004  lukem Implement -M to "merge" entries, even with different types.
This can be used in /etc/security to allow special.local to override
types of entries in special (e.g, replacing a dir with a link).

Rename Wflag to mtree_Wflag, to be more "external namespace" friendly.
 1.28  27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.27  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22366, verified by myself.
 1.26  23-Dec-2002  lukem Add -C, which dumps the specification with the full path name first,
and then all the other fields. (I.e, like -D except with the name
first instead of last).
Consistenly strsvis(3) encode path names (even for -C and -D).
 1.25  08-Oct-2002  lukem Remove convoluted code to work around missing lch{flags,mod,own}();
instead, rely upon libnbcompat to provide a workaround (which returns
an error if the target is a symlink).
Should fix another MacOS X build issue due to missing lchown(2).
 1.24  06-Oct-2002  lukem - Check HAVE_LCHFLAGS for lchflags(2) support, rather than assuming
that HAVE_STRUCT_STAT_ST_FLAGS implies this.
- Set HAVE_LCHFLAGS for native builds
- Clean up {CLEAR,SET,CHANGE}FLAGS macros, and only provide if
HAVE_STRUCT_STAT_ST_FLAGS is set.

(Fixes compilation as a tool on MacOS X, noted by Allen Briggs.)
 1.23  08-Feb-2002  tv Funtion appropriately in the absence of a lchmod call on the host.
 1.22  31-Jan-2002  tv Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
 1.21  29-Jan-2002  tv Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)
 1.20  29-Jan-2002  tv Add hooks to make mtree compilable from src/tools.
 1.19  07-Nov-2001  lukem User interface changes from (or inspired by) FreeBSD:
- Add -L to walk the tree `logically', by following symbolic links in
the heirarchy.
- Add -P to walk the tree `physically'. This is the current behaviour,
and the default.
- Add "-X excludes-file" to give mtree the ability to exclude files and
directories from its traversal. excludes-file contains fnmatch(3)
patterns to exclude from the walk.
- Add "md5digest" synonym for "md5".
- Add "rmd160" keyword for RMD-160 message digest, and "rmd160digest" synonym.
- Add "sha1" keyword for SHA-1 message digest, and "sha1digest" synonym.
- Don't try to compare() other attributes if the type doesn't match;
it's nothing but trouble, and no use anyway.
- In -c, only emit "/set" records if something has changed since the
previous one.

User interface changes by me:
- Check a device's parameters before checking uid/gid/mode.
- If updating (-u), modify the following to match the specification:
- Device type (retaining existing ownership).
- Symlink target.

Fixes from (or inspired by) FreeBSD:
- Use p->ftslevel instead of own code to keep track of the level ourself.
The previous code got majorly confused if fts(3) couldn't descend
into a subdir, resulting in leaf nodes getting attached to the wrong
directory.
XXX: This new method is much much more robust, even though it's not 100%
perfect; it might result in a couple of following entries in the spec
to be incorrectly tagged as missing.
- Pass a useful pathname to rlink(), so that logical (-L) traversal
doesn't confuse symlink checking.
- Consistently use MAXPATHLEN+1 sized buffers for pathnames, so that
there's room for the NUL.
- Use mtree_err() and strerror(p->fts_errno) to report errors during
the fts(3) walk.

Fixes by me:
- Remove now-unused `const char *name' argument from compare().
- Change crc_total from an int to a u_int32_t, to match usr.bin/cksum/crc.c.
- Remove trailing whitespace.
- Remove unnecessary (void) casts on functions.
- Reorder entries in the getopt() switch.
- Replace strtoq() with strtoll(), and use strtoul() appropriately.
- Renumber F_ flags to be in alphabetical order.
 1.18  03-Nov-2001  lukem - move "Wflag" global from mtree.c to spec.c, and reinstate the functionality
of tv's previous code, which skips uname or gname parsing if -W is enabled.
- rename "lineno" to "mtree_lineno", to reduce possibility of name
clashes in code that yanks in spec.c & misc.c (unlikely, but you never know)
 1.17  25-Oct-2001  lukem Add -W: don't attempt to change the perms/time/flags on existing entries, nor
set them when creating new directories. (AKA the ``don't whack'' option).
Concept suggested by Todd Vierling.
 1.16  25-Oct-2001  lukem - add lineno field to NODE
- move inotype() prototype into mtree.h from extern.h
 1.15  22-Oct-2001  lukem - enforce the top-most entry must be "." and must be a directory; avoids
various potential problems when intermixing full and relative paths
- changes to make it much easier to use spec() - the specfile parser - in
other programs (via .PATHing spec.c and misc.c):
- move excludetags, includetags and keys from mtree.c to misc.c
- implement mtree_err() using vwarnx() instead of assuming name is
"mtree"
- move inotype() and nodetype() from compare.c to misc.c
- add nodetoinode(), to convert from an mtree F_* type to a
mode_t S_IF* type
- clean up #include use; don't assume "mtree.h" pulls in some
standard includes
- change spec() to take a FILE * arg (where the specfile is read from)
 1.14  05-Oct-2001  lukem cleanup tags support;
- create a typedef struct slist_t to hold stuff in (avoid stringlist(3)
because it's less portable)
- move the tag manipulate stuff into misc.c
- add matchtags(), which returns 0 if the node is explicitly excluded,
or not included if an include list is given; or 1 otherwise
- in -D, change tags support from files-only to all-non-directories

(xxx; still considering implementing tags support for -c and !-D)
 1.13  04-Oct-2001  lukem features:
- add a new keyword - "tags" - which is a comma separated list of tags
associated with that file.
- add "-E tags"; exclude files in -D output with matching tags
- add "-I tags"; only include files in -D output with matching tags
(default is to list all)

fixes:
- move all extern variable references from individual files into extern.h
- `quote' some more user-specified strings in error messages
- man page: list an options arguments in the description, and sort xrefs.
 1.12  01-Oct-2001  lukem - implement -D - dump the specfile out in a manner that's parseable
by various tools
- implement -R key - remove the given key(s) from the list of keys to print
(now it's possible with "-k type -R type" to remove all keys :)
- rename ftype() to nodetype(), and make it public
- use pwcache(3) functions instead of get{gr,pw}{nam,uid}(3)
- add dump_nodes(), which provides the guts for -D.
 1.11  18-Jul-2001  lukem - add parsetype() (a la parsekey()) to parse the "type=xxx" arg. this improves
the error detection for invalid types, as well as shrinking binary size
- implement inotype() using ftype(), rather than duplicating the switch
- change "char *" arguments to "const char *"
 1.10  09-Mar-2001  simonb ANSIfy, KNF, in preperation for more work.
 1.9  20-Feb-2001  hubertf Remove all the "#ifdef __APPLE__" code, to make this actually
build again on Darwin. The code in question is outdated.

OK'd by Wilfredo Sanchez wsanchez@MIT.EDU.
 1.8  11-Oct-2000  is More format string cleanups by sommerfeld.
 1.7  07-Dec-1999  wennmach branches: 1.7.4;
code.c is no longer used, we use strsvis instead. Removed prototypes
from extern.h
 1.6  09-Nov-1999  drochner prototype encode()/decode()
 1.5  10-Oct-1998  mrg branches: 1.5.2; 1.5.6;
add support for 4.4BSD file flags. we take a `flags=xxx' parameter,
using the same style of naming as chflags, ls & xinstall use, plus an
additional `none' to turn off a default setting.
 1.4  08-Oct-1998  wsanchez Use u_int32_t rather than Sys-V u_long.
Rename err() to mtree_err(), to avoid conflict with libc.
 1.3  07-Mar-1995  cgd add NetBSD id's
 1.2  07-Mar-1995  cgd clean up import, fix a few bugs, etc.
 1.1  02-Nov-1993  cgd branches: 1.1.1;
latest mtree from uunet. doesn't compile, but that'll be fixed soon.
(want to have 'pseudo-virgin' sources, for when fixed fnmatch stuff
is released...)
 1.1.1.1  07-Mar-1995  cgd from 4.4-Lite
 1.5.6.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.2.2  19-Oct-2000  he Pull up revision 1.8 (requested by he):
Format string cleanup.
 1.5.2.1  20-Nov-1999  he Pull up revision 1.6 (requested by wennmach and joda):
Make mtree able to properly encode file names with `funny' albeit
legal characters (`#', ` ', binary characters), fixing PR#5006 and
PR#7663.
 1.7.4.1  17-Oct-2000  tv Pullup usr.sbin string format fixes [is].
See "cvs log" for explicit revision numbers per file, from sommerfeld.
 1.30.20.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.32.8.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.32.8.2  25-Feb-2013  tls resync with head
 1.32.8.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.32.2.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.32.2.2  23-Jan-2013  yamt sync with head
 1.32.2.1  30-Oct-2012  yamt sync with head
 1.38.6.1  10-Aug-2014  tls Rebase.
 1.40.8.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed