From owner-freebsd-arch@FreeBSD.ORG Fri Jul 27 08:37:08 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB1DA106566B; Fri, 27 Jul 2012 08:37:08 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 9815C8FC1A; Fri, 27 Jul 2012 08:37:08 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 2CC596CD7; Fri, 27 Jul 2012 10:37:02 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 0A34F8255; Thu, 26 Jul 2012 12:14:37 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Benjamin Kaduk References: <20120626063017.D05DA58081@chaos.jnpr.net> Date: Thu, 26 Jul 2012 12:14:37 +0200 In-Reply-To: (Benjamin Kaduk's message of "Tue, 24 Jul 2012 19:22:43 -0400 (EDT)") Message-ID: <86ipdarfqq.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Tim Kientzle , freebsd-arch@freebsd.org, Robert Millan , Simon Gerraty Subject: Re: Allow user install X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 08:37:09 -0000 Benjamin Kaduk writes: > Tim Kientzle writes: > > Does fakeroot itself require root permissions to run? Of course not. What would be the point if it did? > > I was under the impression that it used some form of > > loopback mount which --- at least in FreeBSD --- still > > requires root permissions. > I thought it was an LD_PRELOAD wrapping g/setuid and friends. It is. It actually wraps a large number of syscalls; it needs to keep track of what the wrapped program thinks the ownership and permissions of files it has created or modified are, etc. so you can do fakeroot the equivalent of "make all install package" and end up with a tarball that contains the right ownership and permission information. There is a competing implementation that uses PTRACE instead, which allows it to also handle static binaries. Unfortunately, FreeBSD's PTRACE breaks job control. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no