From patchwork Fri Feb 21 13:05:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 38911 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8CAFD27BBEA; Fri, 21 Feb 2025 13:10:59 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8910A27BBE2 for ; Fri, 21 Feb 2025 13:10:58 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tlSnM-00061Q-O6; Fri, 21 Feb 2025 08:10:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tlSn7-0005wl-2S for guix-patches@gnu.org; Fri, 21 Feb 2025 08:10:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tlSn6-000580-FL for guix-patches@gnu.org; Fri, 21 Feb 2025 08:10:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=O9Cnga7box/1rcpw3VHiKXPbujUc92KmLXmRuqngb6k=; b=P7zE5EvIWvhwyYKCgmOubbY5Y+V2+kz3d19PAmF4WnfgXblBM//2bwGoFz9DZuCLmzil2rq9WdfAijOXX9ssPhvbaVCicSMsa7cMr+49zMiaXFVBHws5nwqcI9irDSVodBfTMaIYrpWigmMLOX0GJSwJ65X2Ivp9DkeHwB8wLWymgwYYJ8UtFRB8EH+njyevalpMGbeKe30WoMX5RdI95zZcNAkvFPYS0VbndU8u0FGhOlEOo+VnUVKPizjdy0Vbiwix8C4womk+ZgxKwtRI6gtUinN4Pqdg6OEs6nlasSYEutbSVrOK/O6ftwphnHKPWSn7v+VHetKJcSHSuf3lWQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tlSn6-0005wj-5h for guix-patches@gnu.org; Fri, 21 Feb 2025 08:10:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75810] [PATCH v3 09/11] daemon: Move comments where they belong. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 21 Feb 2025 13:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75810 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75810@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 75810-submit@debbugs.gnu.org id=B75810.174014335122353 (code B ref 75810); Fri, 21 Feb 2025 13:10:04 +0000 Received: (at 75810) by debbugs.gnu.org; 21 Feb 2025 13:09:11 +0000 Received: from localhost ([127.0.0.1]:56699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tlSmC-0005o8-UZ for submit@debbugs.gnu.org; Fri, 21 Feb 2025 08:09:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60064) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tlSjz-0005PH-Re for 75810@debbugs.gnu.org; Fri, 21 Feb 2025 08:07:04 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tlSju-0004Zc-7k; Fri, 21 Feb 2025 08:06:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=O9Cnga7box/1rcpw3VHiKXPbujUc92KmLXmRuqngb6k=; b=Udu5iZBOsTuJRHw4R6qH ZDFS4h8FKfsU+cwOvU48gwqFjUYnhfw7Y67b854brijWZ8Ab80CPJyB1Z0jkeXLuX1k0+3ABEVZwc 7po5z8NrKtsJ9XeMy1qid1Ck/QfeJt6jDq6Plx7XaUCNCmYcmUPBqpcV+Z+9G80sRhBa7L/avyKde 0p90m6lUtYcW7UvDCW45kuNIJdaNobxe0EgcKXi3Wdbt9WGQ0Fu9DXrtjUwyYLxcslVXfrfnSmR0X UHBxv7wcerNqL5SavyCZxmcH7BNn1jYxsEjJHaFTx9WDqFDA72xwNOVjj6q1wqdmUm8fnPjXXRwud WlfxrVUapjKQPg==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 21 Feb 2025 14:05:57 +0100 Message-ID: X-Mailer: git-send-email 2.48.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * nix/libstore/build.cc (DerivationGoal::startBuilder): Shuffle comments for clarity. Change-Id: I6557c103ade4a3ab046354548ea193c68f8c9c05 --- nix/libstore/build.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index 213ed635933..c8a0667c7b5 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -1874,18 +1874,19 @@ void DerivationGoal::startBuilder() } dirsInChroot[tmpDirInSandbox] = tmpDir; - /* Make the closure of the inputs available in the chroot, - rather than the whole store. This prevents any access - to undeclared dependencies. !!! As an extra security - precaution, make the fake store only writable by the - build user. */ + /* Create the fake store. */ Path chrootStoreDir = chrootRootDir + settings.nixStore; createDirs(chrootStoreDir); chmod_(chrootStoreDir, 01775); if (buildUser.enabled() && chown(chrootStoreDir.c_str(), 0, buildUser.getGID()) == -1) - throw SysError(format("cannot change ownership of ‘%1%’") % chrootStoreDir); + /* As an extra security precaution, make the fake store only + writable by the build user. */ + throw SysError(format("cannot change ownership of ‘%1%’") % chrootStoreDir); + /* Make the closure of the inputs available in the chroot, rather than + the whole store. This prevents any access to undeclared + dependencies. */ foreach (PathSet::iterator, i, inputPaths) { dirsInChroot[*i] = *i; }