From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wAZvJBgtwmFSMQEAgWs5BA (envelope-from ) for ; Tue, 21 Dec 2021 20:38:00 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gO/eHxgtwmFiPwAAbx9fmQ (envelope-from ) for ; Tue, 21 Dec 2021 19:38:00 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 56DFB5B7A for ; Tue, 21 Dec 2021 20:38:00 +0100 (CET) Received: from localhost ([::1]:36074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzkxT-000263-3G for larch@yhetil.org; Tue, 21 Dec 2021 14:37:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzkwY-00023e-2A for guix-patches@gnu.org; Tue, 21 Dec 2021 14:37:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44150) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzkwX-0004Fp-PD for guix-patches@gnu.org; Tue, 21 Dec 2021 14:37:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mzkwX-00077l-Kk for guix-patches@gnu.org; Tue, 21 Dec 2021 14:37:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52712] [PATCH v2 4/4] services: cuirass: Ensure correct ownership of directory trees. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Dec 2021 19:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52712 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52712@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164011541727355 (code B ref -1); Tue, 21 Dec 2021 19:37:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Dec 2021 19:36:57 +0000 Received: from localhost ([127.0.0.1]:55693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzkwT-000777-77 for submit@debbugs.gnu.org; Tue, 21 Dec 2021 14:36:57 -0500 Received: from lists.gnu.org ([209.51.188.17]:37522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzkwS-00076t-0q for submit@debbugs.gnu.org; Tue, 21 Dec 2021 14:36:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzkwR-0001wI-Dx for guix-patches@gnu.org; Tue, 21 Dec 2021 14:36:55 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:42477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzkwP-0004Et-A5 for guix-patches@gnu.org; Tue, 21 Dec 2021 14:36:54 -0500 Received: (Authenticated sender: brice@waegenei.re) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id C450D240002 for ; Tue, 21 Dec 2021 19:36:51 +0000 (UTC) From: Brice Waegeneire Date: Tue, 21 Dec 2021 20:36:46 +0100 Message-Id: <20211221193646.16849-4-brice@waegenei.re> X-Mailer: git-send-email 2.34.0 In-Reply-To: <8735mleoxo.fsf_-_@waegenei.re> References: <8735mleoxo.fsf_-_@waegenei.re> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=217.70.183.193; envelope-from=brice@waegenei.re; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640115480; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=IOdl2lUPH156hOBKOJo00MGo0T48kEXP+V+t/zBUiDU=; b=MV92+ftP5h4z2W9v2eDZsGviwUIb8prVHGkNcAsVQ1wu0OpjKqCKFSI/p3XSqNHGsE/Ha9 TEhvzKzP7wnZ+lzdr+MHqzzkxyv2R5C1O5J3XIDugCTOTsOE/fMM6CD40CRJ8e6PaUKHkg +aHULKT7cZRfBPEmuN+c8jhNIJU32tBvztfv71sQT2e/bK/AC1CII/Xr4/ciZKYgV7Kg0h 6lDuvfHN51qfZCu7we4oMbA/x1OWbV486di1Fzn7iEXLJ0CmYaUy102X0H98z0Dg+jHw/G i46Y/DiuS48W51HxEwBovv6QqVT8xx1AJdvEid6+NvXWqNpKoB8XSxRg2hKa6A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640115480; a=rsa-sha256; cv=none; b=rb4oTthpR+LOrP1EJzLQ+ZqDNW/i3cFv48RxuOZrEy3yNxmT/2nm/UhqdTs93qmz1fuQdf fDiUIWSqcpXY0LhtRQtHZ5vMGAXIF7AnIXR4iNCmiy117PtzQH+T72hgm8kF3z9V68yZzv 6q7qHrRjX7ItQ5ZZOI41ULKXpkEt+LMDqIbyz/TqEV0RpD+fMo3+aJu9+CLGzRHzwIu+Fl uWbIfGeuINa4Hd/6sLfMtPHW1rrmLgHJSa+AbpEtGVfAnXXV4IqZl1Njs1hz/7Rd/TY2n7 qNmORs91HvPFGYJ6liAMD6x9bzqSksxUE67WLxS6rk490xH8SxHBts3Y29A3kA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.23 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 56DFB5B7A X-Spam-Score: -3.23 X-Migadu-Scanner: scn0.migadu.com X-TUID: 4NGsaEOeuumz * gnu/services/cuirass.scm (cuirass-activation): Replace 'chown' calls by 'lchown-recursive'. --- gnu/services/cuirass.scm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm index 96f28a9670..41e45604dd 100644 --- a/gnu/services/cuirass.scm +++ b/gnu/services/cuirass.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2017 Jan Nieuwenhuizen ;;; Copyright © 2018, 2019 Ricardo Wurmus ;;; Copyright © 2018 Clément Lassieur +;;; Copyright © 2021 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ (define-module (gnu services cuirass) #:use-module (guix channels) #:use-module (guix gexp) + #:use-module (guix modules) #:use-module (guix records) #:use-module (guix store) #:use-module (guix utils) @@ -278,9 +280,11 @@ (define (cuirass-activation config) (profile (string-append "/var/guix/profiles/per-user/" user)) (roots (string-append profile "/cuirass")) (group (cuirass-configuration-group config))) - (with-imported-modules '((guix build utils)) + (with-imported-modules (source-module-closure + '((gnu build activation))) #~(begin - (use-modules (guix build utils)) + (use-modules (guix build utils) + (gnu build activation)) (mkdir-p #$cache) (mkdir-p #$log) @@ -291,13 +295,13 @@ (define (cuirass-activation config) (let ((uid (passwd:uid (getpw #$user))) (gid (group:gid (getgr #$group)))) - (chown #$cache uid gid) - (chown #$log uid gid) - (chown #$roots uid gid) - (chown #$profile uid gid) + (lchown-recursive #$cache uid gid) + (lchown-recursive #$log uid gid) + (lchown-recursive #$profile uid gid) + (lchown-recursive (passwd:dir (getpw #$user)) uid gid) (when #$remote-cache - (chown #$remote-cache uid gid))))))) + (lchown-recursive #$remote-cache uid gid))))))) (define (cuirass-log-rotations config) "Return the list of log rotations that corresponds to CONFIG." -- 2.34.0