The article implies that the code after if , which was to be executed only if it was verified that the user was root, could indeed be executed by someone. To use it, you are looking for a branch in the code in which the test is used to verify the identity of the user (which the article does not provide responsibly: you need to work a little), and you agree that this will be performed.
"allowed to get root access" is an ellipsis that describes what happens after if in the source code. This is not particularly relevant to the test, because it describes what happens after it.
In other words, the test itself does not make you root. The code then makes you root. Also, keep in mind that server X often needs to be installed with the owner of the root and setuid bit set , which is why erroneous logic in its code is dangerous.
This is not a question about C. This is a question about the Unix security model, which is terribly binary (especially in older implementations): you have to be root to do something, so the number of programs has root and setuid bits (a bit of a caricature).
Pascal cuoq
source share