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 ms0.migadu.com with LMTPS id GJNTKet8OWLBzgAAgWs5BA (envelope-from ) for ; Tue, 22 Mar 2022 08:38:19 +0100 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 QBbxIet8OWIqpgAAG6o9tA (envelope-from ) for ; Tue, 22 Mar 2022 08:38:19 +0100 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 DAA8926956 for ; Tue, 22 Mar 2022 08:38:18 +0100 (CET) Received: from localhost ([::1]:34018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWZ5t-0007bW-Fd for larch@yhetil.org; Tue, 22 Mar 2022 03:38:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWZ5e-0007bJ-Sy for guix-patches@gnu.org; Tue, 22 Mar 2022 03:38:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWZ5e-0001Dh-Jr for guix-patches@gnu.org; Tue, 22 Mar 2022 03:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nWZ5e-0008Qw-D6 for guix-patches@gnu.org; Tue, 22 Mar 2022 03:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54352] [PATCH] services: dnsmasq: Add more options. Resent-From: Remco van 't Veer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 22 Mar 2022 07:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54352 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 54352@debbugs.gnu.org Received: via spool by 54352-submit@debbugs.gnu.org id=B54352.164793462632351 (code B ref 54352); Tue, 22 Mar 2022 07:38:02 +0000 Received: (at 54352) by debbugs.gnu.org; 22 Mar 2022 07:37:06 +0000 Received: from localhost ([127.0.0.1]:39073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWZ4k-0008Pj-Iv for submit@debbugs.gnu.org; Tue, 22 Mar 2022 03:37:06 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:44451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWZ4i-0008PB-QN for 54352@debbugs.gnu.org; Tue, 22 Mar 2022 03:37:05 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 94C3F3200D53; Tue, 22 Mar 2022 03:36:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 22 Mar 2022 03:36:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=remworks.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; bh=P/z5Q42yIMMkq7 RzbU4Cj5CmeerxwlDnKGe1mIUxfkE=; b=XM2kwmiKevh7iDleUY/qKKQOzHyvFo irk2WXe/+bUy4434vDf5f5uld945cZbsu7dtXYbLVIoBWP1+zRTgmb9+4QN8NaAn 6DLPvg2BfjR5fnFpGsVaJ/OokfHr5j73Ytdpb1gP43v2iGS2PLkXuml26nbC+Xnm tHVbb7rPLx/thPucbQnbfZl5nH1lG3KhFKrggXJMcx9LEWicBPPHRY22rKefp/v5 TtM3fZDvPuJ5wjn1PGfUUQEXxLm+uTq2ukpygC5m+afFxQsCtyxueSIsDj3nYM/0 3xXo7shr0mkwmRSOSZfyQUX303ThWDWBEyKuKiBOYXRv/pCOHglbpHkA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=P/z5Q42yIMMkq7RzbU4Cj5CmeerxwlDnKGe1mIUxf kE=; b=YGjRLiTex0Sh3vXsSVcTatGAsueaDlHE3WsIWWDJGN2Ucx1v+8ztcFJFB +hNS1rcgm4DjPnQ2VWudLEkQvYykSIIdAKDQYMOgvfCUgS+TvbWRBTBli56g0uQK zdkeSBdOnS6cV5H07vLaiQ4TYpMvdhd/y/dWj0ojtayTC9FpiWxCQpK48aYeffIf i1N89SwKzvtsDzsTKii9AIHwmT6Y9Qkbzm3CQ997955VvGOceUiEsOo4hqsCU6gZ nJIsdFphvcUqdfCEbSVlG1uJYmx8rD5aNw+exxk1jH0Qm7YUcqi8dscjAK9OI7OA Rhni8db2zAWvAUT6V+3yXVbmWTS7g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeggedguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvffujgffkfggtgfgsehtqhertddtreejnecuhfhrohhmpeftvghm tghouchvrghnucdkthcugggvvghruceorhgvmhgtohesrhgvmhifohhrkhhsrdhnvghtqe enucggtffrrghtthgvrhhnpeefteefueefvddvheeltdffgeevheehgefggefgfeetuedv keekkeefvdfgiedufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehrvghmtghosehrvghmfihorhhkshdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Mar 2022 03:36:57 -0400 (EDT) References: <20220312154813.5538-1-remco@remworks.net> <20220320114405.4702-1-remco@remworks.net> <8735jbjpoj.fsf_-_@gnu.org> <2287729e13ea8689713cefe61e28abba9e817308.camel@telenet.be> User-agent: mu4e 1.6.10; emacs 27.2 From: Remco van 't Veer In-reply-to: <2287729e13ea8689713cefe61e28abba9e817308.camel@telenet.be> Date: Tue, 22 Mar 2022 08:36:54 +0100 Message-ID: <8735jabfqh.fsf@remworks.net> 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: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" 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=1647934699; 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:dkim-signature; bh=P/z5Q42yIMMkq7RzbU4Cj5CmeerxwlDnKGe1mIUxfkE=; b=j1qouimmtU2kOxBcxHsR1L9HAlAVi1pDwUkxQBv0QDQrH8ZgGPWSTijEEb/jGlmTu7STdZ w4UtikO2aiOIpCqojzuHDOo4c6XJBbXt/ElgL9Kdo67jZHPAqCUQbRu2e+4Aet5dCmlYlB M+etUXS2WsiyH68s7RM+O7UUYWrKqSqgf466fLOln4/1Vl8r/GA5JcLV8vqMKiZKd0fAru GElHrIxGqswEmIcrp+HPrKRIlYUAGD3r30pl2Kqwp3wo+VLiGiuVRSbEV9gAzy6JXojQgW c171evbqkk85DX0GGKmCrE/7tx9P8e5j7lhFbmPtZlTKkDfPpLXh2PKXNiow3g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647934699; a=rsa-sha256; cv=none; b=gCpPrYjvNNwS9OX92JSsmMWLirxnLA2YpuyVGY5Pj8PR4NbxLW/tOUf8GwgA1e+QOfSreX llqZjLWboYk0zoz4Y0T0JlvFBPRIbHu1CjN17epGyTkdh47puqttPVskaqjRSlzSYR0a2I ZKXmC77lDtSy2XaksH1gM+hUUcyaizUjp4vjt5IKOSWsM6ELZki32DZlHHmsDtOZ2QOx44 FkzLBLdhWvEOXkQ/00jd7Esc5RbTcLCjI29UEusdIPgPkfB9lIVynfR64GspXyVcRIQAqP fguzjJ/zguFiqzo8eS4Gh3alS9n2xAaU8+MK5vyCmrV/wk78phq4u/7vpVntOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=remworks.net header.s=fm3 header.b=XM2kwmiK; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm3 header.b=YGjRLiTe; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.21 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=remworks.net header.s=fm3 header.b=XM2kwmiK; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm3 header.b=YGjRLiTe; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: DAA8926956 X-Spam-Score: -0.21 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0xDjTjldqDJW 2022/03/21 19:36, Maxime Devos: > [[PGP Signed Part:Undecided]] > Ludovic Court=C3=A8s schreef op ma 21-03-2022 om 16:22 [+0100]: >> I think this suggestion is beyond the scope of this review: we=E2=80=99v= e never >> used sanitizers like this before (or almost), and this particular piece >> of code doesn=E2=80=99t use them. >> >> Also, with the recent discussion about the introduction of contracts, >> I=E2=80=99d rather wait an use contracts everywhere once they=E2=80=99re= available. > > Seems reasonable to me, given that the specifics weren't discussed yet, > although _everywhere_ (for all procedures, records, ...) seems a bit > much, unless you meant every field of the dnsmasq record. I can add something like the following: (define (assert-boolean value) (unless (false-if-exception (boolean? value)) (error-out (format #f "expected a boolean, got: ~s" value))) value) and use it to do (sanitize assert-boolean) on all boolean fields of dnsmasq but I agree with Ludo about this being a bigger issue which can be solved much more elegantly (including i18n and source location etc). In the above I borrowed error-out from knot in the same file which also doesn't do i18n and source locations. I'd like to leave it out because the codebase has plenty more unverified booleans and basic if-statements which go the unexpected route when passed a "false" string.