
Chmod -x chmod - sown
http://www.slideshare.net/cog/chmod-x-chmod
======
hugh3
It might be an interesting topic, but wouldn't it be better if reformatted
into a single page of text (there's what, 300 words there?) rather than 49
slides?

~~~
pak
People seem to be more and more fixated on the "one thing per rapidly changing
slide" style of presentation nowadays. I can certainly see the advantages of
having only one thing in your audience's mind at a time as you blab--they're
more focused, and the rapidly changing slides fits better with modern
attention spans. But it definitely kills the utility of the slides on their
own.

For an even more difficult to follow slide deck see the git tricks
presentation currently on the frontpage. 328 slides!

~~~
koenigdavidmj
Looks like it was Lawrence Lessig who first brought the method into our
community (technically inclined content aficionados) with his lectures.

~~~
_delirium
I think the style that Lessig popularized is a bit more extreme, along the
lines of one slide per second or two, often with sentences split up across
slides, and transitions synchronized with gestures or intonation. That makes
the slides sort of a performance-art prop.

------
aes
The simplest way I could figure out was:

cp sh chmod.new

cp chmod chmod.new

~~~
mrb
IMO the simplest way is:

$ /lib/ld-linux-x86-64.so.2 /bin/chmod +x /bin/chmod

ELF files run by manually launching the dynamic loader don't require the
executable bit.

~~~
CUViper
I agree that this is easiest, and I'm surprised that the article calls it
"hardcore" (slides 38-39). But it does bring to mind a more devious challenge:
_Someone ran "chmod -x ld.so"..._

~~~
xtacy
What about:

    
    
      find / -type f -perm +x | xargs chmod -x
    

EDIT: chmod has to be the last program to be chmodded, in the above list.. :-)

~~~
tange
Your use of xargs can lead to nasty surprises because of the separator problem
<http://en.wikipedia.org/wiki/Xargs#The_separator_problem>

GNU Parallel <http://www.gnu.org/software/parallel/> does not have that
problem.

Watch the intro video for GNU Parallel:
<http://www.youtube.com/watch?v=OpaiGYxkSuQ>

~~~
ralph
GNU Parallel isn't needed to avoid this, using find's -print0 and xargs's -0
would suffice. The advert is unwarranted.

------
dinkumthinkum
This is neat but it sort of seems kind of trivial to solve. I guess it's
interesting to see the different possibilities but if you are allowed to write
some kind of program then it's just totally trivial.

~~~
mfukar
Don't know why you were downvoted, the whole chmod "problem" is a storm in a
teacup.

I'm surprised nobody commented on the last guy's reply (no problem had
occurred yet). Apparently all were busy watching the sky fall.

------
acg
This appears to be an interview problem, possibly to determine how candidates
think. It reminds me of stories like this:

<http://www.ee.ryerson.ca/~elf/hack/recovery.html>

------
mtts
I'm stupid, I guess. I saw the last slide ("there is no problem as the system
is still running" (and chmod can therefore still be executed)) and thought
that was the solution.

Once again I've learned that for every problem there is a solution that is
clear, simple and wrong (and that I myself am quite likely to hit upon this
solution).

If you try it, you'll find that it doesn't, in fact, work. Apparently the
shell performs a lookup of the access rights of the program you're trying to
execute, meaning once you've done "chmod -x chmod", you really have created
yourself a problem.

I'd now say the solution is something like this:

cp -pr /bin/chown /bin/chown.safe

cp /bin/chmod /bin/chown

chown 755/bin/chmod

cp /bin/chown.safe /bin/chown

[edit: formatting]

~~~
amackera
I think the last slide just points out that there is no problem. The presenter
never said you had to fix the chmod situation, just that the machine can't be
rebooted. Maybe I misinterpreted...

------
GrayRoark
I remember a presentation he did some years ago for YAPC too: slides:
[http://www.slideshare.net/cog/obfuscation-golfing-and-
secret...](http://www.slideshare.net/cog/obfuscation-golfing-and-secret-
operators-in-perl) vídeo: <http://yapc.tv/2005/ye/cog-black-magick/>

Interesting stuff.

