opnsense-src/usr.bin
Peter Wemm abacbbbf01 Implement a -delete option to find. The code is extremely paranoid and
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)
1996-10-04 12:54:07 +00:00
..
apply Change an incorrect reference to the "-n" flag to "-#". 1996-03-11 03:09:00 +00:00
ar More ts_nse -> tv_nsec changes following the kernel changes I made earlier. 1996-09-20 02:34:51 +00:00
at Fix botches in the handling of "AM" and "PM": 1996-07-19 00:44:55 +00:00
banner Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
basename add missing comma(s) in .Xr macros 1996-09-23 22:24:39 +00:00
biff documented that the dog Biff is dead 1996-08-03 14:25:02 +00:00
cal Use the .At macro where appropriate. 1996-08-23 01:06:24 +00:00
calendar sync copyright with /usr/share/examples/etc/bsd-style-copyright 1996-08-27 20:04:45 +00:00
cap_mkdb BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
chat Document how chat logis it information via syslog. 1996-07-03 02:27:30 +00:00
checknr Another round of man page cleanups. 1996-02-12 04:57:03 +00:00
chflags Set NOSHARED=true, having this binary static makes it much easier to 1995-07-24 01:44:17 +00:00
chpass Add new option to chpass: -e "expire" ; change the account expire time 1996-08-12 14:45:26 +00:00
cksum BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
cmp [HISTORY] command appeared in Version 1 AT&T UNIX 1996-08-29 18:06:19 +00:00
col Use the .At macro where appropriate. 1996-08-23 01:06:24 +00:00
colcrt BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
colldef New collating rules, reflect POSIX better now 1996-08-13 12:20:11 +00:00
colrm BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
column BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
comm BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
compile_et General -Wall warning cleanup, part I. 1996-07-12 19:08:36 +00:00
compress Finished adjustments for cleaning up declaration of zopen(). Moving the 1996-09-05 18:15:43 +00:00
cpp Change install' to ${INSTALL}' so that default install flags can be 1995-07-25 00:37:58 +00:00
ctags Add newline, closes bin/1433 1996-07-26 23:45:36 +00:00
cut Fix wrong separator output 1995-03-21 00:26:32 +00:00
dig build bind-4.9.4-P1 dig in it's own directory 1996-08-29 21:51:42 +00:00
dirname Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
dnsquery build bind-4.9.4-P1 dnsquery in it's own directory 1996-08-29 21:54:39 +00:00
du [HISTORY] command appeared in Version 1 AT&T UNIX 1996-08-29 18:06:19 +00:00
ee ree (aka ee) doesn't have a man page 1996-07-29 13:46:12 +00:00
env BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
error Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
expand BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
f2c Convert f2c.1 to mdoc format. 1996-05-15 20:27:10 +00:00
false BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
fetch add missing comma(s) in .Xr macros 1996-09-23 22:24:39 +00:00
file Added magic file for bzip in ./Magdir 1996-09-27 21:57:12 +00:00
file2c This is a small little program used to execute a bad practice a clean way :-) 1995-01-29 00:49:57 +00:00
find Implement a -delete option to find. The code is extremely paranoid and 1996-10-04 12:54:07 +00:00
finger Allow the user to disable the use of T/TCP by setting the -T option. 1996-03-15 16:41:49 +00:00
fmt Add -c flag to fmt to center lines. 1996-09-10 19:50:23 +00:00
fold BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
fpr BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
from Read from standard input if file name "-" is given. 1996-01-28 23:43:37 +00:00
fsplit Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
fstat Include <fcntl.h> so that this doesn't depend on the KERNEL version 1996-09-29 19:25:10 +00:00
ftp Make "ftp" a synonym for "open" 1996-09-19 08:16:47 +00:00
gcore Use the .Bx macro where appropriate. 1996-08-23 20:36:11 +00:00
gencat Accept escaped quotes in msg catalogs. 1995-08-26 18:37:49 +00:00
getopt Fix a bunch of spelling errors in a bunch of man pages. 1996-01-30 13:52:50 +00:00
gprof Print times/call in ns if hz >= 10e7. hz will be this large for high 1996-06-08 12:29:57 +00:00
gprof4 Implemented non-statistical kernel profiling. This is based on 1995-12-29 15:30:05 +00:00
head first check the count and then get 1996-02-26 22:46:36 +00:00
hexdump Now that we've already got "hexdump -C", make calling the command "hd" 1996-09-29 04:17:24 +00:00
host build bind-4.9.4-P1 host in it's own directory 1996-08-29 21:53:39 +00:00
id Fixed bug where 'id <user>' output the wrong group name (the user name 1995-08-28 10:23:58 +00:00
indent Fix a variety of minor typos and cross references in a bunch of 1996-01-20 07:29:11 +00:00
ipcrm Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
ipcs s/msg/shm/ for one variable. 1996-07-18 20:42:48 +00:00
join Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
jot >Number: 917 1995-12-29 12:18:46 +00:00
kdump Remove length field from utrace entries. 1996-09-22 18:18:20 +00:00
key Correct some man page xrefs, and some other minor changes to bring some 1996-04-08 04:18:31 +00:00
keyinfo Implement keyinfo(1) as a setuid Perl script, so /etc/skeykeys can 1996-04-26 21:35:11 +00:00
keyinit Fix a bunch of spelling errors in a bunch of man pages. 1996-01-30 13:52:50 +00:00
killall sync copyright with /usr/share/examples/etc/bsd-style-copyright 1996-08-27 20:04:45 +00:00
ktrace The userland change to the utrace(2) call. 1996-09-19 19:50:17 +00:00
kzip Add kzip(8) as supplied with PR# 1507, with some minor cleanup by me. 1996-08-21 19:07:22 +00:00
lam BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
last Localize time 1996-06-17 16:44:16 +00:00
lastcomm Clean up style and formatting. The listing of options could still be 1996-09-18 16:48:54 +00:00
ldd Incorporate John Polstra's sods.c display of the details about the 1996-10-01 02:16:16 +00:00
leave BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
lex Clean up dependencies a bit (we were not doing a depend on scan.c) 1996-09-19 05:21:07 +00:00
locate #include <fastfind.c> -> #include "fastfind.c" 1996-09-16 01:17:25 +00:00
lock Closes PR bin/1567 1996-09-14 09:00:52 +00:00
logger BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
login Fix some compilation warnings. 1996-09-21 18:01:23 +00:00
logname Correct a bunch of man page cross references and generally 1996-02-11 22:38:05 +00:00
look Use the .At macro where appropriate. 1996-08-23 01:06:24 +00:00
lorder typo. 1996-06-10 15:55:48 +00:00
lsvfs Fix a bunch of spelling errors in a bunch of man pages. 1996-01-30 13:52:50 +00:00
m4 This commit was generated by cvs2svn to compensate for changes in r16748, 1996-06-26 05:36:21 +00:00
mail Eliminated NOFILE. Use the arbitrary (currently identical) limit of 64 1996-09-28 13:15:06 +00:00
make Fix for PR# 1231, make(1) execution of ``.BEGIN'' does 1996-09-25 02:55:49 +00:00
makewhatis sync copyright with /usr/share/examples/etc/bsd-style-copyright 1996-08-27 20:04:45 +00:00
mesg [HISTORY] command appeared in Version 1 AT&T UNIX 1996-08-29 18:06:19 +00:00
mk_cmds Recovered from -Wall cleanup in ss_internal.h. This depended on 1996-09-05 18:20:47 +00:00
mkdep $* -> $@ 1996-04-05 22:13:49 +00:00
mkfifo Correct a bunch of man page cross references and generally 1996-02-11 22:38:05 +00:00
mklocale Fix non-break space attrs 1996-08-20 14:36:56 +00:00
mkstr Fix a bunch of spelling errors in a bunch of man pages. 1996-01-30 13:52:50 +00:00
modstat Fix a potential buffer overflow condition. 1996-08-08 07:58:07 +00:00
more Pick collate info for RE character ranges 1996-08-11 16:22:47 +00:00
msgs Eliminated includes of the "temporary" backwards compatibility header 1996-09-24 08:08:11 +00:00
mt Use the .Fx macro where appropriate. 1996-08-23 00:57:08 +00:00
netstat make appletalk networks not show an un-needed host 1996-09-05 23:34:09 +00:00
nfsstat From Lite2: rename fs to vfs. 1996-03-11 03:06:45 +00:00
nice Check the # of arguments, instead of silently dumping core. 1995-12-10 15:33:00 +00:00
nm Drat, had the N_FN overloading based on N_EXT backwards. N_EXT = filename, 1996-09-24 15:56:26 +00:00
nohup BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
pagesize Correct a bunch of man page cross references and generally 1996-02-11 22:38:05 +00:00
passwd Reset password change time to zero. (This has no effect with standard 1996-09-05 15:57:41 +00:00
paste BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
pr [HISTORY] command appeared in Version 1 AT&T UNIX 1996-08-29 18:06:19 +00:00
printenv BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
printf When used as a shell builtin, this program decoded a subset of arguments 1996-10-01 04:56:59 +00:00
quota Code clean up. Prototypes, casting, and parentheses around assignments 1996-06-15 01:01:02 +00:00
ranlib General -Wall warning cleanup, part I. 1996-07-12 19:08:36 +00:00
rdist Eliminated includes of the "temporary" backwards compatibility header 1996-09-24 08:08:11 +00:00
renice Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
rev BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
rlogin Don't use __dead or __pure in user code. They were obfuscations 1996-09-14 03:00:32 +00:00
rpcgen General -Wall warning cleanup, part I. 1996-07-12 19:08:36 +00:00
rpcinfo Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
rs The rs(1) command dumps core with the -s option (SIGSEGV) 1996-05-26 18:26:55 +00:00
rsh Add a timeout flag so that failing operations can at least be caught 1996-09-06 05:24:05 +00:00
rup Fix a bunch of spelling errors in a bunch of man pages. 1996-01-30 13:52:50 +00:00
ruptime add missing comma(s) in .Xr macros 1996-09-23 22:24:39 +00:00
rusers Fix a bunch of spelling errors in a bunch of man pages. 1996-01-30 13:52:50 +00:00
rwall Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
rwho Eliminated includes of the "temporary" backwards compatibility header 1996-09-24 08:08:11 +00:00
sasc Fix a bunch of spelling errors in a bunch of man pages. 1996-01-30 13:52:50 +00:00
script Don't use __dead or __pure in user code. They were obfuscations 1996-09-14 03:00:32 +00:00
sed Make it at least semi-worked 1996-08-11 18:08:53 +00:00
sgmlfmt When starting HTML generation, remove any pre-existing link file. 1996-10-01 16:23:39 +00:00
sgmls Bye Bye sgmlsasp (and rast)! Frankly, I won't miss you. 1996-09-08 20:44:50 +00:00
shar Change install' to ${INSTALL}' so that default install flags can be 1995-07-25 00:37:58 +00:00
showmount Use the .Bx macro where appropriate. 1996-08-23 20:36:11 +00:00
size Use the .At macro where appropriate. 1996-08-23 01:06:24 +00:00
soelim BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
split This fixes 'split -l NNN foo'. As it stands split will 1995-07-07 08:23:52 +00:00
strings Use more complicated printable test to remove unnecessary 8bit chars 1995-12-28 16:31:23 +00:00
strip [HISTORY] command appeared in Version 1 AT&T UNIX 1996-08-29 18:06:19 +00:00
su [HISTORY] command appeared in Version 1 AT&T UNIX 1996-08-29 18:06:19 +00:00
symorder Correct a bunch of man page cross references and generally 1996-02-11 22:38:05 +00:00
systat Really eliminated includes of the "temporary" backwards compatibility 1996-09-24 08:43:04 +00:00
tail complete err() changes, actually use warn() in most instances 1996-08-26 20:37:48 +00:00
talk If running under a typical sysv-style curses, including ncurses, use 1996-08-20 00:31:37 +00:00
tclsh bmaked tclsh 1996-06-26 17:52:19 +00:00
tconv Correct some manual page cross reference errors. E.g. su is a section 1996-02-02 00:26:12 +00:00
tcopy Make the counters unsigned longs so that tapes don't contain negative 1995-12-31 09:00:24 +00:00
tee BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
telnet Make telnet a synonym for open 1996-09-19 08:15:56 +00:00
tftp Don't use __dead or __pure in user code. They were obfuscations 1996-09-14 03:00:32 +00:00
time Fix a bug under time's "-l" option. The values reported for average 1996-07-30 19:00:12 +00:00
tip Do not claim that tip is also called cu. 1996-09-19 05:14:30 +00:00
tn3270 Fix some compilation warnings 1996-09-22 01:05:21 +00:00
touch Don't use __dead or __pure in user code. They were obfuscations 1996-09-14 03:00:32 +00:00
tput Remove _set_ospeed, done in tgetent now. 1995-08-05 21:33:11 +00:00
tr Cast char's to (u_char) before passing them to isctype() functions. 1996-03-19 21:21:06 +00:00
true BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
tset Remove _set_ospeed, done in tgetent now. 1995-08-05 21:33:11 +00:00
tsort Close PR#1455. In a couple of weeks, I'll change bsd.lib.mk to use 1996-08-02 04:50:44 +00:00
tty [HISTORY] command appeared in Version 1 AT&T UNIX 1996-08-29 18:06:19 +00:00
ul Correct some man page xrefs, and some other minor changes to bring some 1996-04-08 04:18:31 +00:00
uname Use the .Bx macro where appropriate. 1996-08-23 20:36:11 +00:00
unexpand BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
unifdef BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
uniq BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
units Added revised manpage submitted by the author of units. 1996-06-10 00:43:42 +00:00
unvis BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
users Merge RELENG_2_0_5 into HEAD 1995-06-11 19:33:05 +00:00
uudecode Oops, restore missing piece of previous commit. 1996-04-25 18:14:11 +00:00
uuencode Minor correction regarding the last line of an uuencoded file. 1996-03-17 09:49:51 +00:00
vacation Various cleanups: 1996-09-28 13:37:38 +00:00
vgrind . make vgrind 8-bit clean; note that it still implicitly assumes 1996-09-08 18:23:53 +00:00
vi s/__unused/__sex_unused/ - this is simply a placeholder variable that 1996-08-24 03:49:14 +00:00
vis Fix an itinerant cross-reference. 1996-07-25 18:11:30 +00:00
vmstat Fixed DPADD. 1996-09-05 17:16:10 +00:00
w Do not print herror message, if w -n gethostname failed to be 100% 1996-06-17 20:07:44 +00:00
wall Fix some improperly wrapped lines in the code. 1996-08-11 02:20:05 +00:00
wc [HISTORY] command appeared in Version 1 AT&T UNIX 1996-08-29 18:06:19 +00:00
what Add a reference to ident(1). 1996-06-30 16:06:44 +00:00
whereis A totally revamped whereis(1), bringing back all the functionality of 1996-06-15 12:29:48 +00:00
which sync copyright with /usr/share/examples/etc/bsd-style-copyright 1996-08-27 20:04:45 +00:00
who [HISTORY] command appeared in Version 1 AT&T UNIX 1996-08-29 18:06:19 +00:00
whois Add support for SOCKS if enabled. 1996-04-23 06:01:10 +00:00
window Correct some man page cross references and file location references. 1996-04-07 00:06:21 +00:00
write [HISTORY] command appeared in Version 1 AT&T UNIX 1996-08-29 18:06:19 +00:00
xargs Make xargs take into account the bytes occupied by the environment. 1996-03-05 07:43:40 +00:00
xinstall Sync usage line to man page, per style(9). 1996-10-01 03:59:57 +00:00
xlint .Os NetBSD -> .Os FreeBSD. 1996-09-28 22:46:35 +00:00
xstr Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
yacc Fix for PR# 1427, yacc-generated parser generates warnings 1996-09-22 02:05:53 +00:00
yes BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
ypcat Correct a bunch of man page cross references and generally 1996-02-11 22:38:05 +00:00
ypmatch Correct a bunch of man page cross references and generally 1996-02-11 22:38:05 +00:00
ypwhich More XDR routine cleanups. These three programs should be the only 1995-12-15 03:39:46 +00:00
Makefile remove devconf tools from make tree. 1996-09-06 23:07:35 +00:00
Makefile.inc BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00