From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: permission denied: /gnu/store/...guile... Date: Sat, 23 May 2015 16:22:28 +0200 Message-ID: <87mw0ve5ln.fsf@gnu.org> References: <14d70199695.1243810498111.5252599218489536710@elephly.net> <87617knzbm.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwAJy-0007CV-6E for guix-devel@gnu.org; Sat, 23 May 2015 10:22:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YwAJt-0000Zp-5Q for guix-devel@gnu.org; Sat, 23 May 2015 10:22:38 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwAJt-0000Zl-1P for guix-devel@gnu.org; Sat, 23 May 2015 10:22:33 -0400 In-Reply-To: <87617knzbm.fsf@netris.org> (Mark H. Weaver's message of "Fri, 22 May 2015 16:15:41 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mark H Weaver Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mark H Weaver skribis: > The problem turned out to be that on rekado's system, / was owned by > user "rekado" with mode 700. Oh, I see. I would never have thought of this! > Perhaps 'guix system init' should explicitly set the ownership and > permissions on the target root directory? Here=E2=80=99s a tentative patch. I wonder if the activation code shouldn=E2=80=99t systematically do (chown "/" 0 0) as well. Thoughts? Thank you both for investigating! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 8d5fbe5..2cf6a43 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -145,6 +145,14 @@ When GRUB? is true, install GRUB on DEVICE, using GRUB.CFG." ;; Copy items to the new store. (copy-closure to-copy target #:log-port log-port))))) + ;; Make sure TARGET is root-owned when running as root, but still allow + ;; non-root uses (useful for testing.) + (if (zero? (getuid)) + (chown target 0 0) + (warning (_ "not running as 'root', so \ +the ownership of '~a' may be incorrect!~%") + target)) + (let ((os-dir (derivation->output-path os-drv)) (format (lift format %store-monad)) (populate (lift2 populate-root-file-system %store-monad))) --=-=-=--