Bug 126433

Summary: [patch] some missing checks in rm(1)
Product: Base System Reporter: Ighighi <ighighi>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: 6.3-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

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