. Implement chroot.

This commit is contained in:
Emil Mikulic 2003-11-27 05:45:43 +00:00
parent 45ac8883e0
commit 6312e230fb
1 changed files with 7 additions and 1 deletions

View File

@ -17,7 +17,7 @@
* x If-Modified-Since.
* x Test If-Mod-Since with IE, Phoenix, lynx, links, Opera
* x Keep-alive connections.
* . Chroot
* x Chroot
* x Set{uid|gid}.
* . Port to Win32.
* x Detect Content-Type from a list of content types.
@ -2083,6 +2083,12 @@ int main(int argc, char *argv[])
err(1, "signal(SIGQUIT)");
/* security */
if (want_chroot)
{
if (chroot(wwwroot) == -1) err(1, "chroot(\"%s\")", wwwroot);
debugf("chrooted to `%s'\n", wwwroot);
wwwroot[0] = '\0'; /* empty string */
}
if (drop_gid != INVALID_GID)
{
if (setgid(drop_gid) == -1) err(1, "setgid(%d)", drop_gid);