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 GCzYLm1LVWRwZwAASxT56A (envelope-from ) for ; Fri, 05 May 2023 20:31:09 +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 uPTULW1LVWT4gQAAG6o9tA (envelope-from ) for ; Fri, 05 May 2023 20:31:09 +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 9215D120BA for ; Fri, 5 May 2023 20:31:09 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pv0CC-0005JG-6w; Fri, 05 May 2023 14:30:20 -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 1pv0Bz-0005Cv-Ly for bug-guix@gnu.org; Fri, 05 May 2023 14:30:07 -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 1pv0Bz-00062k-As for bug-guix@gnu.org; Fri, 05 May 2023 14:30:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pv0Bz-0003Bg-6u for bug-guix@gnu.org; Fri, 05 May 2023 14:30:07 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63082: [PATCH v3 12/16] 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, 05 May 2023 18:30:07 +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.168331139012075 (code B ref 63082); Fri, 05 May 2023 18:30:07 +0000 Received: (at 63082) by debbugs.gnu.org; 5 May 2023 18:29:50 +0000 Received: from localhost ([127.0.0.1]:57503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pv0Bi-00038a-2f for submit@debbugs.gnu.org; Fri, 05 May 2023 14:29:50 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:58659) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pv0Be-00036x-0o for 63082@debbugs.gnu.org; Fri, 05 May 2023 14:29:46 -0400 Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-3ef33a83ff1so10077321cf.1 for <63082@debbugs.gnu.org>; Fri, 05 May 2023 11:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683311380; x=1685903380; 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=9LFeL7l7LE5J2ndqbCbw5hKIGzSWVdt45VK5TRc55k4=; b=rUzGGfw1u9+tPV6eOPqvGR7B3CE/5iIA8xeAkOy4z6M8Ufsh5Co36Y1SKhXCI+EVMg 7KTdRPZNXmTus0Kzq2RwIXwJjhPWC52/G0MMuQkSwoWSsZHT7XSkVuHZeGhSeNWzcunj a63fuRBrF+uEr7BAGLMQWO9jygRuZepFihUkVDmrnPSVfOJlpJa21IkYFpOAsxc8NqCz o6lmMEAdqChFz5ZE0vrgIR26lYr5kNR0yBCYY58184S9cw7cZwV66GxOJlOL/VnaQDmr f/bbkC7Id+4kpzDz7QE1zl61UBQkewZeFAZb5tVQclLqAXjDHKwjfW1IOGaBcEgeai2Q NWGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683311380; x=1685903380; 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=9LFeL7l7LE5J2ndqbCbw5hKIGzSWVdt45VK5TRc55k4=; b=XRSDtsnwZ+3oG3TD91gOIJBj3jb/DyOxY3TN4Gl0kfV9oldFRhFMfbsPa51OR1FbC1 y1cfm2GaK/Nno0bwjONhTFzlp99WsmMTZE6eqLgiqpXZk2M5/GWbCMOEYq3oGkGdSZI1 kx2TPz41nX+ER62EqHrfE/NRsa2wC74bMOAjGtM9tDgea9uQJg2XzLePpU/vYfwjJbru aihWDMZhNbNvTtiYt9MKZmDmFKzfzKGoWK5uZxrdwWUYxGbPm3A9Je9chtMpLxfiLA1L FNmOPrHZA6o/HyfS7R6vzIVm1PTvGRyzhtXr9a8RxPI3CAbKJJ5w1cvg4QRZkNKBkdFh 8ASQ== X-Gm-Message-State: AC+VfDz6dk8w1NVzU9TuahIb9KrNOlcyv2kI99TeI3oyco7lKstow1RO 5YTZweau1QxToAVpZ84HC8QYLSEbqP0= X-Google-Smtp-Source: ACHHUZ52MyhudsKfO2QIsiCTMxBwx/ImzuBYJ9fpmtA4hzSCfrNKO358+SP+FyK/l3P15PFL58R4SQ== X-Received: by 2002:a05:622a:93:b0:3ef:4a1d:4b99 with SMTP id o19-20020a05622a009300b003ef4a1d4b99mr4502021qtw.33.1683311380397; Fri, 05 May 2023 11:29:40 -0700 (PDT) Received: from localhost.localdomain (dsl-205-236-230-162.b2b2c.ca. [205.236.230.162]) by smtp.gmail.com with ESMTPSA id c1-20020ac81e81000000b003e97fe68511sm834399qtm.3.2023.05.05.11.29.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 11:29:40 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 5 May 2023 14:29:07 -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-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683311469; a=rsa-sha256; cv=none; b=WyJmDPk4KaEMm/mGHh3iEp0GR7Bmtol3ZkPDAZOF82gM4E4qs6akwlqHRMB+U2mISSbxXi lDBR40oZIhgXW7Q/wbmQgEi7+ZMDha1p3ROjPSkX43JFeKokTZ1OwrcXVHfvgMObSt5ZFv gy/fBLn28XMoPpwK0Fsbk9Zg3XXW+En+k5QdUNHQVS6kTUJkJ+eNXhWnw9GMfPQOeWsf7n 7J9W1uBAIMtUcBm4ynmKi2exvHLNH9vBnRFwUL92ovkhlkUSxGjdISHz5YR+GC3PE/dzaP JQfCM8AjPjrYqEB7ZGFcAxsG0fTsp5/Oh++qg1Ao3gqIDKnBpmcKW7ZqrZz3Yg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=rUzGGfw1; 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=1683311469; 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=9LFeL7l7LE5J2ndqbCbw5hKIGzSWVdt45VK5TRc55k4=; b=F1xa6aPB9mYWDAVhVzFvg5Nt55NbWK9rXpZJe3dwzDcf70JimAeGz9nn5Bk4jpo4DTehb/ 4EaIZqFfPWAlKoTjI11i0Ck4AGnQeN+YKtxwTQlWFA0qK6zCGgQw5V5mQ/A7XsCOGnLraK IgwQDASvn8eQbtPgeOW/jiVnEjH+QqqGfCoLDvY8w5p7k1sd8uwrGz2onUgdcTOMLmJjKu aub0Pu69mGn9gr/m+3dww8E+g/OPG73olsjR0uEjmqe56ysYJ3KZD6vGSCFyUCn+wbE14D qv1Rni4qgT4pZ4Px+UB2t2g8q9ayHjLXJGgQygmIlo+bL2/62KKfR40BoT1SNA== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=rUzGGfw1; 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-Migadu-Spam-Score: 6.30 X-Spam-Score: 6.30 X-Migadu-Queue-Id: 9215D120BA X-TUID: WgeYBXczvNnm 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 f470ca20e0..7040a63ecd 100644 --- a/gnu/services/audio.scm +++ b/gnu/services/audio.scm @@ -31,6 +31,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) @@ -173,6 +174,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") @@ -209,10 +212,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