4 ms·
What's clever about that code is that the conditional will always fail. The assignment expression setting the uid to 0 will itself evaluate to 0, which will cau
by seliopou 13y ago
What's clever about that code is that the conditional will always fail. The assignment expression setting the uid to 0 will itself evaluate to 0, which will cause the conjunction to evaluate to "false." On first glance, the code makes you believe that the body of the conditional is necessary, when it's in fact dead code. That's nice camouflage.
- cynwoody 13y agoAlso clever is the fact that the first clause acts as a password, so that the backdoor opens only if called with the supposedly invalid option combination.
- cjensen 13y agoI like the extra parens in the if condition. It's genius. On the face of it, it appears that the parens are to ensure correct operator precedence because a bitwise OR is used (a common idiom because bitwise operators have the wrong precedence versus comparison in C). But that's not what the parens are really for! They are there because gcc complains about assignments inside of conditionals unless you put parens around it.