ok, I can go with that. In that case, my question becomes how can I test to see that my program was started via sudo? If I'm not mistaken, sudo does not check UID?
Comment on Re^2: getting root permissions via program
If your program is owned by root, and only executable by root, then no one will be allowed to run it unless they are root, or use sudo, so you don't really need to check further.