On Saturday 20 April 2002 08:22, Peter Pan wrote: > setuid(0); > if(getuid()){ > printf("must be suid root.\n"); > } else { > <snip> > system("/bin/sh"); <snip>
Hm... Wouldn't it be an idea to postpone that setuid(0) to _after_ you're checked that the md5sums match (optionally change back to the old uid after you've verified that you have permission to setuid(0))? I guess it doesn't have any practical effect, but it's a matter of good programming practice. A program doesn't need to have root privileges to get the password and verify it. Image the scenario that there is a vulnerability in the hexToString function. That piece of good programming practice would make all the difference in the world... ;) Regards, -- Joachim Blaabjerg [EMAIL PROTECTED] www.SuxOS.org