- if (!use_privsep)
- goto skip_privilegeseparation;
-
- /* Set up unprivileged child process to deal with network data */
- monitor = monitor_init();
- /* Store a pointer to the kex for later rekeying */
- monitor->m_pkex = &xxx_kex;
-
- pid = fork();
- if (pid == -1)
- fatal("fork of unprivileged child failed");
- else if (pid != 0) {
- debug2("Network child is on pid %d", pid);
-
- close(monitor->m_recvfd);
- authctxt = monitor_child_preauth(monitor);
- close(monitor->m_sendfd);
-
- /* Sync memory */
- monitor_sync(monitor);
- goto authenticated;
- } else {
- close(monitor->m_sendfd);
-
- /* Demote the child */
- if (getuid() == 0 || geteuid() == 0)
- privsep_preauth_child();
- }
-
- skip_privilegeseparation: