Schmuck Bait Real Life Discussion

Collapse/Expand Topics

08:10:57 AM Jan 13th 2013
Re the Unix rm-rf /;

At a place where I worked as a Unix system administrator, a man managed to change the permissions on every file and directory on a Unix box with one mistake in a command. Working as root, he had just created a filesystem, just below the root directory and loaded quite a few files into it. He wanted to change the permissions on all the files and directories to rwxr-xr-x, including a large number of files with a dot as the first character in the name, and so went to the top of the filesystem and entered the command

chmod -r 755 * .*

What he failed to consider is that one of the expansions of ".*" is "..", and ".." was, of course, /

It took over a day and a half to fix this. Incidentally, he turned off all setuid and setgid, named pipes and so on because chmod 755 is actually interpreted as chmod 0755, and the first byte of the permissions has the setuid and setgid permissions.
Collapse/Expand Topics