On Thu, 16 Nov 2000, H. Peter Anvin wrote:
> BUG: you *MUST* chdir() into the chroot jail before it does you any
> good at all!
>
> I usually recommend:
#include <sysexits.h>
/* for EX_NOUSER */
> mkdir("foo");
> chdir("foo");
> chroot(".");
add this:
/* DO REPLACE 500 BY AN EXISTING USER ID */
/* DO NOT REPLACE IT BY 0! */
/* DO NOT USE OTHER FUNCTIONS THAN setuid() */
if(setuid(500)) { _exit(EX_NOUSER); }
(For the records and search engines, most people should know that, but
to have it all in one mail.)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/
- Re: Linux 2.2.18pre21 Rogier Wolff
- Re: Linux 2.2.18pre21 kuznet
- Re: Linux 2.2.18pre21 Rogier Wolff
- Re: Linux 2.2.18pre21 kuznet
- Re: Linux 2.2.18pre21 Rogier Wolff
- Re: Linux 2.2.18pre21 Matthias Andree
- Re: Linux 2.2.18pre21 Peter Samuelson
- Re: Linux 2.2.18pre21 H. Peter Anvin
- Re: Linux 2.2.18pre21 Peter Samuelson
- Re: Linux 2.2.18pre21 H. Peter Anvin
- Re: Linux 2.2.18pre21 Matthias Andree
- Re: Linux 2.2.18pre21 jesse
- Re: Linux 2.2.18pre21 Pavel Machek
- Re: Linux 2.2.18pre21 Nix
- Re: Linux 2.2.18pre21 Peter Samuelson
- Re: Linux 2.2.18pre21 willy tarreau
- Re: Linux 2.2.18pre21 Matti Aarnio
- Re: Linux 2.2.18pre21 Constantine Gavrilov
- Re: Linux 2.2.18pre21 Matti Aarnio
- Re: Linux 2.2.18pre21 Constantine Gavrilov
- Re: Linux 2.2.18pre21 Matti Aarnio

