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)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2008-08-10 21:10 UTC by Ighighi
Modified: 2022-10-17 12:35 UTC (History)
0 users

See Also:


Attachments
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
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:35:28 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>