From patchwork Mon Mar 20 22:10:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josselin Poiret X-Patchwork-Id: 48469 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 945C916F32; Mon, 20 Mar 2023 22:12: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=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=no 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 4BBFD16F13 for ; Mon, 20 Mar 2023 22:12:59 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peNjg-0003tj-QJ; Mon, 20 Mar 2023 18:12:12 -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 1peNjc-0003oc-GX for guix-patches@gnu.org; Mon, 20 Mar 2023 18:12:08 -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 1peNjc-0003II-7N for guix-patches@gnu.org; Mon, 20 Mar 2023 18:12:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1peNjc-0007PN-3Y for guix-patches@gnu.org; Mon, 20 Mar 2023 18:12:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62307] [PATCH core-updates 15/15] system: pam: Only add linux-pam reference if on Linux. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 20 Mar 2023 22:12:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62307 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62307@debbugs.gnu.org, Josselin Poiret Received: via spool by 62307-submit@debbugs.gnu.org id=B62307.167935029728279 (code B ref 62307); Mon, 20 Mar 2023 22:12:08 +0000 Received: (at 62307) by debbugs.gnu.org; 20 Mar 2023 22:11:37 +0000 Received: from localhost ([127.0.0.1]:57037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peNj7-0007Ly-9X for submit@debbugs.gnu.org; Mon, 20 Mar 2023 18:11:37 -0400 Received: from jpoiret.xyz ([206.189.101.64]:47374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peNik-0007Jm-7R for 62307@debbugs.gnu.org; Mon, 20 Mar 2023 18:11:14 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id C9BDC184D6B; Mon, 20 Mar 2023 22:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1679350274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NguPpRZq/YgnFpoKq7byrYgbRESVWQpvhGipdFGPT04=; b=QorYuksEqVvUbf7naOtEwY1kYiVwgg5QypQKVTXcGEq+MHgJMUKyQCdm6qND1z57MV8TkP +yb+oKssnF3mVWZw0EWV41EWjfP7wdGzTxzurOyOYjE9p+h9C7DD0TVy09J3p9WVM0knEA GyWNTGKJvKABAZBZC7RNOHbLe2b2hECvy6fQY9p4Sk+iI7tDYI82UzmImiI/8hYS18w7zV ckwDVQUuqbGhyiNJMZShMBl9cJh04mNojvSUOprW7VzQxmXZJVDK1DSeTBsbr7KvpTBAui E+aEkrDzrJAJ5BLeqb+zqq2GBa0hJP+LkelB4krqsWy6adDOqW8+7/wTAogsOg== Date: Mon, 20 Mar 2023 23:10:51 +0100 Message-Id: <7b96d7bffdcdc7e3afea5c089200c8542ec12400.1679349992.git.dev@jpoiret.xyz> In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spamd-Bar: / 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: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches X-Patchwork-Original-From: Josselin Poiret via Guix-patches via From: Josselin Poiret 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/system/pam.scm (pam-root-service-type): Do it. --- gnu/system/pam.scm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gnu/system/pam.scm b/gnu/system/pam.scm index b635681642..8408e33c3f 100644 --- a/gnu/system/pam.scm +++ b/gnu/system/pam.scm @@ -20,6 +20,7 @@ (define-module (gnu system pam) #:use-module (guix records) #:use-module (guix derivations) #:use-module (guix gexp) + #:use-module (guix utils) #:use-module (gnu services) #:use-module (gnu system setuid) #:use-module (ice-9 match) @@ -377,12 +378,15 @@ (define (extend-configuration initial extensions) (define pam-root-service-type (service-type (name 'pam) (extensions - (list (service-extension - setuid-program-service-type - (lambda (_) - (list (file-like->setuid-program - (file-append linux-pam "/sbin/unix_chkpwd"))))) - (service-extension etc-service-type /etc-entry))) + (cons (service-extension etc-service-type /etc-entry) + (if (target-linux? (or (%current-target-system) + (%current-system))) + (list (service-extension + setuid-program-service-type + (lambda (_) + (list (file-like->setuid-program + (file-append linux-pam "/sbin/unix_chkpwd")))))) + '()))) ;; Arguments include as well as procedures. (compose concatenate)