News for hackers. Stuff that matters.
Re:Rm -rf remains by fjarlq on Saturday June 14, 2014 @04:24AM (#7892357)
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:

  mv /bin/chmod /bin/chmod.orig
  cp -p /bin/ls /bin/chmod
  cp /bin/chmod.orig /bin/chmod
Re:Rm -rf remains by pantalaimon on Saturday June 14, 2014 @07:52AM (#7892613)
> Like compile a C program that calls the chmod system call

The compiler wouldn't be executable anymore either

Re:Rm -rf remains by claviola on Saturday June 14, 2014 @11:05AM (#7892886)
Yes, it would. Like he said, you can still run it unless you specifically removed its permissions.