Commit Graph

51 Commits

Author SHA1 Message Date
joel
d2e5a2251b mdoc: remove superfluous paragraph macros. 2014-06-15 10:43:12 +00:00
eadler
d2cd9ce7fa Add -x option to avoid crossing mount points when removing a hierarchy.
Discussed on:	-hackers
Inspired by:	DragonflyBSD
MFC After:	1 week
2013-04-26 17:45:37 +00:00
joel
2ba67e203a Add a few examples.
Obtained from:	OpenBSD
2013-03-15 20:12:54 +00:00
uqs
4d0f9c6e02 Fix typo and grammar nit
Submitted by:	arundel
MFC after:	7 days (or when the bikeshed has abated)
2010-10-31 19:16:54 +00:00
uqs
da8e054ad1 Elaborate some more on the non-security implications of using -P
Submitted by:	delphij
Discussion at:	svn-src-all
2010-10-31 09:21:27 +00:00
des
6181f4e8f1 Language cleanup. 2010-10-27 18:48:23 +00:00
uqs
d6b49c1347 rm(1): clarify that -P works only when blocks are updated in-place
Suggested by:	pjd, ivoras, arundel
2010-10-08 15:20:20 +00:00
delphij
327370f2cc Clarify the combination effect of -P and -f to make it clear.
Submitted by:	arundel
MFC after:	2 weeks
2010-10-04 06:17:45 +00:00
ru
59b8e8a6d2 Give a hint to the reader as to what the "whiteout" actually means. 2006-12-26 13:57:40 +00:00
ru
9b2078d255 Fix markup, add the EXIT STATUS section. 2006-12-26 13:44:41 +00:00
delphij
7af07c0c57 Correct a security issue introduced in previous commit:
instead of removing the file and issue a warning about
the removal, do not do any operation at all in case -P
is specified when the dinode has hard links.

With -f and -P specified together, we assume that the
user wants rm to overwrite the contents of the file
and remove it (destroy the contents of file but leave
its hard links as is).

The reason of doing it this way is that, in case where
a hard link is created by a malicious user (currently
this is permitted even if the user has no access to the
file).  Losing the link can potentially mean that the
actual owner would lose control completely to the user
who wants to obtain access in a future day.

Discussed with:	Peter Jermey
2006-10-31 02:22:36 +00:00
delphij
633d73890b Be more reasonable when overwrite mode is specified while there
is hard links.  Overwritting when links > 1 would cause data
loss, which is usually undesired.

Inspired by:	discussion on -hackers@
Suggested by:	elessar at bsdforen de
Obtained from:	OpenBSD
2006-10-30 03:32:09 +00:00
ru
6bbac1a76d -mdoc sweep. 2005-11-17 12:15:23 +00:00
dougb
1a601e1eb1 Give .Dd a tummy rub, forgotten on my last commit. 2005-09-30 02:12:15 +00:00
dougb
a6ef64df7a Handle the case where the -P flag is specified for a read-only file
earlier, and more gracefully. Previously, this combination would be
ignored early in the code where permissions are tested and fail later
with a very unhelpful "permission denied" error.

Instead, test for this flag in the same block that generates the
"override?" messages for read-only files, but instead of trying
to guess what the user has in mind, generate an error and exit.

Update the man page to reflect this new behavior.

Not objected to by:	freebsd-hackers@
2005-09-29 20:40:29 +00:00
ru
978b8f7f1d Sync program's usage() with manpage's SYNOPSIS. 2005-02-09 17:37:39 +00:00
ru
ffd9fd4c0e Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.
2005-01-16 16:41:59 +00:00
imp
a76898b849 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
delphij
3705c45967 Correct a typo and make the documentation more mdoc(7) complaint.
Pointed out by:	dd
Approved by:	murray (mentor)
2004-11-01 16:52:34 +00:00
delphij
169dc919b8 Add -I, an option that asks for confirmation once if recursively
removing directories or if more than 3 files are listed in the
command line.

This feature is intended to provide a safe net but not being too
annoying like having "rm -i" for every deleting operations, and
is generally good for both newbies and power users, preventing
them from being so easily run into ``rm -rf /'', ``rm -rf *''
and so forth.

Originally implemented by Matthew Dillon for DragonFly, plus
some improvements done by various DragonFly contributors.

