From unknown Sun Aug 10 16:47:55 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#45836 <45836@debbugs.gnu.org> To: bug#45836 <45836@debbugs.gnu.org> Subject: Status: cups-service-type duplicates lp group Reply-To: bug#45836 <45836@debbugs.gnu.org> Date: Sun, 10 Aug 2025 23:47:55 +0000 retitle 45836 cups-service-type duplicates lp group reassign 45836 guix submitter 45836 Leo Prikler severity 45836 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 12 20:09:37 2021 Received: (at submit) by debbugs.gnu.org; 13 Jan 2021 01:09:37 +0000 Received: from localhost ([127.0.0.1]:33789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzUfI-0007gE-Vc for submit@debbugs.gnu.org; Tue, 12 Jan 2021 20:09:37 -0500 Received: from lists.gnu.org ([209.51.188.17]:58030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzUfG-0007g6-Vw for submit@debbugs.gnu.org; Tue, 12 Jan 2021 20:09:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzUfG-0000mt-Gx for bug-guix@gnu.org; Tue, 12 Jan 2021 20:09:34 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:51935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzUfD-0002dx-MN for bug-guix@gnu.org; Tue, 12 Jan 2021 20:09:33 -0500 Received: from nijino.local (217-149-169-137.nat.highway.telekom.at [217.149.169.137]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4DFq903pNQz1LLyL for ; Wed, 13 Jan 2021 02:09:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4DFq903pNQz1LLyL DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1610500164; bh=6zpLu0yACTIbWD5lTrWyYuBXbDk4Ep03JvHJrH3I8wE=; h=Subject:From:To:Date:From; b=Q5Dg20k1l0QuPqyYV/y1ePCVCZKWXkoq9lNUVugsKTDVfJbDsHrUf6p9umlMfF548 QcAbXOA8tlvAMR9h3qzfPXXbGfHM6UeUXazS4uZ0Z+a4IH0A27C2fLRjUD7UoqxgqE b8cRnW09FTd+RUJ2FrLp8C2DfdXu85Wc6vJvZliU= Message-ID: Subject: cups-service-type duplicates lp group From: Leo Prikler To: bug-guix@gnu.org Date: Wed, 13 Jan 2021 02:09:23 +0100 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 Received-SPF: pass client-ip=129.27.2.202; envelope-from=leo.prikler@student.tugraz.at; helo=mailrelay.tugraz.at X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hello Guix, it has come to my attention due to the recent reporting of #45830 and some conversation in IRC, that cups-service-type adds an lp group, which is already defined in %base-groups. Since both share the same definition, this is not too big an issue, but it prohibits us from using a hard error for #45770. I can currently think of two solutions: Either remove the lp group from cups-service-type or remove it from base-groups. Neither sounds particularly awesome. Perhaps we could also delete identical duplicates before asserting that there are none for #45770, but that sounds like a little much effort. Any ideas how else to solve this? Regards, Leo From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 13 06:28:48 2021 Received: (at 45836) by debbugs.gnu.org; 13 Jan 2021 11:28:48 +0000 Received: from localhost ([127.0.0.1]:34517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzeKV-0006CE-Vy for submit@debbugs.gnu.org; Wed, 13 Jan 2021 06:28:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzeKR-0006Bi-7e for 45836@debbugs.gnu.org; Wed, 13 Jan 2021 06:28:46 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54767) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzeKK-00008I-Mj; Wed, 13 Jan 2021 06:28:36 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37312 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kzeKK-00083k-BS; Wed, 13 Jan 2021 06:28:36 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Leo Prikler Subject: Re: bug#45836: cups-service-type duplicates lp group References: Date: Wed, 13 Jan 2021 12:28:34 +0100 In-Reply-To: (Leo Prikler's message of "Wed, 13 Jan 2021 02:09:23 +0100") Message-ID: <874kjlcbz1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45836 Cc: 45836@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Leo, Leo Prikler skribis: > it has come to my attention due to the recent reporting of #45830 and > some conversation in IRC, that cups-service-type adds an lp group, > which is already defined in %base-groups. Since both share the same > definition, this is not too big an issue, but it prohibits us from > using a hard error for #45770. > > I can currently think of two solutions: Either remove the lp group from > cups-service-type or remove it from base-groups. Neither sounds > particularly awesome. Perhaps we could also delete identical > duplicates before asserting that there are none for #45770, but that > sounds like a little much effort. Any ideas how else to solve this? I=E2=80=99d be pragmatic here: 1. Ignore duplicates that are identical (don=E2=80=99t report them). 2. Remove =E2=80=9Clp=E2=80=9D from %base-groups since it has no use with= out CUPS (right?). Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 13 07:07:04 2021 Received: (at 45836) by debbugs.gnu.org; 13 Jan 2021 12:07:04 +0000 Received: from localhost ([127.0.0.1]:34557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzevY-0004zM-3A for submit@debbugs.gnu.org; Wed, 13 Jan 2021 07:07:04 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:7287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzevV-0004yv-46 for 45836@debbugs.gnu.org; Wed, 13 Jan 2021 07:07:02 -0500 Received: from nijino.local (217-149-169-137.nat.highway.telekom.at [217.149.169.137]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4DG5lj4tV7z1LB1x; Wed, 13 Jan 2021 13:06:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4DG5lj4tV7z1LB1x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1610539617; bh=MINyNJb9FEYgERPWW2WC+W/zhcZckX6+kurtHjadf64=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=n15GFzw5N68AagMKtLK+zIZx1c4MrdtKcIPB2p+Ae5Zz+ebMkedzPDWMMJYfZ0hj4 Edx7V84yFS76G1ia/Hlnz6Lmiwgz/UrW9xWlNi4dAXcQt4mO7+5ZZ8xnO4/x/1DvGc q+k7ldDLpcRjKYxzNwvFqT3ieONYVNKWog1q6H80= Message-ID: Subject: Re: bug#45836: cups-service-type duplicates lp group From: Leo Prikler To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Wed, 13 Jan 2021 13:06:56 +0100 In-Reply-To: <874kjlcbz1.fsf@gnu.org> References: <874kjlcbz1.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45836 Cc: 45836@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Ludo, Am Mittwoch, den 13.01.2021, 12:28 +0100 schrieb Ludovic Courtès: > Hi Leo, > > Leo Prikler skribis: > > > it has come to my attention due to the recent reporting of #45830 > > and > > some conversation in IRC, that cups-service-type adds an lp group, > > which is already defined in %base-groups. Since both share the > > same > > definition, this is not too big an issue, but it prohibits us from > > using a hard error for #45770. > > > > I can currently think of two solutions: Either remove the lp group > > from > > cups-service-type or remove it from base-groups. Neither sounds > > particularly awesome. Perhaps we could also delete identical > > duplicates before asserting that there are none for #45770, but > > that > > sounds like a little much effort. Any ideas how else to solve > > this? > > I’d be pragmatic here: > > 1. Ignore duplicates that are identical (don’t report them). Is that still not a problem, because either definition could change? > 2. Remove “lp” from %base-groups since it has no use without CUPS > (right?). That's probably true, but I fear, that some have already added "lp" to their config.scm. Would that cause issues? We could also add CUPS to %base-services or %desktop-services in some way, but that would probably cause issues with configurations, that already have it. Regards, Leo From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 14 06:38:32 2021 Received: (at 45836) by debbugs.gnu.org; 14 Jan 2021 11:38:32 +0000 Received: from localhost ([127.0.0.1]:37341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l00xU-0006up-DC for submit@debbugs.gnu.org; Thu, 14 Jan 2021 06:38:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l00xR-0006uZ-Ow for 45836@debbugs.gnu.org; Thu, 14 Jan 2021 06:38:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49206) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l00xL-0002em-16; Thu, 14 Jan 2021 06:38:23 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42320 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l00xK-0000u1-LD; Thu, 14 Jan 2021 06:38:22 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Leo Prikler Subject: Re: bug#45836: cups-service-type duplicates lp group References: <874kjlcbz1.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 25 =?utf-8?Q?Niv=C3=B4se?= an 229 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 14 Jan 2021 12:38:19 +0100 In-Reply-To: (Leo Prikler's message of "Wed, 13 Jan 2021 13:06:56 +0100") Message-ID: <87turj695g.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45836 Cc: 45836@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Leo, Leo Prikler skribis: >> I=E2=80=99d be pragmatic here: >>=20 >> 1. Ignore duplicates that are identical (don=E2=80=99t report them). > Is that still not a problem, because either definition could change? Sure, but that=E2=80=99s a separate issue, which is what #2 addresses. >> 2. Remove =E2=80=9Clp=E2=80=9D from %base-groups since it has no use w= ithout CUPS >> (right?). > That's probably true, but I fear, that some have already added "lp" to > their config.scm. Would that cause issues? Presumably everyone uses =E2=80=98%base-groups=E2=80=99 and thus everyone a= lready has a definition of =E2=80=9Clp=E2=80=9D, coming from Guix itself. On second thought, my proposal was not so good because as the comment in (gnu system shadow) suggests, there are default udev rules that refer to the =E2=80=9Clp=E2=80=9D group. So it has to exist (to be on the safe side= at least). So perhaps we can leave things unchanged and simply add a comment in (gnu services cups) that the =E2=80=9Clp=E2=80=9D group definition is redun= dant but kept here for clarity. WDYT? If the two =E2=80=9Clp=E2=80=9D eventually come to differ, we=E2=80=99ll no= tice via system tests=E2=80=A6 and bug reports. > We could also add CUPS to > %base-services or %desktop-services in some way, but that would > probably cause issues with configurations, that already have it. Adding CUPS by default is not a reasonable option, no. :-) Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 14 08:07:14 2021 Received: (at 45836) by debbugs.gnu.org; 14 Jan 2021 13:07:14 +0000 Received: from localhost ([127.0.0.1]:37492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l02LJ-0002rQ-Tp for submit@debbugs.gnu.org; Thu, 14 Jan 2021 08:07:14 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:21387) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l02LH-0002rH-Aj for 45836@debbugs.gnu.org; Thu, 14 Jan 2021 08:07:12 -0500 Received: from localhost.localdomain (217-149-169-137.nat.highway.telekom.at [217.149.169.137]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4DGl2g57pLz1LWp5; Thu, 14 Jan 2021 14:07:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4DGl2g57pLz1LWp5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1610629627; bh=T9kqP+lhAj4CLeCja1rIMPK7c83pD0Au6IS9hm16tF4=; h=From:To:Cc:Subject:Date:From; b=Be2HnRkAKIbFOwE96mYjwxdl9dz9w7nyLA3c976UnMvLYy8wFDQENi/e/C46QGNpe ZBNBCQ4joMjnVq0m+vmT1+NgG/uJzosiQtt2HmHUYXRDtMumPh+LgBy8N7cf1HEdn4 SJkZzyVDPyUXFa7ogrtY+v/K/H94UGX62spLIcEM= From: Leo Prikler To: 45836@debbugs.gnu.org Subject: [PATCH] services: Let cups-service-type reuse base lp group. Date: Thu, 14 Jan 2021 14:06:11 +0100 Message-Id: <20210114130610.31936-1-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45836 Cc: ludo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/cups.scm (%cups-accounts): Try to use the lp group defined in %base-groups. * gnu/system/shadow.scm (account-activation): Delete duplicate (eq?) users and groups before transforming them to specs and asserting, that names are unique. --- gnu/services/cups.scm | 10 ++++++++-- gnu/system/shadow.scm | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gnu/services/cups.scm b/gnu/services/cups.scm index f10615e59e..17ed04e58b 100644 --- a/gnu/services/cups.scm +++ b/gnu/services/cups.scm @@ -32,7 +32,7 @@ #:use-module (guix records) #:use-module (guix gexp) #:use-module (ice-9 match) - #:use-module ((srfi srfi-1) #:select (append-map)) + #:use-module ((srfi srfi-1) #:select (append-map find)) #:export (cups-service-type cups-configuration opaque-cups-configuration @@ -50,7 +50,13 @@ ;;; Code: (define %cups-accounts - (list (user-group (name "lp") (system? #t)) + (list (or + ;; The "lp" group should already exist; try to reuse it. + (find (lambda (group) + (and (user-group? group) + (string=? (user-group-name group) "lp"))) + %base-groups) + (user-group (name "lp") (system? #t))) (user-group (name "lpadmin") (system? #t)) (user-account (name "lp") diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index 0538fb1a24..7c57222716 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -321,13 +321,13 @@ of user '~a' is undeclared") objects. Raise an error if a user account refers to a undefined group." (define accounts - (filter user-account? accounts+groups)) + (delete-duplicates (filter user-account? accounts+groups) eq?)) (define user-specs (map user-account->gexp accounts)) (define groups - (filter user-group? accounts+groups)) + (delete-duplicates (filter user-group? accounts+groups) eq?)) (define group-specs (map user-group->gexp groups)) -- 2.30.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 16 13:37:42 2021 Received: (at 45836) by debbugs.gnu.org; 16 Jan 2021 18:37:42 +0000 Received: from localhost ([127.0.0.1]:44051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0qSE-0002bL-Hk for submit@debbugs.gnu.org; Sat, 16 Jan 2021 13:37:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0qSD-0002b8-1i for 45836@debbugs.gnu.org; Sat, 16 Jan 2021 13:37:41 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57190) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0qS5-0007I9-OI; Sat, 16 Jan 2021 13:37:33 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36452 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l0qS5-00013G-BP; Sat, 16 Jan 2021 13:37:33 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Leo Prikler Subject: Re: [PATCH] services: Let cups-service-type reuse base lp group. References: <20210114130610.31936-1-leo.prikler@student.tugraz.at> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 27 =?utf-8?Q?Niv=C3=B4se?= an 229 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 16 Jan 2021 19:37:27 +0100 In-Reply-To: <20210114130610.31936-1-leo.prikler@student.tugraz.at> (Leo Prikler's message of "Thu, 14 Jan 2021 14:06:11 +0100") Message-ID: <875z3wzq1k.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45836 Cc: 45836@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Leo Prikler skribis: > * gnu/services/cups.scm (%cups-accounts): Try to use the lp group defined= in > %base-groups. > * gnu/system/shadow.scm (account-activation): Delete duplicate (eq?) users > and groups before transforming them to specs and asserting, that names are > unique. [...] > (define %cups-accounts > - (list (user-group (name "lp") (system? #t)) > + (list (or > + ;; The "lp" group should already exist; try to reuse it. > + (find (lambda (group) > + (and (user-group? group) > + (string=3D? (user-group-name group) "lp"))) > + %base-groups) > + (user-group (name "lp") (system? #t))) > (user-group (name "lpadmin") (system? #t)) > (user-account > (name "lp") This bit LGTM, and I think it can be committed in a commit of its own. > diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm > index 0538fb1a24..7c57222716 100644 > --- a/gnu/system/shadow.scm > +++ b/gnu/system/shadow.scm > @@ -321,13 +321,13 @@ of user '~a' is undeclared") > objects. Raise an error if a user account refers to a unde= fined > group." > (define accounts > - (filter user-account? accounts+groups)) > + (delete-duplicates (filter user-account? accounts+groups) eq?)) >=20=20 > (define user-specs > (map user-account->gexp accounts)) >=20=20 > (define groups > - (filter user-group? accounts+groups)) > + (delete-duplicates (filter user-group? accounts+groups) eq?)) Why use =E2=80=98eq?=E2=80=99? I=E2=80=99d use =E2=80=98equal?=E2=80=99, b= ut note that records cannot necessarily be compared with =E2=80=98equal?=E2=80=99 because of the= thunked =E2=80=98home-directory=E2=80=99 field (=E2=80=98equal?=E2=80=99 is meaning= less for procedures). Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 16 14:49:27 2021 Received: (at 45836) by debbugs.gnu.org; 16 Jan 2021 19:49:27 +0000 Received: from localhost ([127.0.0.1]:44071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0rZb-0006UH-Ok for submit@debbugs.gnu.org; Sat, 16 Jan 2021 14:49:27 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:60526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0rZW-0006U3-A4 for 45836@debbugs.gnu.org; Sat, 16 Jan 2021 14:49:22 -0500 Received: from nijino.local (217-149-173-242.nat.highway.telekom.at [217.149.173.242]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4DJ7sg20TVz1LLyW; Sat, 16 Jan 2021 20:49:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4DJ7sg20TVz1LLyW DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1610826551; bh=NLKutc5ikNHcKbT0dG+A5XcmhHCeA62G96kj6TTT6N8=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=GmZEWbbJ6PaaQ/DB0tQZkSxOytP+HpcgVLkYv/74574SFG6vKzrsMTpradNLjjdgd PuwOhwIyUoJ8s6SbZzuzl9WJVCRzImpi1+GYiIWnCxKWXJEy7ZOsCCqB1DNBX7rJ/t rSWiMGnNvWnbMBSk0l4R5BLd+aV5D5tArAX5W+Pw= Message-ID: <5c790abbd52abae17c6b449b4982380f9ae26806.camel@student.tugraz.at> Subject: Re: [PATCH] services: Let cups-service-type reuse base lp group. From: Leo Prikler To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Sat, 16 Jan 2021 20:49:10 +0100 In-Reply-To: <875z3wzq1k.fsf@gnu.org> References: <20210114130610.31936-1-leo.prikler@student.tugraz.at> <875z3wzq1k.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45836 Cc: 45836@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Samstag, den 16.01.2021, 19:37 +0100 schrieb Ludovic Courtès: > Hi, > > Leo Prikler skribis: > > > * gnu/services/cups.scm (%cups-accounts): Try to use the lp group > > defined in > > %base-groups. > > * gnu/system/shadow.scm (account-activation): Delete duplicate > > (eq?) users > > and groups before transforming them to specs and asserting, that > > names are > > unique. > > [...] > > > (define %cups-accounts > > - (list (user-group (name "lp") (system? #t)) > > + (list (or > > + ;; The "lp" group should already exist; try to reuse it. > > + (find (lambda (group) > > + (and (user-group? group) > > + (string=? (user-group-name group) "lp"))) > > + %base-groups) > > + (user-group (name "lp") (system? #t))) > > (user-group (name "lpadmin") (system? #t)) > > (user-account > > (name "lp") > > This bit LGTM, and I think it can be committed in a commit of its > own. Will do so once I get my working tree is less dirty. > > diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm > > index 0538fb1a24..7c57222716 100644 > > --- a/gnu/system/shadow.scm > > +++ b/gnu/system/shadow.scm > > @@ -321,13 +321,13 @@ of user '~a' is undeclared") > > objects. Raise an error if a user account refers to > > a undefined > > group." > > (define accounts > > - (filter user-account? accounts+groups)) > > + (delete-duplicates (filter user-account? accounts+groups) > > eq?)) > > > > (define user-specs > > (map user-account->gexp accounts)) > > > > (define groups > > - (filter user-group? accounts+groups)) > > + (delete-duplicates (filter user-group? accounts+groups) eq?)) > > Why use ‘eq?’? I’d use ‘equal?’, but note that > records > cannot necessarily be compared with ‘equal?’ because of the thunked > ‘home-directory’ field (‘equal?’ is meaningless for procedures). My personal reasoning (and perhaps a rather strong opinion) is, that it is an error to add duplicate users even if they happen to be equal?. eq? is only provided as a way out for the specific case of services, that need to do so for safety reasons – e.g. cups to not allow overriding of the lp group if it has been removed from the OS groups for whichever reason. Regards, Leo From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 18 09:47:34 2021 Received: (at 45836) by debbugs.gnu.org; 18 Jan 2021 14:47:34 +0000 Received: from localhost ([127.0.0.1]:46824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1Vob-0005ja-QM for submit@debbugs.gnu.org; Mon, 18 Jan 2021 09:47:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1VoZ-0005jN-HX for 45836@debbugs.gnu.org; Mon, 18 Jan 2021 09:47:32 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57198) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1VoS-0004oA-F5; Mon, 18 Jan 2021 09:47:24 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55750 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l1VoQ-0008Lv-4b; Mon, 18 Jan 2021 09:47:23 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Leo Prikler Subject: Re: [PATCH] services: Let cups-service-type reuse base lp group. References: <20210114130610.31936-1-leo.prikler@student.tugraz.at> <875z3wzq1k.fsf@gnu.org> <5c790abbd52abae17c6b449b4982380f9ae26806.camel@student.tugraz.at> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 29 =?utf-8?Q?Niv=C3=B4se?= an 229 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 18 Jan 2021 15:47:20 +0100 In-Reply-To: <5c790abbd52abae17c6b449b4982380f9ae26806.camel@student.tugraz.at> (Leo Prikler's message of "Sat, 16 Jan 2021 20:49:10 +0100") Message-ID: <875z3ul2tj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45836 Cc: 45836@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Leo Prikler skribis: >> > diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm >> > index 0538fb1a24..7c57222716 100644 >> > --- a/gnu/system/shadow.scm >> > +++ b/gnu/system/shadow.scm >> > @@ -321,13 +321,13 @@ of user '~a' is undeclared") >> > objects. Raise an error if a user account refers to >> > a undefined >> > group." >> > (define accounts >> > - (filter user-account? accounts+groups)) >> > + (delete-duplicates (filter user-account? accounts+groups) >> > eq?)) >> >=20=20 >> > (define user-specs >> > (map user-account->gexp accounts)) >> >=20=20 >> > (define groups >> > - (filter user-group? accounts+groups)) >> > + (delete-duplicates (filter user-group? accounts+groups) eq?)) >>=20 >> Why use =E2=80=98eq?=E2=80=99? I=E2=80=99d use =E2=80=98equal?=E2=80=99= , but note that >> records >> cannot necessarily be compared with =E2=80=98equal?=E2=80=99 because of = the thunked >> =E2=80=98home-directory=E2=80=99 field (=E2=80=98equal?=E2=80=99 is mean= ingless for procedures). > My personal reasoning (and perhaps a rather strong opinion) is, that it > is an error to add duplicate users even if they happen to be equal?.=20 > eq? is only provided as a way out for the specific case of services, > that need to do so for safety reasons =E2=80=93 e.g. cups to not allow > overriding of the lp group if it has been removed from the OS groups > for whichever reason. Ah I see, makes sense to me! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 20 03:16:18 2021 Received: (at 45836-done) by debbugs.gnu.org; 20 Jan 2021 08:16:18 +0000 Received: from localhost ([127.0.0.1]:52755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l28f4-0007BD-0f for submit@debbugs.gnu.org; Wed, 20 Jan 2021 03:16:18 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:47213) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l28f2-0007B4-B4 for 45836-done@debbugs.gnu.org; Wed, 20 Jan 2021 03:16:16 -0500 Received: from nijino.local (217-149-173-242.nat.highway.telekom.at [217.149.173.242]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4DLJJG2P3Dz1LBRv; Wed, 20 Jan 2021 09:16:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4DLJJG2P3Dz1LBRv DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1611130574; bh=JJs3b3eU/L/yrMfcOqK2jK2u+a/3v9Psi4uEHj2eTts=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=MHJj8hMC/bY9UvRXJg0LQweZwHecPPaTjtUxaHSguQVLyxrt3D+HyKUhgD0JqIuuA auxHvzyRsK5CAl6gr3lfvr1FG6aOrr5WzKI7Eg3afWdfDPOvir4N3A9fHqRP2gdhDH h0K6LW/swgjucSIs0ccVq0RJ0DHuUidVMQarAhj8= Message-ID: Subject: Re: [PATCH] services: Let cups-service-type reuse base lp group. From: Leo Prikler To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Wed, 20 Jan 2021 09:16:13 +0100 In-Reply-To: <875z3ul2tj.fsf@gnu.org> References: <20210114130610.31936-1-leo.prikler@student.tugraz.at> <875z3wzq1k.fsf@gnu.org> <5c790abbd52abae17c6b449b4982380f9ae26806.camel@student.tugraz.at> <875z3ul2tj.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45836-done Cc: 45836-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Montag, den 18.01.2021, 15:47 +0100 schrieb Ludovic Courtès: > Hi, > > Leo Prikler skribis: > > > > > diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm > > > > index 0538fb1a24..7c57222716 100644 > > > > --- a/gnu/system/shadow.scm > > > > +++ b/gnu/system/shadow.scm > > > > @@ -321,13 +321,13 @@ of user '~a' is undeclared") > > > > objects. Raise an error if a user account refers > > > > to > > > > a undefined > > > > group." > > > > (define accounts > > > > - (filter user-account? accounts+groups)) > > > > + (delete-duplicates (filter user-account? accounts+groups) > > > > eq?)) > > > > > > > > (define user-specs > > > > (map user-account->gexp accounts)) > > > > > > > > (define groups > > > > - (filter user-group? accounts+groups)) > > > > + (delete-duplicates (filter user-group? accounts+groups) > > > > eq?)) > > > > > > Why use ‘eq?’? I’d use ‘equal?’, but note that > > > records > > > cannot necessarily be compared with ‘equal?’ because of the > > > thunked > > > ‘home-directory’ field (‘equal?’ is meaningless for procedures). > > My personal reasoning (and perhaps a rather strong opinion) is, > > that it > > is an error to add duplicate users even if they happen to be > > equal?. > > eq? is only provided as a way out for the specific case of > > services, > > that need to do so for safety reasons – e.g. cups to not allow > > overriding of the lp group if it has been removed from the OS > > groups > > for whichever reason. > > Ah I see, makes sense to me! I've now pushed it with eq?, if there's a (good!) reason to change that to equal?, it can still be done later. Regards, Leo From unknown Sun Aug 10 16:47:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 17 Feb 2021 12:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator