all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Remco van 't Veer <remco@remworks.net>
To: Maxime Devos <maximedevos@telenet.be>
Cc: "Ludovic Courtès" <ludo@gnu.org>, 54352@debbugs.gnu.org
Subject: [bug#54352] [PATCH] services: dnsmasq: Add more options.
Date: Tue, 22 Mar 2022 08:36:54 +0100	[thread overview]
Message-ID: <8735jabfqh.fsf@remworks.net> (raw)
In-Reply-To: <2287729e13ea8689713cefe61e28abba9e817308.camel@telenet.be>

2022/03/21 19:36, Maxime Devos:

> [[PGP Signed Part:Undecided]]
> Ludovic Courtès schreef op ma 21-03-2022 om 16:22 [+0100]:
>> I think this suggestion is beyond the scope of this review: we’ve never
>> used sanitizers like this before (or almost), and this particular piece
>> of code doesn’t use them.
>>
>> Also, with the recent discussion about the introduction of contracts,
>> I’d rather wait an use contracts everywhere once they’re 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.




  reply	other threads:[~2022-03-22  7:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-12 15:48 [bug#54352] [PATCH] services: dnsmasq: Add more options Remco van 't Veer
2022-03-19 10:54 ` Ludovic Courtès
2022-03-20 11:42   ` Remco van 't Veer
2022-03-20 11:44 ` [bug#54352] [PATCH v2] " Remco van 't Veer
2022-03-20 11:56   ` Maxime Devos
2022-03-20 12:22     ` Remco van 't Veer
2022-03-20 12:30       ` Maxime Devos
2022-03-20 13:04         ` Remco van 't Veer
2022-03-21 15:22     ` [bug#54352] [PATCH] " Ludovic Courtès
2022-03-21 18:36       ` Maxime Devos
2022-03-22  7:36         ` Remco van 't Veer [this message]
2022-03-22 10:02           ` Ludovic Courtès
2022-03-23  7:09             ` Remco van 't Veer
2022-03-20 12:31   ` [bug#54352] [PATCH v2] " Maxime Devos
2022-03-20 12:58     ` Remco van 't Veer
2022-03-20 12:32   ` Maxime Devos
2022-03-20 12:57     ` Remco van 't Veer
2022-03-20 13:16       ` Maxime Devos
2022-03-22  7:54         ` Remco van 't Veer
2022-03-20 12:36   ` Maxime Devos
2022-03-20 13:15     ` Remco van 't Veer
2022-03-20 13:17       ` Maxime Devos
2022-03-22  7:48         ` Remco van 't Veer
2022-03-20 13:20       ` Maxime Devos
2022-03-22  7:40         ` Remco van 't Veer
2022-03-23  7:07 ` [bug#54352] [PATCH v3] " Remco van 't Veer
2022-03-24 11:22   ` bug#54352: [PATCH] " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735jabfqh.fsf@remworks.net \
    --to=remco@remworks.net \
    --cc=54352@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.