More security stuff.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6322 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 2000-03-18 17:29:32 +00:00
parent e663897512
commit 71fccca961

View file

@ -1173,19 +1173,6 @@ init_ports()
exit(1);
}
/*
* Try to become a 'safe' user now that we have
* done everything that needs root priv.
*/
if (getuid () != 0)
{
setuid (getuid ());
}
else
{
setuid (-1);
}
/*
* Set up masks to say we are interested in these descriptors.
*/
@ -3328,6 +3315,25 @@ printf(
}
}
init_ports(); /* Create ports to handle requests. */
/*
* Try to become a 'safe' user now that we have
* done everything that needs root priv.
*/
if (getuid () != 0)
{
setuid (getuid ());
}
else
{
setuid (-1);
}
/*
* As another level of paranoia - restrict this process to /tmp
*/
chdir("/tmp");
chroot("/tmp");
init_probe(); /* Probe other name servers on net. */
if (debug)