Approved by:	murray (mentor; the original dillon's version)
Discussed with:	des
Obtained from:	DragonFly's bin/rm/
		rm.c rev. 1.4 - 1.8
		rm.1 rev. 1.3 - 1.4
MFC After:	1 month
2004-10-28 08:25:30 +00:00
des
7b077f5960 Markup fixes.
Pointed out by:	ru
2004-10-04 19:03:44 +00:00
des
b6f24c61ed Find out how flame-proof my underwear really is. 2004-10-04 11:26:01 +00:00
ru
d40c857e0d Mechanically kill hard sentence breaks. 2004-07-02 21:04:19 +00:00
markm
4383f14801 Remove clause 3 from the UCB licenses.
OK'ed by:	imp, core
2004-04-06 20:06:54 +00:00
trhodes
370db79246 Cross ref chflags(1).
Suggested by:	Craig Carey <research@ijs.co.nz) on -doc.
2003-02-04 20:38:51 +00:00
trhodes
9618da3e35 s/filesystem/file system/ as discussed on -developers 2002-08-21 17:32:44 +00:00
trhodes
56036d2623 Consistancy check s/file system/filesystem/
Reviewed by:	brian
2002-05-16 01:57:20 +00:00
dwhite
12798316b8 Update STANDARDS section on rm(1) to reflect current conformance.
PR:		35471
2002-03-02 05:10:11 +00:00
dd
a145482cf6 Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
ru
b5cd63f616 mdoc(7) police: use the default ``file ...'' feature of the .Ar macro. 2001-02-13 09:56:35 +00:00
ru
d4cb36bcfe Prepare for mdoc(7)NG. 2000-12-15 17:37:31 +00:00
ru
be1f850a8f mdoc(7) police: use the new features of the Nm macro. 2000-11-20 11:39:41 +00:00
sheldonh
4f3c5cfbf7 Fix cut'n'paste niggles in previous commit. 1999-12-21 08:57:58 +00:00
sheldonh
61c79b122e Add link(1) and unlink(1) as special cases of ln(1) and rm(1)
respectively, in accordance with SUSv2.

This differs from the approach taken in NetBSD, but provides
less obscure error messages in at least the EISDIR case and
does not take up additional disk space for new binaries.

PR:		13071
PR:		13074
Requested by:	James Howard <howardjp@wam.umd.edu>
1999-12-20 16:13:47 +00:00
mharo
199f72f333 brucify, v' before W', mention -v is non-standard in manpage and
make code slightly easier to read

Reviewed by:	obrien
1999-09-04 03:40:10 +00:00
mharo
2e0328a8ba add verbose flag
exit(1) --> exit(EX_USAGE)

Reviewed by:	obrien
1999-08-29 02:20:26 +00:00
peter
66312e4a8d $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
kris
74171e7d70 Use .Dq instead of ``'' in manpage
Use optimal blocksize for rm -P, instead of always using 8192-byte blocks
to overwrite the file.

Obtained from:	OpenBSD
1999-05-28 12:47:31 +00:00
wollman
0f1371bcfb Fix synopsis to match 1003.2. Add text describing the way in which
our implementation does not meet 1003.2 (rather than the now outdated
``is expected to comply' language).
1999-01-28 17:41:02 +00:00
charnier
75bfd9abdd .Nm rm -> .Nm. 1998-05-18 06:37:35 +00:00
steve
717042838c Remove remaining Lite1 stuff from the man page and uphold the
precedence in changing sccsid to rcsid as set by Phillippe
Charnier in his previous 100 or so commits.

pointed out by: Bruce Evans <bde@zeta.org.au>
1997-08-07 21:37:39 +00:00
dfr
559a468aae Enable whiteout code since we now have the lite2 support for them. 1997-04-29 10:03:10 +00:00
mpp
760778bbe9 Provide examples of how to remove file names that begin with
a dash in non-getopt implementations.  E.g.:
	rm /home/mpp/-filename
	rm ./-filename

Requested by: bde
1997-04-09 05:04:43 +00:00
mpp
dd5458250f Improve the wording in the NOTES section. Closes PR# 3223. 1997-04-08 20:27:48 +00:00
peter
83b3c2c161 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
jkh
808a36ef65 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
steve
2aae101b54 Merge Lite2 mods, and -Wall cleaning. Unimplemented undelete(2)
cruft is protected by a #ifdef (BSD4_4_LITE) that should be
removed when this is supported by the kernel.
1996-12-14 06:11:53 +00:00
wosch
ab0ebe585d [HISTORY] command appeared in Version 1 AT&T UNIX
Obtained from: A Quarter Century of UNIX, Peter H. Salus, page 41
1996-08-29 18:06:19 +00:00
wosch
424382b978 fix usage string
respond `Y' is equal to `y'

Add a note how to delete file name with beginning `-'
1996-03-07 23:26:59 +00:00
dg
8722740e7f Added $Id$ 1994-09-24 02:59:15 +00:00