Bug ID: 212861
           Summary: [tmpfs] uchg files can be removed by root
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern

This issue seems to be present on tmpfs, only (it always returns EPERM on UFS).
Not sure about ZFS.

Found by contrib/netbsd-tests/fs/tmpfs/ .

The following command snippets demonstrate the repro:

Invariant tested with UFS:

$ touch /tmp/uchg.file
$ chflags uchg /tmp/uchg.file
$ rm -f /tmp/uchg.file
rm: /tmp/uchg.file: Operation not permitted
$ rm /tmp/uchg.file 
override rw-r--r--  ngie/wheel uchg for /tmp/uchg.file? y
rm: /tmp/uchg.file: Operation not permitted

Invariant tested with tmpfs:

$ mntpt=/tmp/tmpfs
$ mkdir $mntpt
$ sudo mount -t tmpfs tmpfs $mntpt
$ cd $mntpt
$ touch uchg.file; chflags uchg uchg.file
$ rm -f uchg.file 
rm: uchg.file: Operation not permitted
$ sudo rm -f uchg.file 
$ ls uchg.file 
ls: uchg.file: No such file or directory

You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________ mailing list
To unsubscribe, send any mail to ""

Reply via email to