[issue1570] HAMMER: you can newfs a mounted hammer device

Antonio Huete Jimenez (via DragonFly issue tracker) sinknull at leaf.dragonflybsd.org
Sun Oct 18 12:10:19 PDT 2009


Antonio Huete Jimenez <tuxillo at quantumachine.net> added the comment:

Finally I did last changes by request:
http://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff/87b0928085ae33591193b69255bd35cc46e5a5ed

I've tested it and it seems to work:

Writing to R/O is permitted.
-------------------------------------------------
vmware# mount -o ro /dev/da0s1d /mnt/test/
vmware# ./testwrite da0s1d
Opened /dev/da0s1d for writing: fd 3

Writing to R/W not allowed
-------------------------------------
vmware# umount /mnt/test/
vmware# mount -o rw /dev/da0s1d /mnt/test/
vmware# ./testwrite ad0s1a
/dev/ad0s1a opening failed
open: Device busy

When securelevel set >= 1, no writing allowed
-------------------------------------------------
vmware# umount /mnt/test/
vmware# mount -o ro /dev/da0s1d /mnt/test/
vmware# sysctl kern.securelevel=1
kern.securelevel: -1 -> 1
vmware# ./testwrite da0s1d
/dev/da0s1d opening failed
open: Operation not permitted

_____________________________________________________
DragonFly issue tracker <bugs at lists.dragonflybsd.org>
<http://bugs.dragonflybsd.org/issue1570>
_____________________________________________________





More information about the Bugs mailing list