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