From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id gGT+ITXcS2TPWAEASxT56A (envelope-from ) for ; Fri, 28 Apr 2023 16:46:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 8InYIDXcS2Q2pwAAG6o9tA (envelope-from ) for ; Fri, 28 Apr 2023 16:46:13 +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 2C5EAD538 for ; Fri, 28 Apr 2023 16:46:13 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psP5G-00084O-8U; Fri, 28 Apr 2023 10:28:26 -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 1psP4w-0007bb-7U for bug-guix@gnu.org; Fri, 28 Apr 2023 10:28:11 -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 1psP4v-000605-Ni for bug-guix@gnu.org; Fri, 28 Apr 2023 10:28:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1psP4v-000591-Jh for bug-guix@gnu.org; Fri, 28 Apr 2023 10:28:05 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63082: [PATCH 11/17] services: mpd: Warn when the MPD user is not in the "audio" group. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 28 Apr 2023 14:28:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63082 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 63082@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 63082-submit@debbugs.gnu.org id=B63082.168269206319633 (code B ref 63082); Fri, 28 Apr 2023 14:28:05 +0000 Received: (at 63082) by debbugs.gnu.org; 28 Apr 2023 14:27:43 +0000 Received: from localhost ([127.0.0.1]:34146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psP4Y-00056V-IC for submit@debbugs.gnu.org; Fri, 28 Apr 2023 10:27:43 -0400 Received: from mail-qk1-f175.google.com ([209.85.222.175]:62483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psP4P-00053n-OE for 63082@debbugs.gnu.org; Fri, 28 Apr 2023 10:27:34 -0400 Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-751319e0dbfso636600585a.0 for <63082@debbugs.gnu.org>; Fri, 28 Apr 2023 07:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682692053; x=1685284053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o4U8pVE1/cq70SoX9Vyc18icUVpuiGeny/xWK+c/O3Y=; b=bKdS9h7pYcTP0eWHeoj+rwxmgga4u/GmINWK2yrfSOUAzY1HKXRLpy5U9BTd6G6rwl y8ETTgeUv7A3HYnjADrhOAA1q7vh6LKBAiQamSdcE68ub6OKNr7p0Rl/zmMfXHtd7kbB f2rVepErMyQIflFwefi6sGF1lFOmCOfZ+Emv+y1QayEqgN/nrV2a4f3goWZZCndmnTdf /+eZ9tuJBAJBZcTYbF5FKuU5dyELvY5ktNmGw/ItBKzCVA7QXI3zlJ4KXT7ZplNbCvzo iIVCE64iFs3riPiJ0779ECxaXuqDr1pwc5NOSIKmuiPVF3b2grfMNjPHOTCrft/23OBn HX3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682692053; x=1685284053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o4U8pVE1/cq70SoX9Vyc18icUVpuiGeny/xWK+c/O3Y=; b=PmaBDztgPNKzMiNkz+cXEN8v6E+XB4da7bdEwTo/Gb8LYqUknpmknwiEz9Nu0CJ3eZ aCzlyDsEze2PnbPCiKgETtcAatZgn/zKynuk/xtrrEzqIaIKJDfq1uAPTrfVEoDISAPw DSlnwooPMhm1Wv21MC8abp2j/0NuEJS9PolLCObyaicH39qNQOSWLl7/wcOrlfW1grFn x2BtgVwYlFJvxe0Tte1U4N7DeBUeOFOEHUEJTuG103N+sOTfUaKGaLLLWX++9tH1DBaX AsLEw70lzRvxrdXn1CKTCrul39U5ssFeIwLrsYpFPO+vFiq68gFD8kioK/j8elFdNhgH vYfA== X-Gm-Message-State: AC+VfDxZTYb6pAD4H/i3aWM6vrVz7RjsL9fesGq++cR5PxmRdLtk3u1d tt5CNiMAT0UiOKFvvnzgBGdNXQCwmgc= X-Google-Smtp-Source: ACHHUZ6JcTcU3mSjG4QFfN0H+CxJqLi54Z+ffo6pn00Kq3kguFrPcWAM9+cecutqx6VlNjlbGVM1AQ== X-Received: by 2002:ad4:5bc8:0:b0:5ef:5481:595 with SMTP id t8-20020ad45bc8000000b005ef54810595mr17084757qvt.0.1682692053227; Fri, 28 Apr 2023 07:27:33 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1000]) by smtp.gmail.com with ESMTPSA id d8-20020a0cfe88000000b005ff569bca72sm6176940qvs.93.2023.04.28.07.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Apr 2023 07:27:32 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 28 Apr 2023 10:27:04 -0400 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 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=1682693173; a=rsa-sha256; cv=none; b=ROHITH1m3PpEDCf8FeDYEFLKkuURrhL2mVIuUv1wgRa1t0+yC7M7ZYfKW8AHi709uQK+CV vQPP9UTNV9qvSXCZLmN8tocrMJNiJyM89YtezogE90Khvoo6VPIoHubTCM9+XR/l1e8N8q zMwm8r0zmDAHEUC/ER+Q+TI4syqFbwucivsAyeLGRALCRMnzBdmktaGW5SYPL75PFIo0VH +m4kvXlZ5qLt3QBhzjhDxd1YxwMhUbJeHfmIJqe8hTVn5+iTZRbKKh0pOEOXgD/zsbQirB k/9NL3KYqMoRIpaKtBtkeHaqGkyoXYpLD5Ch8LNMdGE2J90MTJrD2W+yv8EReQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=bKdS9h7p; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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=1682693173; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=o4U8pVE1/cq70SoX9Vyc18icUVpuiGeny/xWK+c/O3Y=; b=Tdi/QuaGBXiTTbDe7l2f0suyX86CE9YWnGpJBzxK1Un5u3ffejyXN9rkQYyCLqG82tF8HQ GNjMHc9xmoXRz40j0YS2/zMtoD7fiUtwsQ5ORwmRUzX4uFU9dIMchZ/8P19eYF1tXDgXaz /kYFoC9ojxzEhcmxfrTHd6no5KGGYGsIFcZ2laEyVJmRHK6L9kMcQkagRVQ0DzsVlSTuSg oUoPihhrPO4/6wTKBpx6DzbgxLczHilKIo/tL/8+kxUiKRlakr3CZwBWHa2czwBqicwly/ vIc+CKu0dc0YmSnDoQ87TQ0JSXWRf1RP7yvcHBUovpBnbvLKLiwHtl4H+pGkxg== X-Migadu-Spam-Score: -0.31 X-Spam-Score: -0.31 X-Migadu-Queue-Id: 2C5EAD538 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=bKdS9h7p; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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: hz3xFQlooLDz Relates to . * gnu/services/audio.scm (%mpd-user) [group]: Add comment. (mpd-user-sanitizer): Warn if the MPD user is not in the audio group. --- gnu/services/audio.scm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm index 550ccc542c..9579432ea3 100644 --- a/gnu/services/audio.scm +++ b/gnu/services/audio.scm @@ -30,6 +30,7 @@ (define-module (gnu services audio) #:use-module (gnu services configuration) #:use-module (gnu services shepherd) #:use-module (gnu services admin) + #:use-module (gnu system accounts) #:use-module (gnu system shadow) #:use-module (gnu packages admin) #:use-module (gnu packages mpd) @@ -172,6 +173,8 @@ (define-maybe boolean (prefix mpd-)) (define %mpd-user (user-account (name "mpd") + ;; Being in the audio group ensures that PulseAudio can access sound + ;; devices. (group "audio") (system? #t) (comment "Music Player Daemon (MPD) user") @@ -208,10 +211,17 @@ (define (mpd-serialize-port field-name value) (define-maybe port (prefix mpd-)) -;;; Procedures for unsupported value types, to be removed. - +;;; Sanitizer procedures. (define (mpd-user-sanitizer value) - (cond ((user-account? value) value) + (cond ((user-account? value) + (match-record value + (group supplementary-groups) + (unless (or (string=? "audio" group) + (member "audio" supplementary-groups)) + ;; Being in the "audio" group is necessary for access to the + ;; sound devices. + (warning (G_ "mpd user not member of \"audio\" group~%")))) + value) ((string? value) (warning (G_ "string value for 'user' is deprecated, use \ user-account instead~%")) -- 2.39.2