hello everybody,
I've a test programm which create child with new pid, but how ran new child from user if parent runing from root?
For instanse, I need bind low tcp port(which > 1024) with root privileges and then send\recv data with user privilages.
After you fork(), in the child process call setuid() or seteuid() (as appropriate) giving it the uid you just looked up, and now the child process will be executing as that user id instead of root.