I'd like to fork and exec and program as a non root user while the parent retains root permissions.
pseudo code:
pid = fork();
if (pid == 0) {
if (RunAsUser(ConvertStringToUserId("John")) == false) {
stop();
}
if (RunAsUser(ConvertStringToUserId("admin")) == true) {
stop();
}
CreateProcess();
}