summaryrefslogtreecommitdiffstats
path: root/bin/rm
AgeCommit message (Collapse)AuthorFilesLines
2019-09-02More correction of section 3 layout. directory->opendir, fts->fts_open,deraadt1-3/+3
getcap->cgetent. pwcache->user_from_uid. And then repair references. ok jmc
2018-03-31Clarify that -P only *attempts* overwriting, which may not succeed;schwarze1-3/+3
requested by deraadt@ after repeated questions on bugs@ and tech@, e.g. from Gregoire Jadi and Craig Skinner.
2017-06-28add -v to SYNOPSIS and STANDARDS;jmc1-3/+3
2017-06-27fix a few lines of unusual lengthtedu1-4/+4
2017-06-27add a -v verbose flag to cp, mv, and rm. useful for monitoring progress,tedu2-10/+22
and present on several other systems. some ok, some less ok. from Job Snijders
2016-10-14delete useless setlocale(3);schwarze1-5/+2
noticed by Jan Stary <hans at stare dot cz>; return from main while here; feedback and OK tb@, OK martijn@
2016-06-28revert previous. better fix applied to fts_open.tedu1-6/+3
2016-06-28don't report errors for 'rm -rf ""'. report by rkitover.tedu1-3/+6
ok benno deraadt
2016-04-15don't allow removal of /. more robust approach involving stat this time.tedu2-4/+13
posix uses the language "resolves to the root directory" in this case. ok millert
2016-02-01style nit - do not add a space between function name and bracketgsoares1-3/+3
from Edgar Pettijohn <edgar at pettijohn-web.com> fix another similar space in line 127. (pointed out by/OK jung@) OK tb@ jung@
2015-11-17Missing "getpw" pledges, these were unnoticed because nobody expectsderaadt1-3/+3
a user_from_uid(3) call...
2015-10-13revert previous. changes the behaviour of:daniel2-25/+14
rm -f ""
2015-10-11Don't allow "rm -rf /"daniel2-14/+25
Patch from Theo Buehler who was inspired by watching Bryan Cantrill in BSD Now 103. Minor tweak from me to turn the complained variables into flags instead of counters. "i think it's ok" tedu@ "this isn't 1980 anymore" deraadt@ ok millert@
2015-10-09Change all tame callers to namechange to pledge(2).deraadt1-5/+5
2015-10-08the -P flag overwrites files, so it needs tame "stdio rpath wpath cpath".deraadt1-1/+9
the remaining code paths can use tame "stdio rpath cpath". One again, the "cpath" request says a path-based system call will be used to "change" filesystem pathname layout, for instance any of O_CREAT, symlink, rename, unlink...
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt1-3/+5
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-05-25- it seems our notes that posix require rm to behave like rmdir for directoriesjmc1-23/+7
is plain wrong: remove it. the note in posix spec is misleading, to be fair - most of the rest of notes in STANDARDS are really historical notes (admittedly caused by the standards i guess) so move them into HISTORY. debatable, yes, but leaves STANDARDS consistent. HISTORY is a hodge podge anyway, by neccesity. - while there, fix a sentence splice in BUGS sobrado agrees with the removal of the rmdir note; millert oks the diff
2014-05-21Use errc/warnc to simplify code.guenther1-2/+2
ok jca@ krw@
2013-04-23handle large ino_tderaadt1-3/+3
2012-09-05overwrite with random stream; a repeating chunk of random data isn'tnaddy1-2/+2
random at all ok tedu@
2012-09-05use "MS-DOS", for consistency with other docs;jmc1-3/+3
2012-09-04one random overwrite is sufficient, after some discussion on techtedu2-23/+14
2012-06-18Polish the rm -rP turd: if the fts_* routines have lstat()'ed theguenther1-3/+7
directory entry then use the struct stat from that instead of doing it again, and skip the rm_overwrite() call if fts_read() indicated that the entry couldn't be a regular file. ok millert@
2012-06-18Fix potential symlink race condition in "rm -P" by adding a checkmillert1-3/+10
that the file we have opened is the one we expected. Also open in non-blocking mode to avoid a potential hang with FIFOs. Reported by Radoslaw A. Zarzynski. Fix adapted from NetBSD. OK guenther@
2010-10-04- rearrange STANDARDS slightly to read betterjmc1-19/+18
- remove a stray .Pp
2010-09-03add an EXIT STATUS section for /bin;jmc1-3/+3
2009-10-27rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt1-15/+1
unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
2009-02-08bump the posix reference in STANDARDS to IEEE Std 1003.1-2008, with a fewjmc1-4/+4
updates to follow;
2008-06-10do not ask the "override?" question if access fails for other resaons thanotto1-3/+4
EACCES. From Tim van der Molen; ok millert@ ray@
2007-06-06Unlink files with multiple links when -P flag is specified insteadray2-9/+7
of just warning and skipping the file. OK millert and jmc.
2007-05-31convert to new .Dd format;jmc1-2/+2
2007-05-29- consistent STANDARDS blurbjmc1-7/+12
- note which options are extensions to POSIX discussed w/ deraadt otto millert
2007-05-19simplify the description of -R; from Jeffrey 'jf' Limjmc1-3/+2
2007-02-16change [-f | -i] to [-fi]: although technically not as correct, it isjmc1-4/+3
simpler (clearer), and matches cp(1), mv(1), posix, and even usage();
2006-09-21reword a sentence so we are not discussing lfs; help from pedrojmc1-3/+3
2006-03-21Call fts_close() when done; from NetBSD's Coverity scan; ok millert@otto1-2/+3
jaredy@
2005-08-30remove -W from synopsis;jmc1-3/+3
from nikolay kalev; ok deraadt@
2005-06-14whiteouts are gonemillert2-35/+10
2004-06-02outline PASS; use size_t for sizes; better error message.otto1-22/+26
ok millert@ tedu@
2004-05-31better error handling with -P option. from freebsd (bde@)tedu1-14/+21
ok beck@ otto@
2003-11-21kill comma splice; from Jared Yanovich;jmc1-9/+9
also, put example description before the example, and indent example;
2003-06-02Remove the advertising clause in the UCB license which Berkeleymillert2-13/+5
rescinded 22 July 1999. Proofed by myself and Theo.
2003-05-30merge COMPATIBILITY into STANDARDS;jmc1-3/+3
2003-03-12more .Lideraadt1-4/+4
2003-01-11Attempt to do something reasonable when overwrite mode is combinedhugh2-3/+9
with hard links, and document it. In consultation with dynamo and approved by millert.
2002-09-18fix Xr refs; frisco@blackant.netderaadt1-2/+2
2002-07-04ansideraadt1-18/+9
2002-02-16Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert1-8/+8
2002-02-11Initial patch.mpech1-4/+5
When you give command examples in a manual page prefix them with $ command or # command deraadt@ ok
2002-01-24restore a little bit of historical materialmickey1-1/+11