summaryrefslogtreecommitdiffstats
path: root/usr.bin/find/function.c
Commit message (Collapse)AuthorAgeFilesLines
* A partial frontal lobotomy for find if using the NetBSD libc whichjb1998-01-101-0/+2
| | | | | | | | | doesn't know about getvfsbyname() and the vfsconf structure. This disables the -fstype option if compiled with a pre-processor that defines __NetBSD__. With the FreeBSD built pre-processor, find can only be built with the FreeBSD libc. So when running with a NetBSD kernel, FreeBSD's libc will have to return ENOSYS for things that NetBSD doesn't support. That's life in a hybrid world.
* Add the primaries -mmin, -amin, -cmin to find, similar to the GNU find.wosch1997-10-131-0/+98
|
* Add -execdir which will execute the exec command in the dir of the fileimp1997-08-291-0/+100
| | | | | | | in question. This change and the fts changes should be merged into 2.2-stable as soon as they are vetted in -current. This should allow cleaning of files in /tmp to be reneabled. Obtained from: OpenBSD
* Fix "-fstype local" that was broken by another bugfix in the Lite2 merge.peter1997-03-271-5/+5
| | | | Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>, PR#3076
* Merge from Lite2 - use new getvfsbyname() and related changes.peter1997-03-111-41/+30
| | | | understand whiteouts (FTS_W from fts()).
* The option "fstype" does not handle the argument "msdos" correctly.wosch1997-01-281-7/+4
| | | | | | | | This error results from changing the name for the msdos file system from "pcfs" to "msdos". Close PR #1105 submitted by: Thomas Wintergerst <thomas@lemur.nord.de>, Slaven Rezic <eserte@cs.tu-berlin.de>
* With -delete, don't complain about non-empty directories. Otherwisepeter1996-10-051-1/+1
| | | | "cd /tmp; find . -mtime +7 -delete" is excessively noisy.
* For the -delete option, emulate the behavior of "rm -f" when dealing withpeter1996-10-051-0/+7
| | | | | | user-immutable files. Requested by: ache
* Implement a -delete option to find. The code is extremely paranoid andpeter1996-10-041-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | goes to a fair degree of trouble to enable something like this to be safe: cd /tmp && find . -mtime +7 -delete It removes both files and directories. It does not attempt to remove immutable files (an earlier version I showed to a few people did a chflags and tried to blow away even immutable files. Too risky..) It is thought to be safe because it forces the fts(3) driven descent to only do "minimal risk" stuff. specifically, -follow is disabled, it does checking to see that it chdir'ed to the directory it thought it was going to, it will *not* pass a pathname with a '/' character in it to unlink(), so it should be totally immune to symlink tree races. If it runs into something "fishy", it bails out rather than blunder ahead.. It's better to do that if somebody is trying to compromise security rather than risk giving them an opportunity. Since the unlink()/rmdir() is being called from within the current working directory during the tree descent, there are no fork/exec overheads or races. As a side effect of this paranoia, you cannot do a "find /somewhere/dir -delete", as the last argument to rmdir() is "/somewhere/dir", and the checking won't allow it. Besides, one would use rm -rf for that case anyway. :-) Reviewed by: pst (some time ago, but I've removed the immutable file deletion code that he complained about since he last saw it)
* Use strtoq() instead of strtol() so that large inums, and sizes can bebde1996-04-071-4/+4
| | | | | | | specified. Not fixed: specification of large uids and gids; silent truncation of unrepresentable values.
* Don't use printf() for simple strings because it is slow. Closes PR 783.wollman1995-10-161-1/+1
| | | | Submitted by: Wolfram Schneider <wosch@freebsd.first.gmd.de>
* Simpler fix to the find bug reported by Terry Lambert <terry@lambert.org>nate1995-09-121-0/+3
| | | | | | | [ Find to a file vs. to stdout ] produces different output because find does not flush stdout when doing a -print. Submitted by: Jeffrey Hsu <hsu@freefall.freebsd.org>
* Delete bogus referneces to timezone code internal header file `tzfile.h',wollman1995-08-071-5/+4
| | | | which is no longer bogusly installed in /usr/include.
* Remove trailing whitespace.rgrimes1995-05-301-65/+65
|
* Add GNU-style `-print0' primary. This exists so that one can safelywollman1995-05-091-0/+24
| | | | | do `find some-nasty-expression -print0 | perl -n0e unlink' and have all the files actuallly get deleted. (Using `xargs' and `rm' is not safe.)
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+1069
OpenPOWER on IntegriCloud