summaryrefslogtreecommitdiffstats
path: root/bin/rm
Commit message (Collapse)AuthorAgeFilesLines
* Explicitly add unmarked bin/ binaries to the runtime package.gjb2016-02-091-0/+1
| | | | | | | | Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate package, which requires pre-install/post-install scripts, to be added later. Sponsored by: The FreeBSD Foundation
* Protecting against rm -rf / is now POSIXLY_CORRECT per posix 1003.1bapt2015-11-072-4/+3
| | | | | | | | | edition 2013. No need anymore to disable the protection if one set the POXILY_CORRECT environment variable. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D4092
* Respect locale settings.delphij2015-08-281-0/+3
| | | | MFC after: 2 weeks
* Add META_MODE support.sjg2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge head from 7/28sjg2014-08-192-2/+1
| |\ | |/ |/|
| * Updated dependenciessjg2014-05-161-1/+0
| |
| * Updated dependenciessjg2014-05-101-0/+2
| |
| * Merge from headsjg2013-09-052-25/+32
| |\
| * \ sync from headsjg2013-04-121-1/+14
| |\ \
| * | | Updated dependenciessjg2013-03-111-0/+1
| | | |
| * | | Updated dependenciessjg2013-02-161-2/+0
| | | |
| | | |
| | \ \
| | \ \
| | \ \
| *---. \ \ Sync from headsjg2012-11-041-6/+20
| |\ \ \ \ \
| * | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+19
| | |_|/ / / | |/| | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | | rm -rf can fail sometimes with an error from fts_read. Make it honorimp2014-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fflag to ignore fts_read errors, but stop deleting from that directory because no further progress can be made. When building a kernel with a high -j value on a high core count machine, during the cleanobj phase we can wind up doing multiple rm -rf at the same time for modules that have subdirectories. This exposed this race (sometimes) as fts_read can return an error if the directory is removed by another rm -rf. Since the intent of the -f flag was to ignore errors, even if this was a bug in fts_read, we should ignore the error like we've been instructed to do.
* | | | | | mdoc: remove superfluous paragraph macros.joel2014-06-151-1/+0
| |_|_|_|/ |/| | | |
* | | | | Add two more 'static' qualifierseadler2013-04-261-2/+2
| | | | |
* | | | | Take some improvements from DragonFlyBSD:eadler2013-04-261-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add const where appropriate - add static where appropriate - fix a whitespace issues Reviewed by: brooks Obtained from: DragonFlyBSD MFC After: 1 week
* | | | | Add -x option to avoid crossing mount points when removing a hierarchy.eadler2013-04-262-6/+13
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | Discussed on: -hackers Inspired by: DragonflyBSD MFC After: 1 week
* | | | Add a few examples.joel2013-03-151-1/+14
| |/ / |/| | | | | | | | Obtained from: OpenBSD
* | | Fix bin/ build with a 64-bit ino_t.mdf2012-09-271-2/+3
| |/ |/| | | | | Original code by: Gleb Kurtsou
* | Polish previous revision: if the fts_* routines have lstat()'ed thedelphij2012-06-201-2/+8
| | | | | | | | | | | | | | | | | | 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. Obtained from: OpenBSD MFC after: 1 week
* | Fix potential symlink race condition in "rm -P" by adding a checkkevlo2012-06-201-2/+9
|/ | | | | | | that the file we have opened is the one we expected. Also open in non-blocking mode to avoid a potential hang with FIFOs. Obtained from: NetBSD via OpenBSD
* Put some static keywords in the source code.ed2011-10-311-4/+4
| | | | | | For these simple utilities, it doesn't harm to make all global variables static. In fact, this allows the compiler to perform better forms of optimisation and analysis.
* bin: Prefer strrchr() to rindex().jilles2011-03-151-1/+1
| | | | This removes the last index/rindex usage from /bin.
* Fix typo and grammar nituqs2010-10-311-2/+2
| | | | | Submitted by: arundel MFC after: 7 days (or when the bikeshed has abated)
* Elaborate some more on the non-security implications of using -Puqs2010-10-311-6/+15
| | | | | Submitted by: delphij Discussion at: svn-src-all
* Language cleanup.des2010-10-271-3/+3
|
* rm(1): clarify that -P works only when blocks are updated in-placeuqs2010-10-082-6/+6
| | | | Suggested by: pjd, ivoras, arundel
* Clarify the combination effect of -P and -f to make it clear.delphij2010-10-041-3/+7
| | | | | Submitted by: arundel MFC after: 2 weeks
* rm, find -delete: fix removing symlinks with uchg/uappnd set.jilles2009-05-301-3/+3
| | | | | | | | | | | | Formerly, this tried to clear the flags on the symlink's target instead of the symlink itself. As before, this only happens for root or for the unlink(1) variant of rm. PR: bin/111226 (part of) Submitted by: Martin Kammerhofer Approved by: ed (mentor) MFC after: 3 weeks
* Implement ^T support for rm: now it will report the next file itimp2009-04-291-0/+29
| | | | | | removes when you hit ^T. This is similar to what's done for cp. The signal handler and type definitions for "info" were borrowed directly from cp.
* Give a hint to the reader as to what the "whiteout" actually means.ru2006-12-261-2/+3
|
* Fix markup, add the EXIT STATUS section.ru2006-12-261-7/+12
|
* Correct a security issue introduced in previous commit:delphij2006-10-312-3/+11
| | | | | | | | | | | | | | | | | | | | 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
* Be more reasonable when overwrite mode is specified while theredelphij2006-10-302-1/+8
| | | | | | | | | 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
* o Backout rev. 1.55. Don't waste cpu cycles for bzero(), do notmaxim2006-10-181-2/+1
| | | | | | call chflags() for whiteouted files. Prodded by: ru
* o Zero out struct stat before usage. lstat(2) can fail andmaxim2006-10-181-0/+1
| | | | | | | | leave garbage there which will break -W code path. PR: bin/84569 Submitted by: Igor MFC after: 2 weeks
* o Be pedantic and do fts_close() when done.maxim2006-04-151-0/+1
| | | | | | PR: bin/95292 Submitted by: Charles Hardin Obtained from: NetBSD via OpenBSD, PR
* -mdoc sweep.ru2005-11-171-1/+1
|
* Give .Dd a tummy rub, forgotten on my last commit.dougb2005-09-301-1/+1
|
* Handle the case where the -P flag is specified for a read-only filedougb2005-09-292-4/+9
| | | | | | | | | | | | | | 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@
* Sync program's usage() with manpage's SYNOPSIS.ru2005-02-091-1/+2
|
* Remove unnecessary SRCS= where could be guessed directly by ourdelphij2005-01-271-1/+0
| | | | | | bsd.*.mk infrasture. Obtained from: ru
* Add the new standard EXIT STATUS section where appropriate.ru2005-01-161-16/+16
| | | | Sort standard sections in the (documented) preferred order.
* /*- or .\"- or #- to begin license clauses.imp2005-01-101-0/+1
|
* UNIX conformance: If -r -f on non-existent directory, don't emit error.jkh2004-11-131-1/+4
|
* Correct a typo and make the documentation more mdoc(7) complaint.delphij2004-11-011-3/+3
| | | | | Pointed out by: dd Approved by: murray (mentor)
* Add -I, an option that asks for confirmation once if recursivelydelphij2004-10-282-5/+70
| | | | | | | | | | | | | | | | | | | | | 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
* The previous commit added code to rm(1) to warn about and remove anydes2004-10-041-1/+2
| | | | | | | | | | | | | | | occurrences of "/" in the argument list. This corresponds to Enhancement Request Number 5 in the Austin Group TC2 Aardvark's XCU Defects Report (<URL:http://www.opengroup.org/austin/aardvark/finaltext/xcubug.txt>). Further discussion is available in the Austin Group mailing list archives (<URL:http://www.opengroup.org/austin/mailarchives/>, "Defect in XCU rm") and for Austin Group members, in the Austin Group Interpretations archive (<URL:http://www.opengroup.org/austin/interps/>, AI-019) This commit makes that check conditional on !POSIXLY_CORRECT, since it is not strictly correct according to the current version of the standard (but is expected to be correct according to the next version, and has already been adopted by Solaris).
OpenPOWER on IntegriCloud