Hi,

I don't understand this piece of code:

if (getuid() == 0 || geteuid() != 0)

Why check if the geteuid() != 0 if we are only wanting to root to run the
block inside the if statement?

My reasoning is that if geteuid != 0 then the statement evaluates to true
and the code block gets run just like the statement evaluates to true if
the process does have uid of 0. This doesn't make sense to me.

Can anyone draw a better diagram to help me make some sense of this?


James

Reply via email to