From patchwork Sun Feb 5 00:00:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Geerinckx-Rice X-Patchwork-Id: 46898 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 79FCA16657; Sun, 12 Feb 2023 20:50:33 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 811951664B for ; Sun, 12 Feb 2023 20:50:32 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRJHa-0003t8-RC; Sun, 12 Feb 2023 15:49:10 -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 1pRJHV-0003pN-Fn for guix-patches@gnu.org; Sun, 12 Feb 2023 15:49:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRJHV-0001g4-7O for guix-patches@gnu.org; Sun, 12 Feb 2023 15:49:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pRJHV-0004iF-3d for guix-patches@gnu.org; Sun, 12 Feb 2023 15:49:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61462] [PATCH 07/10] build: Rename activate-setuid-programs. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 12 Feb 2023 20:49:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61462 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 61462@debbugs.gnu.org Received: via spool by 61462-submit@debbugs.gnu.org id=B61462.167623493918038 (code B ref 61462); Sun, 12 Feb 2023 20:49:05 +0000 Received: (at 61462) by debbugs.gnu.org; 12 Feb 2023 20:48:59 +0000 Received: from localhost ([127.0.0.1]:46993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRJHO-0004gl-D7 for submit@debbugs.gnu.org; Sun, 12 Feb 2023 15:48:58 -0500 Received: from tobias.gr ([80.241.217.52]:56712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRJHC-0004fL-50 for 61462@debbugs.gnu.org; Sun, 12 Feb 2023 15:48:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=CP4R0uizaioVl NgWaY78ttb7yEcrqQ3c62NXaROIVCU=; h=references:in-reply-to:date: subject:to:from; d=tobias.gr; b=hnx8m1+D35zItVtdMXAShhhs5G/F2AQP6onVMv lbmrZCtcZmcNKGaIS/16gIAKsfcZsQUIDw+PuNB7VhuXAwM50+vvG/8bMoMHwZ9lu3vISu YRcMoICOFDjgMIZeMGQ5kUFM3XA8DfqnDonfX8OcFfyqjx+/dX83l2ikqXDFkbKoCF6R1Y +DIpNAsY1rswLtt0MpxnyDdQyapkDyV2FkxCOwA9WNXI9iZ065gI8WhQRrz7K2CXhhmc7A EZhbShviOfF9lnj9umXpCeJAPGFe1jcHoJJT4p0ht30OLvYBydzzT2JAgBjLmimA8ow/h6 aGdTBxdmzMvP8jKJnh8iYXyQ== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 3798ac59 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <61462@debbugs.gnu.org>; Sun, 12 Feb 2023 20:48:38 +0000 (UTC) Date: Sun, 5 Feb 2023 01:00:16 +0100 Message-Id: <20230205000019.6259-7-me@tobias.gr> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230205000019.6259-1-me@tobias.gr> References: <20230205000019.6259-1-me@tobias.gr> 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: , Reply-to: Tobias Geerinckx-Rice X-ACL-Warn: , Tobias Geerinckx-Rice via Guix-patches X-Patchwork-Original-From: Tobias Geerinckx-Rice via Guix-patches via From: Tobias Geerinckx-Rice 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 * gnu/build/activation.scm (activate-setuid-programs): Rename this… (activate-privileged-programs): …to this. Operate on a list of records. * gnu/services.scm (setuid-program->activation-gexp): Adjust caller. --- gnu/build/activation.scm | 24 ++++++++++++------------ gnu/services.scm | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index af947a39fa..b5004a292c 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -27,7 +27,7 @@ (define-module (gnu build activation) #:use-module (gnu system accounts) - #:use-module (gnu system setuid) + #:use-module (gnu system privilege) #:use-module (gnu build accounts) #:use-module (gnu build linux-boot) #:use-module (guix build utils) @@ -41,7 +41,7 @@ (define-module (gnu build activation) #:export (activate-users+groups activate-user-home activate-etc - activate-setuid-programs + activate-privileged-programs activate-special-files activate-modprobe activate-firmware @@ -287,8 +287,8 @@ (define %privileged-program-directory ;; Place where privileged copies of programs are stored. "/run/privileged/bin") -(define (activate-setuid-programs programs) - "Turn PROGRAMS, a list of file setuid-programs records, into privileged +(define (activate-privileged-programs programs) + "Turn PROGRAMS, a list of file privileged-programs records, into privileged copies stored under %PRIVILEGED-PROGRAM-DIRECTORY." (define (ensure-empty-directory directory) (if (file-exists? directory) @@ -325,11 +325,11 @@ (define (make-deprecated-wrapper program) (for-each (lambda (program) (catch 'system-error (lambda () - (let* ((program-name (setuid-program-program program)) - (setuid? (setuid-program-setuid? program)) - (setgid? (setuid-program-setgid? program)) - (user (setuid-program-user program)) - (group (setuid-program-group program)) + (let* ((program-name (privileged-program-program program)) + (setuid? (privileged-program-setuid? program)) + (setgid? (privileged-program-setgid? program)) + (user (privileged-program-user program)) + (group (privileged-program-group program)) (uid (match user ((? string?) (passwd:uid (getpwnam user))) ((? integer?) user))) @@ -339,13 +339,13 @@ (define (make-deprecated-wrapper program) (make-privileged-program program-name setuid? setgid? uid gid) (make-deprecated-wrapper program-name))) (lambda args - ;; If we fail to create a setuid program, better keep going + ;; If we fail to create a privileged program, better keep going ;; so that we don't leave %PRIVILEGED-PROGRAM-DIRECTORY empty ;; or half-populated. This can happen if PROGRAMS contains ;; incorrect file names: . (format (current-error-port) - "warning: failed to make ~s setuid/setgid: ~a~%" - (setuid-program-program program) + "warning: failed to privilege ~s: ~a~%" + (privileged-program-program program) (strerror (system-error-errno args)))))) programs)) diff --git a/gnu/services.scm b/gnu/services.scm index 26546e1369..af9f4e1db6 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -832,7 +832,7 @@ (define (setuid-program->activation-gexp programs) #~(begin (use-modules (gnu system setuid)) - (activate-setuid-programs (list #$@programs)))))) + (activate-privileged-programs (list #$@programs)))))) (define setuid-program-service-type (service-type (name 'setuid-program)