From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 GL6wAGLZX2Q8kwAASxT56A (envelope-from ) for ; Sat, 13 May 2023 20:39:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mD27AGLZX2S5FwEA9RJhRA (envelope-from ) for ; Sat, 13 May 2023 20:39:30 +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 AA944FCC4 for ; Sat, 13 May 2023 20:39:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxu91-000575-QU; Sat, 13 May 2023 14:39:03 -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 1pxu90-00056q-QE for bug-guix@gnu.org; Sat, 13 May 2023 14:39: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 1pxu90-0006GI-Ad for bug-guix@gnu.org; Sat, 13 May 2023 14:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pxu8z-0007Hq-PP for bug-guix@gnu.org; Sat, 13 May 2023 14:39:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63198: [PATCH] services: cups: Add cups PAM service. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 13 May 2023 18:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63198 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 63198@debbugs.gnu.org, maxim.cournoyer@gmail.com Received: via spool by 63198-submit@debbugs.gnu.org id=B63198.168400309027935 (code B ref 63198); Sat, 13 May 2023 18:39:01 +0000 Received: (at 63198) by debbugs.gnu.org; 13 May 2023 18:38:10 +0000 Received: from localhost ([127.0.0.1]:39595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxu89-0007GU-JW for submit@debbugs.gnu.org; Sat, 13 May 2023 14:38:10 -0400 Received: from nomad-cl1.muradm.net ([139.162.159.157]:45828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxu87-0007G5-3P for 63198@debbugs.gnu.org; Sat, 13 May 2023 14:38:07 -0400 Received: from localhost ([127.0.0.1]:47144) by nomad-cl1.muradm.net with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1pxu80-00005r-11; Sat, 13 May 2023 18:38:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=muradm.net; s=mail; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WxXHY5YJG11Bqp2nGjUVlZNz9n4vzG7EyIlTaJjsUUk=; b=MGeidRMIrYwahtAZesTCimH8vY tPnKIf22mpcGVP1tDoQ8GoUgeQ6/8qswKBgR4Baynp7izo/XX9I6TCeCiofMbpt5GqZlLhEf2wzMU 5DibJx5W8MsXW9DwV1LbqG2fa2LlRMB+FvlnL/ci/u3mNqDV+AyhfoUENtsgmg5sFevV9sYWwjNJa BTbHeJTtpftQJdA9Ac+fGnLfYaKehXFLbRtiNfa+E/LPQ4N8plASw3Y0oVCy9KNSpGmYQNGi+tX3y RXBYmDYl4i50nqtWhZdNEUjPmDiHyiAOO4+ncLHdVVSr6j0pPcg3zIIdL17nVMPVs4VTc1zoH9m+z DP3KMT9Ppq2lKmgL5JwBr/JWNpESCBak0HBhfMetZ3HvwQnos7oRdZOjY3MRZZkZJmPXXZdr6pClm Sm5jYHIGrhcRIzV6C2WG7DBqLQwrsJenUzptecB1Tof33HlKtcyMg18LyHCSaje1vd/OF3nXnmJ9C Z+d37ZA81TOTCgk0E9St3GRm; Received: from muradm by localhost with local (Exim 4.96) (envelope-from ) id 1pxu80-0001yn-2p; Sat, 13 May 2023 21:38:00 +0300 From: muradm Date: Sat, 13 May 2023 21:38:00 +0300 Message-Id: <0c6858607cfd59a8da92f0a0780d8b45dc4b3afd.1684003079.git.mail@muradm.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <87wn1s695u.fsf@gmail.com> References: <87wn1s695u.fsf@gmail.com> 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: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-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=1684003169; a=rsa-sha256; cv=none; b=MMlB1s2hKWhC1yMiMxfsqWXiebwoKBqY/Lt+SOuhg5PWAiN1rlUpmGzJu/iAyYm+a4fC6d pNUG8QRR/28LNT0+HqAzANNi6h9Mi7EVzUp+K1VChUhLa7+oZ8rWCMxmw+Xt8S6sbCmHQe 8iVqZsqC2mpmKnkSj2j3GU+mknVuimoMfVeeWMa9YlfQ8vrfMKkvKRhRZBIXKZsd8nisLB d9+VAbSENQD2GocdcvBAWyXRyyXW+lxVKLT8HKlvgB6/Rfur7Z5UjGn/emZJd2fKSMYgKs +gC2bvfmeZyZkc5BdtB3Wtho3s0KGkdzB0NrNUCkFU90noH63nRtks3TlEHCCg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=muradm.net header.s=mail header.b=MGeidRMI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=muradm.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1684003169; 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:dkim-signature; bh=WxXHY5YJG11Bqp2nGjUVlZNz9n4vzG7EyIlTaJjsUUk=; b=Nq0466OjC1zvbBXYvQWVXhNCyYRFzHAGs29rbfDfBQL3qNF5OP2aL4nQKfavnULqCMPRLS jbJ1+f9tHP3dDD0mF3lLo6AZVt5EHjAb5vim+kPHLc1xTKnG0J+o26qTn3ppepZmZHAoXV OIg5rk7C6mx5IFW36DZGgsGOn0L6VxZdrcFBOhJ1ZfkHOSJnAxNzy9qMwpG+a+TNmQp3W1 C4S0HCbb8UXR4zUN1OWwodEUv9LJ1Ov7Eb8b0ebJDUPYVRVP/xtildQJwa3sN1KLecNnra zwoYKr6wg8uoUhm22YNNgvZFsYGUQshgeLLekiwaUot1yvC1cnPyNuN1ysTbJQ== X-Migadu-Spam-Score: 0.19 X-Spam-Score: 0.19 X-Migadu-Queue-Id: AA944FCC4 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=muradm.net header.s=mail header.b=MGeidRMI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=muradm.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-TUID: 7gQ5ZV0crg6K Fixes . Makes CUPS service to extend pam-root-service-type providing minimal configuration to authenticate users. Since PAM authentication is provided, cups package can be used as default. * gnu/services/cups.scm (cups-configuration) [cups]: Use cups. [allow-empty-password?]: PAM service configuration permitting empty passwords. (opaque-cups-configuration): Likewise. (cups-pam-service): cups PAM service. (cups-service-type): Extend pam-root-service-type with cups-pam-service. --- gnu/services/cups.scm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/gnu/services/cups.scm b/gnu/services/cups.scm index c6099d77e7..d95c38b4d9 100644 --- a/gnu/services/cups.scm +++ b/gnu/services/cups.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2019 Alex Griffin ;;; Copyright © 2019 Tobias Geerinckx-Rice ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2023 muradm ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu services cups) #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (gnu services configuration) + #:use-module (gnu system pam) #:use-module (gnu system shadow) #:use-module (gnu packages admin) #:use-module (gnu packages cups) @@ -500,8 +502,11 @@ (define (serialize-package-list field-name val) (define-configuration cups-configuration (cups - (file-like cups-minimal) + (file-like cups) "The CUPS package.") + (allow-empty-password? + (boolean #f) + "Specifies whether empty passwords will be allowed when authenticating via PAM.") (extensions (package-list (list brlaser cups-filters epson-inkjet-printer-escpr foomatic-filters hplip-minimal splix)) @@ -841,8 +846,11 @@ (define-configuration cups-configuration (define-configuration opaque-cups-configuration (cups - (package cups-minimal) + (package cups) "The CUPS package.") + (allow-empty-password? + (boolean #f) + "Specifies whether empty passwords will be allowed when authenticating via PAM.") (extensions (package-list '()) "Drivers and other extensions to the CUPS package.") @@ -1006,6 +1014,14 @@ (define (cups-shepherd-service config) "-f" "-c" #$cupsd.conf "-s" #$cups-files.conf))) (stop #~(make-kill-destructor)))))) +(define (cups-pam-service config) + (let ((allow-empty-password? + (if (opaque-cups-configuration? config) + (opaque-cups-configuration-allow-empty-password? config) + (cups-configuration-allow-empty-password? config)))) + (list (unix-pam-service "cups" + #:allow-empty-passwords? allow-empty-password?)))) + (define cups-service-type (service-type (name 'cups) (extensions @@ -1013,6 +1029,8 @@ (define cups-service-type cups-shepherd-service) (service-extension activation-service-type (const %cups-activation)) + (service-extension pam-root-service-type + cups-pam-service) (service-extension account-service-type (const %cups-accounts)))) base-commit: ed1e7920393c9ae5b2ae31fc46bae88136239b13 -- 2.40.1