I think that you should be able to do what you are trying to accomplish
using setuid(2) and seteuid(2) (See the man pages)
One thing to note is: if the user is root or the process is setuid root
all processes related ID's are set to uid, after this has occured it
is impossible for the process to regain root privilege.
Hope this is of help.