On Tue, 2009-12-15 at 18:37 +0100, Peter Stuge wrote > useradd is a C program and my idea is to make it use the chroot() > system call. This system call changes the root directory for the > calling process. The chroot utility uses this system call, and then > executes a shell or other program inside the new root. The utility > will of course not work cross platform. > > As long as the useradd C program does not rely on other executables > at runtime, which I severly doubt considering the nature of the > program, calling chroot() early in useradd would work regardless of > what binaries, if any, are inside the new root dir. useradd only > touches the user database text files.
Sounds like a simple enough idea. Patches welcome? Might be worth looking at how Gentoo Prefix does it first though. A.
