mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 01:31:08 +00:00
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:
parent
e663897512
commit
71fccca961
1 changed files with 19 additions and 13 deletions
|
@ -1173,19 +1173,6 @@ init_ports()
|
||||||
exit(1);
|
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.
|
* Set up masks to say we are interested in these descriptors.
|
||||||
*/
|
*/
|
||||||
|
@ -3328,6 +3315,25 @@ printf(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
init_ports(); /* Create ports to handle requests. */
|
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. */
|
init_probe(); /* Probe other name servers on net. */
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
|
|
Loading…
Reference in a new issue