Commit Graph

31 Commits

Author SHA1 Message Date
jkh
0ae6e4b6e2 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.
1999-02-27 03:16:28 +00:00
wollman
27f0cdb09d 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
jkoshy
4601663402 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
1999-01-18 06:58:25 +00:00
jkoshy
d738d8245f 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
1999-01-12 02:58:23 +00:00
imp
78ad405048 Free memory from getmode.
Obtained from: OpenBSD
1998-12-16 04:54:08 +00:00
bde
442c2c2717 Fixed printf format errors. 1998-08-02 14:41:34 +00:00
peter
42ea4b4753 There is no need to make nochange imply ignore as well.
Suggested by: bde
1998-06-10 06:45:08 +00:00
imp
bb7f14183c 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
peter
0bd6eb13d6 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.
1998-06-05 14:43:42 +00:00
charnier
2ba7fb7acc Use err(3) instead of local redefinition. 1997-10-01 06:30:02 +00:00
ache
eb3fa582a0 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.
1997-05-15 08:46:57 +00:00
imp
15c4d207bc compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-31 05:11:47 +00:00
peter
32d6b795de Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
wosch
00e37028d0 Sort cross references. 1997-01-20 00:03:00 +00:00
jkh
9c0cd3f9df 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.
1997-01-14 07:20:47 +00:00
nate
7bfae28671 ts_sec -> tv_sec
ts_nsec -> tv_nsec

Pointed out by:	bde
1996-09-20 04:13:44 +00:00
mpp
bda6e1c756 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.
1996-02-11 22:38:05 +00:00
mpp
029ea9012d Fix a bunch of spelling errors in a bunch of man pages. 1996-01-30 13:52:50 +00:00
torstenb
46a70427a8 st_size in struct stat has type off_t (long long) and not unsigned long
change strtoul() to strtoq()
1995-10-06 16:25:10 +00:00
bde
8bbc5ddb9f 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.
1995-07-24 02:52:42 +00:00
bde
cf2df4eb6c Report fts_errno' instead of errno' when the former applies. 1995-07-24 02:50:50 +00:00
phk
86e3a9df8b Fix to match new MD5 api, faster. 1995-07-12 09:15:15 +00:00
rgrimes
5a145b5eb1 Remove trailing whitespace. 1995-05-30 03:57:47 +00:00
wollman
05324a7bea mtree * MD5 = better security
Idea from: Dr. John T. Wroclawski
1995-02-10 03:12:42 +00:00
rgrimes
ad9df727e1 Add -U option which does the same things as -u except exits with 0
instead of 2 on MISMATCH.
1994-10-09 20:28:31 +00:00
dg
de85bb46bf 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
rgrimes
27ccca9760 My optimization to eliminate /set records was a little too aggressive, it
optimized away the first one :-(.
1994-09-19 01:32:57 +00:00
rgrimes
1f835a1920 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
adam
e91f3447de fixed typos
Reviewed by:
Submitted by:
1994-09-03 13:20:05 +00:00
wollman
f19a26b912 Get rid of update. Make man page installation work with our scheme
(and rename a few in the process).
1994-08-05 16:31:05 +00:00
rgrimes
862fdf11a2 BSD 4.4 Lite usr.sbin Sources 1994-05-26 05:23:31 +00:00