Bug 126433 - [patch] some missing checks in rm(1)
Summary: [patch] some missing checks in rm(1)
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 6.3-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2008-08-10 21:10 UTC by Ighighi
Modified: 2018-01-03 05:13 UTC (History)
0 users

See Also:

file.diff (1.23 KB, patch)
2008-08-10 21:10 UTC, Ighighi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ighighi 2008-08-10 21:10:04 UTC
rm(1) allows root to delete uchg/uappend files.  Before unlinking, it checks
whether schg|sappend are set to skip the chflags() system call that clears
uchg and uappend.

It must also check whether uunlink|sunlink are set as they'd also make unlink()
fail later.

PS: Can anyone explain to me the usefulness of letting root skip uchg/uappend?
FreeBSD and DragonFly are the only BSD's that do this.
I'm playing with a -F option to unset uchg/uappend/uunlink for any user. The 
patch is available to anyone on request.

Fix: Attached patch successfully built and tested on RELENG_6 & -CURRENT sources.

Patch attached with submission follows:
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:52 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped