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 ms5.migadu.com with LMTPS id YPSYFz3X9GJ8UgEAbAwnHQ (envelope-from ) for ; Thu, 11 Aug 2022 12:17:33 +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 sByeFz3X9GKvEQAA9RJhRA (envelope-from ) for ; Thu, 11 Aug 2022 12:17:33 +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 BFC383C915 for ; Thu, 11 Aug 2022 12:17:32 +0200 (CEST) Received: from localhost ([::1]:37572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM5Fr-0000Zt-Ek for larch@yhetil.org; Thu, 11 Aug 2022 06:17:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM5FP-0000ZS-8x for bug-guix@gnu.org; Thu, 11 Aug 2022 06:17:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM5FO-0005bD-AE for bug-guix@gnu.org; Thu, 11 Aug 2022 06:17:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM5FO-0004ub-2o for bug-guix@gnu.org; Thu, 11 Aug 2022 06:17:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#56799: (gnu services configuration) usage of *unspecified* is problematic Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 11 Aug 2022 10:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56799 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Maxim Cournoyer Cc: 56799@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 56799-submit@debbugs.gnu.org id=B56799.166021297018816 (code B ref 56799); Thu, 11 Aug 2022 10:17:02 +0000 Received: (at 56799) by debbugs.gnu.org; 11 Aug 2022 10:16:10 +0000 Received: from localhost ([127.0.0.1]:51726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM5EX-0004tQ-Kv for submit@debbugs.gnu.org; Thu, 11 Aug 2022 06:16:10 -0400 Received: from mail-40136.proton.ch ([185.70.40.136]:56147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM5ES-0004sd-Vv for 56799@debbugs.gnu.org; Thu, 11 Aug 2022 06:16:08 -0400 Date: Thu, 11 Aug 2022 10:15:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail; t=1660212958; x=1660472158; bh=xDUvnKFAqXBLtJWu7JUdC34tAdoXiTynmQC55DIGSn8=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=Il6/BigE1Rjk9swvNCzqzHuubBhGNCmAZwRHMHw4ED+6XwO12JQjEhKTGyMMLeI1k QbYT14N/j8Hq5DogpXk3aj2xk4l9KUSxBNg/nUKa5lSVZt0XiFrR3GVknG2NWibz23 dV4bJpsimFB12FM4OKOOHz5DN6GaJTl7I7GBvIzs8fmiPeWQd3oHPfJcY+EHtYNobF EvGozzCTn0EUPUq9I2fHPcxFrLu5P8wBgCnXa8U/9zDLJg03P+bnJaNZ6EZHpJRgIa clxYYZCQZ1yD4YE7ySB3JQvr43Oz6r0HbvBGNrK7FX8SJlzPJ76uSHThYaTmcR4r6W SWIpv7B44wbZA== From: Attila Lendvai Message-ID: In-Reply-To: <878rnwn5i4.fsf@gmail.com> References: <87o7xa8qxt.fsf@gmail.com> <8735egxedv.fsf@gnu.org> <87les82c2f.fsf@gmail.com> <87v8rbumnx.fsf@gnu.org> <87sfme1y8m.fsf@gmail.com> <877d3omc9c.fsf@gnu.org> <878rnwn5i4.fsf@gmail.com> Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: Attila Lendvai Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660213053; h=from:from:sender:sender:reply-to: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:dkim-signature; bh=xDUvnKFAqXBLtJWu7JUdC34tAdoXiTynmQC55DIGSn8=; b=MxJ0yYTX1MYCc1TynDM3P7umAuDqMkp3c3CWJu7w6X2D4x665znFqhyw9vw2oAylwEgQuy O6gvKW/tEO7B2ZJlC+zm9Azy4COuK50+VkaqnEaFSPL5mtmaN24o1gVtEOHd0z370pqRLY YVS7oiA1v86YwlQzwUaMAFKGbMd2ZxVICiX9Kl+1/QvDwiF3Hunule+3R+KOCaKW+4Mp5b LO/Ie62062/4EYMXdG0EO+b1Jx7ZQWQY/Wc1T6wc5KmUv+EwUd4BC+oR9ww8rrR+dUFWcO +J/zyqfmccfruI+Nwny+tYX0/FrumFwBAeZSjBv/wgleIIRnG7cqvLVYtRQN6A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660213053; a=rsa-sha256; cv=none; b=U1Gp6IsR+P6oGjYbE6D+eLqBwQ+IvsBiqZCopTWuT6ikHr7+yRWFL0I7emAApMlk6q+hye bN6fsTuLYAqEBhyUw3SirxYVtsx18t48NKGai0l9XyG0TccaJDyjEB7TahrIDQvhgFAZnA VYRu7ULNJCWsEancGpVCFEEydetsZ7EFrH34N1Oa7tzDzk7g2IYDJG8AjZAlisK39wSE5q b1bwbVOkD3EjMF6RUeKFDS/FEDZcF7cR+BTnRIQPVBkeexREJyuz3OSaET1ddMqnHOx6A1 UFz+BfWmwqNKSM30x7JlQB4Gk6j6xoy71gErBAasHbsOmY/mgJbsKU+8eSVX1A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lendvai.name header.s=protonmail header.b="Il6/BigE"; 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-Migadu-Spam-Score: 2.62 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lendvai.name header.s=protonmail header.b="Il6/BigE"; 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-Migadu-Queue-Id: BFC383C915 X-Spam-Score: 2.62 X-Migadu-Scanner: scn1.migadu.com X-TUID: 1aMUSpyryCj6 > OK, I've reread this, and it is indeed a risk, that 'unset could leak in > the case of a serializable configuration making use of a maybe-value > field of type maybe-symbol. I've added the unit test suggested as > 97cb43e732a38758c95b7caf3963507188d011cf (currently marked as 'expected > to fail'). Luckily no current service uses that. thank you for that Maxim! and sorry for my initial, somewhat reactive, and emotionally driven respons= e earlier! maintaining a channel with complex services, and finally getting= the changes i needed merged into Guix proper was a source of frustration f= or me. i've looked at the current state of the code, and it looks good to me. the = only issues i have left are the following: 1) the (eq 'unset ...) scattered around the code; it should be hidden behin= d an explicit abstraction, but you yourself mentioned this already in an ea= rlier mail. i'd call it CONFIGURATION-FIELD-SET? (instead of MAYBE-SET?). i= t's longer, but we have completion in emacs, and it won't be used a gazilli= on times all around the code either. 2) the lack of an abstraction for the unset/unspecified value. whatever we = use as the marker should be hidden behind either an exported global variabl= e, or a function called UNSET-CONFIGURATION-FIELD! (or something alike). i = should have introduced these myself, and then your fix would have been as s= imple as replacing *UNSPECIFIED* with 'UNSET in the abstraction. 3) the SYMBOL? corner case that your test captures, but it's not a burning = issue for me (it doesn't affect the user facing API, once the above leakage= s are fixed). do you agree? if yes, will you implement it, or shall i prepare a patch? one more note: sometimes it's useful to have a field with a maybe type that= also has a default, together with the ability to explicitly unset this fie= ld. an example would be a port specification for a torrent client: it has some = default port, but it's possible to explicitly unset the port value to reque= st the allocation of a random port at startup. to better accommodate for this use case, 2) should probably be implemented = not as an UNSET-FOO! function, but as a global variable holding the unset v= alue marker. or maybe both? -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CThere is only one thing more harmful to society than an elected of= ficial forgetting the promises he made in order to get elected; that's when= he doesn't forget them.=E2=80=9D =09=E2=80=94 John McCarthy (1927=E2=80=932011), father of Lisp