No, root can still run chmod, because its superuser privileges override the new restrictive directory perms. That was my point.
Maybe the original problem was actually "chmod a-rwx /bin/chmod" ... That would mean even the superuser couldn't execute /bin/chmod anymore, so you'd have to do something more creative to reset the executable bit on /bin/chmod. Like compile a C program that calls the chmod system call, or:
The explanation for what made him type that is what interests me. It would be like accidentally cutting your left hand clean off with a steak knife while you were eating dinner.
My bash is set to use vim bindings (set -o vi) and I constantly loop through commands. I am guilty of doing this while sleepy and sometimes I think I have cd to another directory when in fact I have not. I rm-ed (too) many things that way.
fjarlq|11 years ago
Maybe the original problem was actually "chmod a-rwx /bin/chmod" ... That would mean even the superuser couldn't execute /bin/chmod anymore, so you'd have to do something more creative to reset the executable bit on /bin/chmod. Like compile a C program that calls the chmod system call, or:
pantalaimon|11 years ago
The compiler wouldn't be executable anymore either
mtdewcmu|11 years ago
johnchristopher|11 years ago
r4um|11 years ago