summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree
Commit message (Collapse)AuthorAgeFilesLines
* Restore standard symlink default, return -L, remove -P, add missing -q to getoptache2000-09-152-11/+12
| | | | | | This is part of whole subsystem fixing Reviewed by: imp
* Pass a useful pathname to rlink(). Many thanks to the PR originatorsheldonh2000-09-131-1/+2
| | | | | | | | for all the debugging work. PR: 21017 Reported by: Gerhard Sittig <Gerhard.Sittig@gmx.net> Submitted by: Jos Backus <josb@cncdsl.com>,
* Add -q. this will cause the warning messages about missingimp2000-07-253-6/+22
| | | | | | | | | | | | 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
* Revert the reversion of the default mtree behaviour. The mtreemarcel2000-07-242-12/+11
| | | | | | command now follows symlinks again. Requested by: jkh
* First attempt to fix a buildworld from -stable machine. Explicitlyimp2000-07-231-2/+3
| | | | | include strtofflags.c from lib/libc/gen when building mtree until the current dependency mess with mtree is fixed.
* Correct the usage() message as per rev 1.25 of mtree.8 .sheldonh2000-07-171-1/+1
|
* * Order options in the SYNOPSIS correctly.sheldonh2000-07-171-35/+39
| | | | | | | | | | | * 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.
* Fix getopt string I forgetache2000-07-161-1/+1
|
* Revert back to original mtree default behaviour to not follow symlinks, to beache2000-07-162-10/+11
| | | | | | | | 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
* Fix the NAME section. Order the options which do not take arguments,sheldonh2000-07-141-1/+13
| | | | | add the -P option (introduced in rev 1.22), and use mdoc word keeps (Bk -words / Ek) for those options which do take arguments.
* Use -P instead of -S to specify that no symlinks should be followed.joe2000-07-142-8/+8
| | | | | | | There's no reason to make it different from cp(1), chmod(1), chown(1) etc. Requested by: sheldonh
* Allow symlinks to be created if they appear in the mtree specification.joe2000-07-132-5/+20
| | | | PR: bin/14171
* Added a flag (-S) to mtree to specify that symlinks shouldn't bejoe2000-07-133-1/+9
| | | | | | 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.
* Switch over to using the new fflagstostr and strtofflags library calls.joe2000-06-176-16/+43
|
* Use .Fxcharnier2000-05-281-2/+2
|
* Back out the previous change to the queue(3) interface.jake2000-05-261-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Punctuation fix.wollman2000-05-161-1/+1
|
* Add used includes.wollman2000-05-161-0/+4
|
* Add excludes.c (missed in previous commit).wollman2000-05-131-1/+2
| | | | PR: 16944
* Give mtree the ability to exclude files and directories from its traversal.wollman2000-05-126-2/+141
| | | | PR: 16944
* Revert part of the last commit, remove {g|s}etflags from the libcjoe2000-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Historically file flags (schg, uschg, etc) have been converted fromjoe2000-01-274-7/+5
| | | | | | | | | | | | | | | | | 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 ;)
* Added missing DPADD's. Removed unrequired SRCS's.joe2000-01-011-0/+1
| | | | Obtained from: bde
* Moved flags_to_string and string_to_flags into libutil. It's used injoe1999-12-301-2/+3
| | | | many places nowadays.
* Added support for file flags, mostly merged from the NetBSD version.joe1999-12-099-10/+93
| | | | | | | | 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
* -Wall fixes.billf1999-09-273-5/+8
| | | | Submitted by: nrahlstr
* $Id$ -> $FreeBSD$peter1999-08-288-8/+8
|
* When bootstrapping mtree, don't depend on there being a libmd at all.wollman1999-03-011-5/+3
|
* mtree is a "bootstrap tool", don't use the fancy new world-breaking featuresjkh1999-02-271-2/+6
| | | | if we're building it as part of the bootstrap toolset.
* Add support for SHA-1 and RIPEMD160, now that libmd includes them. Makewollman1999-02-267-15/+139
| | | | | all of the hashes (including MD5) conditionalized in case we want to turn one of them off later.
* Move to a uniform '\ooo' (VIS_OCTAL) encoding for special characters.jkoshy1999-01-181-2/+2
| | | | | | | | | | | 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
* Teach mtree(8) to handle whitespace in filenames. Uses strvis(3).jkoshy1999-01-122-5/+19
| | | | | | PR: bin/3246 Submitted by: Eugene M. Kim <astralblue@usa.net> Reviewed by: jkoshy, wollman
* Free memory from getmode.imp1998-12-161-1/+2
| | | | Obtained from: OpenBSD
* Fixed printf format errors.bde1998-08-022-6/+6
|
* There is no need to make nochange imply ignore as well.peter1998-06-102-6/+5
| | | | Suggested by: bde
* Use correct size for readlink buffer. This is the size of theimp1998-06-091-2/+2
| | | | | | buffer -1 since readlink adds its own NUL to the end. Inspired by: Similar changes in OpenBSD
* Create a new flag, "nochange", which will specify that a directory ispeter1998-06-056-14/+21
| | | | | | | | | | | | 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.
* Use err(3) instead of local redefinition.charnier1997-10-018-114/+125
|
* Change FTS_PHYSICAL (not follow symlinks but return them)ache1997-05-151-1/+1
| | | | | | | | | | | | | | | 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.
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-311-1/+1
| | | | posix standard on the topic.
* Revert $FreeBSD$ to $Id$peter1997-02-222-2/+2
|
* Sort cross references.wosch1997-01-201-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-142-2/+2
| | | | | | | | 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.
* ts_sec -> tv_secnate1996-09-203-8/+8
| | | | | | ts_nsec -> tv_nsec Pointed out by: bde
* Correct a bunch of man page cross references and generallympp1996-02-111-3/+3
| | | | | | try and silence "manck". ncurses, rpc, and some of the gnu stuff are still a big mess, however.
* Fix a bunch of spelling errors in a bunch of man pages.mpp1996-01-301-2/+2
|
* st_size in struct stat has type off_t (long long) and not unsigned longtorstenb1995-10-061-1/+1
| | | | change strtoul() to strtoq()
* Use p->fts_level instead of unsuccessfully trying to keep track of thebde1995-07-241-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Report `fts_errno' instead of `errno' when the former applies.bde1995-07-241-2/+2
|
OpenPOWER on IntegriCloud