From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1NMpm0-0003eV-F3 for garchives@archives.gentoo.org; Mon, 21 Dec 2009 21:26:36 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 66888E05B1; Mon, 21 Dec 2009 21:25:19 +0000 (UTC) Received: from mail-fx0-f217.google.com (mail-fx0-f217.google.com [209.85.220.217]) by pigeon.gentoo.org (Postfix) with ESMTP id 21BD9E05B1 for ; Mon, 21 Dec 2009 21:25:19 +0000 (UTC) Received: by fxm9 with SMTP id 9so5178199fxm.30 for ; Mon, 21 Dec 2009 13:25:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:from:to :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=r3hCJPBWdFYNn/SlYMYTzlZ8PbA5s99CeWU81wL38Is=; b=EOxc/XMyDmG5QhLhle4GQBfQNcKI00lL7w3aqXifTvOIq6exhcWlDLejtbqNBNEamQ tVAlZTahdZ13d5E7HEJlm+xvfG3YSR1YYenT8CAiQ8TCCb6FvmsXh9aSInKlbkfCJaFJ zUb80U6TCf7XBpV0D3UFvhAqfOTZC8ILKKlvI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:from:to:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=BJNbiSghJAY7FXpPbBWpWxlPIirWXIZL3NFMUupEVSCzYC8eBLbR1W6mHVt/I6U2bu yP+Hc/q8qj2CHdpZ/4d03vZSuo/DEt6ungXRBFDV6YAFmgoW5nr6XZUC9KjE+bHwQfxY tMyQ96xokTQz8y6ro4EEBESlt8fF+TMuvOxuA= Received: by 10.223.161.212 with SMTP id s20mr10383263fax.2.1261430718489; Mon, 21 Dec 2009 13:25:18 -0800 (PST) Received: from ?192.168.1.66? ([41.237.77.199]) by mx.google.com with ESMTPS id b17sm9061779fka.46.2009.12.21.13.25.12 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Dec 2009 13:25:12 -0800 (PST) Sender: Ahmed Ammar Subject: Re: [gentoo-embedded] emerge --root : users not created From: Ahmed Ammar To: gentoo-embedded@lists.gentoo.org In-Reply-To: <20091215173725.19644.qmail@stuge.se> References: <166af1cf0912140817j66fb0ba3q96f1e8285790bc8@mail.gmail.com> <4B267265.7080406@wildgooses.com> <3dc1583f0912140947q106e673fkcb541cc8929c0321@mail.gmail.com> <20091214180657.29028.qmail@stuge.se> <4B274E81.7060005@chaintronics.com> <20091215103359.12281.qmail@stuge.se> <1260883909.9491.2.camel@gentoo-dev> <20091215173725.19644.qmail@stuge.se> Content-Type: text/plain; charset="UTF-8" Date: Mon, 21 Dec 2009 23:25:12 +0200 Message-ID: <1261430712.26386.6.camel@gentoo-dev> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-embedded@lists.gentoo.org Reply-to: gentoo-embedded@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: da1988e6-fb63-441a-80db-019cc741ec51 X-Archives-Hash: e7c750d23bbffbf2705f69909fb5267b 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.