Bug 29887

Summary: chflags can not set 'noschg' to files in multiuser mode; can't update /kernel.
Product: Base System Reporter: Chris Fernando <chris_fernando>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Chris Fernando 2001-08-20 06:00:00 UTC
after setting a file with chflags to 'schg', you can not unset ('noschg') it in multiuser mode. you must boot the system into single user mode to make changes to the file.

example in multiuser:
styx ~ #touch foo
styx ~ #chflags schg foo
styx ~ #chflags noschg foo
chflags: foo: Operation not permitted

How-To-Repeat: 1) create a file
2) chflags schg <filename>
3) chflags noschg <filename>

step 3 should produce the error
Comment 1 greid freebsd_committer freebsd_triage 2001-08-20 06:08:36 UTC
State Changed
From-To: open->closed

You are running in securelevel >= 1, see init(8).