From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 wKHFANo/TGTHqgAASxT56A (envelope-from ) for ; Fri, 28 Apr 2023 23:51:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id yBzUANo/TGQ+2AAAauVa8A (envelope-from ) for ; Fri, 28 Apr 2023 23:51:22 +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 A0BFC45FF2 for ; Fri, 28 Apr 2023 23:51:21 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psVzc-0006h8-RI; Fri, 28 Apr 2023 17:51:04 -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 1psVza-0006gk-P8 for bug-guix@gnu.org; Fri, 28 Apr 2023 17:51: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 1psVza-0006pl-8t for bug-guix@gnu.org; Fri, 28 Apr 2023 17:51:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1psVzZ-0002QK-Lw for bug-guix@gnu.org; Fri, 28 Apr 2023 17:51:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63082: [PATCH 04/17] services: mpd: Obsolete the 'group' field. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 28 Apr 2023 21:51:01 +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: Maxim Cournoyer Cc: 63082@debbugs.gnu.org Received: via spool by 63082-submit@debbugs.gnu.org id=B63082.16827186279128 (code B ref 63082); Fri, 28 Apr 2023 21:51:01 +0000 Received: (at 63082) by debbugs.gnu.org; 28 Apr 2023 21:50:27 +0000 Received: from localhost ([127.0.0.1]:34675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psVz0-0002NA-N3 for submit@debbugs.gnu.org; Fri, 28 Apr 2023 17:50:27 -0400 Received: from smtpmciv1.myservices.hosting ([185.26.107.237]:37698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psVyy-0002N1-Iv for 63082@debbugs.gnu.org; Fri, 28 Apr 2023 17:50:25 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv1.myservices.hosting (Postfix) with ESMTP id 18D0E20C19; Fri, 28 Apr 2023 23:50:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 9D36A80097; Fri, 28 Apr 2023 23:50:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id o7a48F_DV_fQ; Fri, 28 Apr 2023 23:50:19 +0200 (CEST) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 010DA80060; Fri, 28 Apr 2023 23:50:18 +0200 (CEST) Message-ID: <0f027280-0cf3-dd82-3ec1-3bffddc638c0@makinata.eu> Date: Fri, 28 Apr 2023 22:50:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Content-Language: en-US References: From: Bruno Victal In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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=1682718681; a=rsa-sha256; cv=none; b=INmtR06Z4TY8YmqrUhFG111bN2i/c+cKLdwjnO4jiad9VZyfYF9lEEXiSKkL9iscY+UXH9 5GWDfaxtK5prYG7syHxnY//siCaQyJL4tSwmk5qP40XI2kouoXUP8jaLLEt4p6E2A+O+jw cqM+PItihkN4cSQFRSTRvHj2VTFXLosDDNdWjFuVhuhkDH5Xf3Uabltg8PnUHOPG4VKaOR Qd3Lpd5Boveg98lzVtMuX1v/dDIosafmppluaSA6aB02O2WhZyVgOeNk1TEjTDn2uqp1oH qqvHv3t51aFQcjzKYnfcUQrbjdBPhXb3dzeQgrWQnfasQIAJpnZLiT5meX5lEg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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=1682718681; 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: 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; bh=YxJL5NCfDyXlm8uo4HZshvTmyr27lPb2I2iP6H/nKUQ=; b=AksZ+dQr5K5cOL19h2NGRQpzo8+x22C+4aLSjIwcP/lR2JG1HZ+XuYzVagfs8fGDXUPtnx Zz0OzMqaOLVcHicwruANMIFZRgXdFOvxhCU3K9VFARBVgeDkOPnkcjJsHkss+fQie4aX1j SkR0UYrXmcoeWTWuqeB16Hmoupc1SjZpfTE8aVyS0c8FjYCWh0CtWxk31ensBJqg2u7OfP FTJ0EbKVE//rmbykD7+lhGRU4+cq4mEDj/i/d0FOpH1S0tkKXzZq0JBgaEFjLbD1Xqxffk lRiUEfuheK64iMCxy3LTiP2Afs5TDvAljuiC3Xv8o3T/1pCC5ipU6boHn50gYw== X-Migadu-Spam-Score: -3.21 X-Spam-Score: -3.21 X-Migadu-Queue-Id: A0BFC45FF2 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: 4lfJhM+M4UEf On 2023-04-28 15:26, Maxim Cournoyer wrote: > Prior to this change, there was a discrepancy where a user could have > disagreeing groups between the group and user fields (the user field being a > record, which includes its primary group as a string). This > could have caused problems because the USER's group was being used to set the > file permissions, while the GROUP name was serialized to MPD's configuration, > and MPD would use it to set the group of its running process. Synchronizing > both is not practical, as it can easily lead to slightly different > objects conflicting, again causing problems. > > The compromise is to obsolete the 'group' field. A group can still be > configured via the 'user' field, which accepts a object, with > the limitation that the group should already exist. > > * gnu/services/audio.scm (%lazy-group): Delete variable. > (%set-user-group): Delete procedure. > (mpd-serialize-user-group): Likewise. > (%mpd-user) [group]: Default to "audio". > (%mpd-group): Delete variable. > (mpd-group-sanitizer, mympd-group-sanitizer): Adjust sanitizers. > (mpd-configuration, mympd-configuration) [group]: Default to #f. Update doc. > (mpd-accounts, mympd-accounts): Remove group. > (%mympd-user) [group]: Default to "nogroup". > * doc/guix.texi: Regenerate doc. > --- > doc/guix.texi | 15 ++++---- > gnu/services/audio.scm | 80 ++++++++++++------------------------------ > 2 files changed, 28 insertions(+), 67 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index f8acdbd6b5..34703b1698 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -33571,8 +33571,8 @@ Audio Services > @item @code{user} (type: user-account) > The user to run mpd as. > > -@item @code{group} (type: user-group) > -The group to run mpd as. > +@item @code{group} (default: @code{#f}) (type: boolean) > +Obsolete. Do not use. [...] > > @item @code{shepherd-requirement} (default: @code{()}) (type: list-of-symbol) > This is a list of symbols naming Shepherd services that this service > @@ -33824,15 +33824,12 @@ Audio Services > This is a list of symbols naming Shepherd services that this service > will depend on. > > -@item @code{user} (default: @code{%mympd-user}) (type: user-account) > +@item @code{user} (type: user-account) > Owner of the @command{mympd} process. > > -The default @code{%mympd-user} is a system user with the name ``mympd'', > -who is a part of the group @var{group} (see below). > -@item @code{group} (default: @code{%mympd-group}) (type: user-group) > -Owner group of the @command{mympd} process. > +@item @code{group} (default: @code{#f}) (type: boolean) > +Obsolete. Do not use. I'd skip documenting obsolete fields. > > -The default @code{%mympd-group} is a system group with name ``mympd''. > @item @code{work-directory} (default: @code{"/var/lib/mympd"}) (type: string) > Where myMPD will store its data. > > @@ -33872,7 +33869,7 @@ Audio Services > Override URI to myMPD. See > @uref{https://github.com/jcorporation/myMPD/issues/950}. > > -@item @code{script-acl} (default: @code{(mympd-ip-acl (allow '("127.0.0.1")))}) (type: maybe-mympd-ip-acl) > +@item @code{script-acl} (type: maybe-mympd-ip-acl) > ACL to access the myMPD script backend. Unrelated change? > (define mpd-deprecated-fields '((music-dir . music-directory) > @@ -242,15 +224,9 @@ (define (mpd-user-sanitizer value) > (configuration-field-error #f 'user value)))) > > (define (mpd-group-sanitizer value) > - (cond ((user-group? value) value) > - ((string? value) > - (warning (G_ "string value for 'group' is deprecated, use \ > -user-group instead~%")) > - (user-group > - (inherit %mpd-group) > - (name value))) > - (else > - (configuration-field-error #f 'group value)))) > + (when value > + (warning (G_ "'group' in is obsolete; ignoring~%"))) > + #f) You can drop the trailing #f I think. > > ;;; > > @@ -407,9 +383,10 @@ (define-configuration mpd-configuration > (sanitizer mpd-user-sanitizer)) > > (group > - (user-group %mpd-group) > - "The group to run mpd as." > - (sanitizer mpd-group-sanitizer)) > + (boolean #f) > + "Obsolete. Do not use." > + (sanitizer mpd-group-sanitizer) > + (serializer empty-serializer)) You can simply use empty-serializer after (or before) sanitizer, it is a recognized literal for define-configuration. > > (define (mympd-group-sanitizer value) > - (cond ((user-group? value) value) > - ((string? value) > - (warning (G_ "string value for 'group' is not supported, use \ > -user-group instead~%")) > - (user-group > - (inherit %mympd-group) > - (name value))) > - (else > - (configuration-field-error #f 'group value)))) > + (when value > + (warning (G_ "'group' in is obsolete; ignoring~%"))) > + #f) Trailing #f as mentioned above. > @@ -737,10 +704,10 @@ (define-configuration/no-serialization mympd-configuration > empty-serializer) > > (group > - (user-group %mympd-group) > - "Owner group of the @command{mympd} process." > + (boolean #f) > + "Obsolete. Do not use." > (sanitizer mympd-group-sanitizer) > - empty-serializer) > + (serializer empty-serializer)) empty-serializer is a literal here. (although it's simply being used for indication per the comment above this record-type) > > (work-directory > (string "/var/lib/mympd") > @@ -904,12 +871,9 @@ (define (mympd-shepherd-service config) > (stop #~(make-kill-destructor)))))) > > (define (mympd-accounts config) > - (match-record config (user group) > - ;; TODO: Deprecation code, to be removed. > - (let ((user (if (eq? (user-account-group user) %lazy-group) > - (set-user-group user group) > - user))) > - (list user group)))) > + (match-record config > + (user) > + (list user))) Nitpick, personally I'm a fan of styling this part as: --8<---------------cut here---------------start------------->8--- (match-record config (user) (list user)) --8<---------------cut here---------------end--------------->8---