From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id WOFxO4LOXGSL5gAASxT56A (envelope-from ) for ; Thu, 11 May 2023 13:16:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KLiUOoLOXGQ7SgEAG6o9tA (envelope-from ) for ; Thu, 11 May 2023 13:16:18 +0200 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 616D03EAEF for ; Thu, 11 May 2023 13:16:18 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1px4HH-0000Iz-6C; Thu, 11 May 2023 07:16:07 -0400 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 1px4HC-0000IG-US for guix-patches@gnu.org; Thu, 11 May 2023 07:16:02 -0400 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 1px4HC-0008Dq-Ks for guix-patches@gnu.org; Thu, 11 May 2023 07:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1px4HC-0007md-Gd for guix-patches@gnu.org; Thu, 11 May 2023 07:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63314] [PATCH v2 1/2] system: pam: Let PAM extensions add shepherd requirements. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 May 2023 11:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63314 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Josselin Poiret Cc: 63314@debbugs.gnu.org Received: via spool by 63314-submit@debbugs.gnu.org id=B63314.168380375429898 (code B ref 63314); Thu, 11 May 2023 11:16:02 +0000 Received: (at 63314) by debbugs.gnu.org; 11 May 2023 11:15:54 +0000 Received: from localhost ([127.0.0.1]:49867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1px4H4-0007m9-8S for submit@debbugs.gnu.org; Thu, 11 May 2023 07:15:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1px4H2-0007ls-GA for 63314@debbugs.gnu.org; Thu, 11 May 2023 07:15:52 -0400 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 1px4Gw-00087Z-VA; Thu, 11 May 2023 07:15:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=FtC54X3BQTOUWYJJ2+XwGCozTbIUTOGn9PMcvuurEDY=; b=GfxE0YVyXhz/HTgDeMOl SvgEQc1P1EWe+aGa+X1fr20ozhotKXxENXyn0ivMyKY5CgmaksBhCDKeh354h1MGe2zWuZVNDOQdg GH7kE7Ek+SXocYcnqtTvokwuuH7zrB8/c2kX+TGGaOaOzQKKbx3gapQelYmw1SvmMj0QUbPR3AMI/ eeHXFnzFQ7cFHynrGbFUS9u4+1bqIIl5KbzH+McVOKmzUgt3MJ2DjcPY6M4neje8P1UFhKLanSfUS mlOI8p+ir+mpX/nBwkUIikNS4ovlJ3IqZ2BKJ0YKitoOJKY0A+yROuYeaNcU1fRCzFFPsCWEhGQtn iJiJyNw+Qf9BWw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1px4Gu-0001xU-84; Thu, 11 May 2023 07:15:46 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <9371fcad4037f991a3c003f550c8c080f15271f6.1683650554.git.dev@jpoiret.xyz> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Duodi 22 =?UTF-8?Q?Flor=C3=A9al?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour de la Fritillaire X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 11 May 2023 13:15:42 +0200 In-Reply-To: <9371fcad4037f991a3c003f550c8c080f15271f6.1683650554.git.dev@jpoiret.xyz> (Josselin Poiret's message of "Tue, 9 May 2023 18:45:07 +0200") Message-ID: <8735435db5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683803778; a=rsa-sha256; cv=none; b=oTpy2KZZVv5MLK9d8KWzQcl3uyvjLgXiLO/UEtDjGaJvNJpvYOWOqh9QNAOrrIi1dAv+fT k2iz0NO9KWwkgPqGQzivu3O7FScEKRRl9lgiehcYloPaYsWpqiKExbPm+EoRfBfxnifqoE LfVQRhomn9Ef+6OZyKKD+C8Fux8InnpMvWFHDNfrSuGmSvr0k6VlzVfyNIfK28Rwav5nh9 eQRPIbYmXIKbcXGq2LyKhMzUmvfYtbUDefUBiNadqtp/m/s3XCvD4ObSm4k+A0UcwnJ8pS CtmAsnqUr0ijeE41D/Dz9bGpdtzet/+76ftFRmIhotYoId7LtfCL8w9thP6MRw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=GfxE0YVy; 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=1683803778; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=FtC54X3BQTOUWYJJ2+XwGCozTbIUTOGn9PMcvuurEDY=; b=JKunFgmrhyc9qFqf7+ok6h7SNgXg/XmJ9tynyL204fAi2I1H/Ty+AAT90v9wjiOfBVQjnw PJqkqPvOsZ3FnPFnbjDSQIn9hzLL+LDcj0KW+YCzjoFSCLV+LQqAzM9AscHjJd44OK8JJe spVHbK01ADwq2lCMcpghBsEsMRPs/4i+PZX01W9752q9G7AcD/+0wxJKM3Vu7aM8GtjLhs mLS2n0wsTiaXiTiVhaml7oEtsUI+o38CzDQTuPnN6p/dEJPfat3/SKViizrrCJp+jMHHHH A+1glqm1HLD7d32Nu2IG2+56LvNSx27j1lrnm6AUE0O9agG+m1aLGn7cVPdxuQ== X-Migadu-Spam-Score: -1.41 X-Spam-Score: -1.41 X-Migadu-Queue-Id: 616D03EAEF X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=GfxE0YVy; 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-TUID: pTXrn0Ab9hsN --=-=-= Content-Type: text/plain Hi, Josselin Poiret skribis: > From: Josselin Poiret > > * gnu/system/pam.scm (): New record type. > (pam-shepherd-service): Add Shepherd synchronization point. > > * gnu/services/mail.scm (dovecot-shepherd-service) > * gnu/services/lightdm.scm (lightdm-shepherd-service) > * gnu/services/mail.scm (opensmtpd-shepherd-service) > * gnu/services/sddm.scm (sddm-shepherd-service) > * gnu/services/ssh.scm (lsh-shepherd-service, openssh-shepherd-service) > * gnu/services/xorg.scm (slim-shepherd-service, gdm-shepherd-service) > * gnu/services/base.scm (greetd-shepherd-services): Add PAM requirement. > > * gnu/system/pam.scm (/etc-entry, extend-configuration, > pam-root-service-type, pam-root-service) > * gnu/services/authentication.scm (pam-ldap-pam-service) > * gnu/services/base.scm (pam-limits-service-type) > (greetd-pam-service) > * gnu/services/desktop.scm (pam-gnome-keyring) > * gnu/services/kerberos.scm (pam-krb5-pam-service) > * gnu/services/pam-mount.scm (pam-mount-pam-service): Adapt to use > pam-extension. Excellent! I committed with the cosmetic changes below: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/gnu/system/pam.scm b/gnu/system/pam.scm index f624064999..adc40c975f 100644 --- a/gnu/system/pam.scm +++ b/gnu/system/pam.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2013-2017, 2019-2021 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2023 Josselin Poiret ;;; ;;; This file is part of GNU Guix. ;;; @@ -354,9 +355,9 @@ (define (session-environment-service vars) ;;; PAM root service. ;;; =20 -;; A PAM transformer consists of a procedure acting on each PAM entry, wit= h an -;; additional list of shepherd-requirements that the meta PAM shepherd ser= vice -;; will depend on. +;; Extension of the PAM configuration. A PAM transformer consists of a +;; procedure acting on each PAM entry; 'shepherd-requirements' lists servi= ces +;; that the meta 'pam' Shepherd service will depend on. (define-record-type* pam-extension make-pam-extension pam-extension? (transformer pam-extension-transformer) @@ -380,12 +381,8 @@ (define (/etc-entry config) "Return the /etc/pam.d entry corresponding to CONFIG." (match config (($ services transformers shepherd-requirements) - (let ((services - (map - ;; XXX We need to add identity because compose expects at lea= st - ;; one argument for some reason. - (apply compose (cons identity transformers)) - services))) + (let ((services (map (apply compose identity transformers) + services))) `(("pam.d" ,(pam-services->directory services))))))) =20 (define (pam-shepherd-service config) @@ -404,16 +401,15 @@ (define (extend-configuration initial extensions) "Extend INITIAL with NEW." ;; TODO: Remove deprecation shim. (define cleaned-extensions - (map - (lambda (ext) - (cond - ((procedure? ext) - (begin - (warning (G_ "pam-root-service-type transformer extensions shou= ld\ -now use the record.")) - (pam-extension (transformer ext)))) - (#t ext))) - extensions)) + (map (lambda (ext) + (if (procedure? ext) + (begin + (warning (G_ "'pam-root-service-type' extensions should \ +now use the record~%")) + (pam-extension (transformer ext))) + ext)) + extensions)) + (let-values (((services pam-extensions) (partition pam-service? cleaned-extensions))) (pam-configuration --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 DQpMdWRv4oCZLg0K --=-=-=--