Reply to post: Re: Sounds Really Clever?

Little warning: Deleting the wrong files may brick your Linux PC

Kristian Walsh Silver badge

Re: Sounds Really Clever?

It's nothing to do with systemd. Nothing. The driver isn't trapping the case where the user wipes the objects that the driver exposes through the /sys/ hierarchy. You don't even need rm -rf / for this; you can just cd into the appropriate directory and issue rm -rf *

This is a longstanding "problem" with the Unix permissions model. "Write" always implies "delete", but these are actually separate permissions, and other, non-Unix-derived OS treat them as such. Actually, Unix is the odd-one-out here, but its ubiquity makes people think that its behaviour is the norm.

For comparison, VMS had "Read, Write, Execute, Delete"; Windows NT unsurprisingly maps the VMS permissions to "Read, Modify[=Write], Execute, Full Access[ which allows Delete]" - on both these systems, being able to write means only that: you can open the object, and modify its contents, even truncate it, but you can't remove it from the filesystem. Even CP/M's limited model distinguished between deletion and writing: the two permissions settings possible on a file were write-access [RO=off] and deletion [System=off].

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon