From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8NpFF85Q6WPtNAAAbAwnHQ (envelope-from ) for ; Sun, 12 Feb 2023 21:49:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id eMlgF85Q6WN56wAAauVa8A (envelope-from ) for ; Sun, 12 Feb 2023 21:49:18 +0100 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 21883DF3F for ; Sun, 12 Feb 2023 21:49:18 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRJHb-0003ts-37; Sun, 12 Feb 2023 15:49:11 -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-0003pa-Ro 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-0001gC-Ja 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-0004iN-Ga for guix-patches@gnu.org; Sun, 12 Feb 2023 15:49:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61462] [PATCH 08/10] services: Rename setuid-program-service-type. 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.167623493918045 (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]:46995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRJHO-0004gu-TO for submit@debbugs.gnu.org; Sun, 12 Feb 2023 15:48:59 -0500 Received: from tobias.gr ([80.241.217.52]:55494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRJHC-0004er-9w for 61462@debbugs.gnu.org; Sun, 12 Feb 2023 15:48:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=UiCh72+qtEtjD cG567MZrChL3N6G3FPpI9BMMitY9AU=; h=references:in-reply-to:date: subject:to:from; d=tobias.gr; b=PZDKOxWdgoHSP/H2e7IuK2NhWUcziE9qaBKn1j WlDe+C+nU4VG5QVyjOu16XowZjMqM7w0hZCHS59ZlLFviypTsXLZxLaJuXDJGDGKWmmZls M8AFnpVMRDVNX0C+rKu0Gt60L6IPw+ssckMxPEXLpg9A45NjHHMvxvZpTDZgbukhidu5hG Ifg8Bqj0QQE+1vPw2kF2aAZUDe6WpCXVGnKWqzR+gyU1rp0BI2JBmSjANrNzPPwYaujhAB cPwukYsN7kvsXrNt0I0e59lpGueQZYKotFz5PzqpSzVL0GVQ0gWI0T7u71JHCPamLswW9/ 58socsOy1kuN5YirzIV8QkwQ== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 7ca668bf (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:17 +0100 Message-Id: <20230205000019.6259-8-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 From: Tobias Geerinckx-Rice via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676234958; a=rsa-sha256; cv=none; b=IVFwgCcWQDIy4aoXbF6ujPIbJqIlcbX1mzqj3eJUsJYoAeMcFARGZVPEyCqz2m48SQ984l uqWyiDyTIjOW3vdiGpvxbnvx4i5C28AW+XgtgKplXuLXDa2iN8CDuCeml6u+Pc/pOZqLYr hIV//p2i7G6GMv6692La2BgTSSZRAY+To4pEUzdB4u9Tl24/Qh+dBd1BSjkS+c4WKA43jQ v0BLj2+JWwc0NSTCzZVmw1nUm5StHhpHNSqjzPYCItd+e0Rd8CCrfyVWjboWOKyluAnqnX ydfwHX8z2F6vNekUGmGcmZ8i/91hDrSznyZSIprOc4fQCp61yyFYBRer7mGxnA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=PZDKOxWd; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676234958; h=from:from:sender:sender:reply-to: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:dkim-signature; bh=UiCh72+qtEtjDcG567MZrChL3N6G3FPpI9BMMitY9AU=; b=s15Xr1gc6GBvzjsK9gGtzUj4/Jm21xBZEKsvnSdVNUf3znZYHmSBH1Ez292W4jtTGuGM+4 KLaWl8YQstvX9lvBBvQZIpbDgUjm+IyFfJRiSJOypVjdH8rnFf0jeBXQTopzEStKFVupZG +g7XqhZ/sAJgEVKXVwNX8F+wfYbYBDtF63W3tlHEYTUjZszhyNxV38z1ZWxYvdeJVPR2lj mqeMJN9ofnddTV3qw5wvZ2kEJWAp6YeWeqMlNPtpCQH7/3hRW8xGMOqGLMPB6IJ5IFh+DF ednD+4YYKkUKchA4yZCG0s5E4ULyqBhj7ZWto+ANKl6OAnBqIytw8Zq6Agv2cg== X-Migadu-Queue-Id: 21883DF3F Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=PZDKOxWd; dmarc=pass (policy=none) header.from=gnu.org; 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -1.92 X-Spam-Score: -1.92 X-TUID: Lu9lXH4yumJl * gnu/services.scm (setuid-program->activation-gexp): Rename this… (privileged-program->activation-gexp): …to this. Operate on a list of records. (privileged-program-service-type): New variable, renamed from setuid-program-service-type. Rename the service-type accordingly. (setuid-program-service-type): Redefine as an alias for the above. --- gnu/services.scm | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/gnu/services.scm b/gnu/services.scm index af9f4e1db6..09ff58dcd1 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -43,6 +43,7 @@ (define-module (gnu services) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages hurd) + #:use-module (gnu system privilege) #:use-module (gnu system setuid) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) @@ -110,7 +111,8 @@ (define-module (gnu services) extra-special-file etc-service-type etc-directory - setuid-program-service-type + privileged-program-service-type + setuid-program-service-type ; deprecated profile-service-type firmware-service-type gc-root-service-type @@ -810,17 +812,17 @@ (define (etc-service files) FILES must be a list of name/file-like object pairs." (service etc-service-type files)) -(define (setuid-program->activation-gexp programs) - "Return an activation gexp for setuid-program from PROGRAMS." +(define (privileged-program->activation-gexp programs) + "Return an activation gexp for privileged-program from PROGRAMS." (let ((programs (map (lambda (program) ;; FIXME This is really ugly, I didn't managed to use ;; "inherit" - (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)) ) - #~(setuid-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)) ) + #~(privileged-program (setuid? #$setuid?) (setgid? #$setgid?) (user #$user) @@ -828,17 +830,17 @@ (define (setuid-program->activation-gexp programs) (program #$program-name)))) programs))) (with-imported-modules (source-module-closure - '((gnu system setuid))) + '((gnu system privilege))) #~(begin - (use-modules (gnu system setuid)) + (use-modules (gnu system privilege)) (activate-privileged-programs (list #$@programs)))))) -(define setuid-program-service-type - (service-type (name 'setuid-program) +(define privileged-program-service-type + (service-type (name 'privileged-program) (extensions (list (service-extension activation-service-type - setuid-program->activation-gexp))) + privileged-program->activation-gexp))) (compose concatenate) (extend (lambda (config extensions) (append config extensions))) @@ -850,6 +852,10 @@ (define setuid-program-service-type symbolic links to their @file{/run/privileged/bin} counterpart. It will be removed in a future Guix release."))) +(define setuid-program-service-type + ;; Deprecated alias to ease transition. Will be removed! + privileged-program-service-type) + (define (packages->profile-entry packages) "Return a system entry for the profile containing PACKAGES." ;; XXX: 'mlet' is needed here for one reason: to get the proper -- 2.39.1