From: Maxime Devos <maximedevos@telenet.be>
To: zimoun <zimon.toutoune@gmail.com>
Cc: 55673@debbugs.gnu.org, "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'.
Date: Fri, 27 May 2022 13:40:23 +0200 [thread overview]
Message-ID: <0bafbbcf501fc13b9dab096bf03ce7e60afe1c4f.camel@telenet.be> (raw)
In-Reply-To: <CAJ3okZ2EAQLSbTPyQWPcJ4OjuX+qPf6m3N5goGEptEhsSYWV-A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]
zimoun schreef op vr 27-05-2022 om 13:24 [+0200]:
> On Fri, 27 May 2022 at 13:17, Maxime Devos <maximedevos@telenet.be> wrote:
>
> > scheme@(guile-user)> (call-with-input-file "." read)
> > ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> > In procedure fport_read: Is een map
>
> Euh, you are overengineering, no? We are talking about an internal
> file used by the Guix cache. Yes, if the user tweaks this cache, then
> bad things can happen. It is true for almost what lives in
> ~/.cache/guix.
Probably yes. Maybe it makes more sense when applied to get-string-all
+ string->number in a limited form:
(or (string->number
(catch 'system-error
(lambda () (call-with-input-file [...] get-string-all))
(lambda arglist
(if (= ENOENT (system-error-errno arglist))
"0" ; file does not exist
(apply throw arglist)))))
0)
Though even then there remain potential problems, try
scheme@(guile-user)> (string->number "#e1e1000")
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
In procedure string->number: Value out of range: 1000
(seems unlikely to encounter such corruption in practice though).
Greetings,
MAxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
next prev parent reply other threads:[~2022-05-27 11:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 8:25 [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup' zimoun
2022-05-27 9:54 ` Maxime Devos
2022-05-27 10:28 ` zimoun
2022-05-27 11:12 ` Maxime Devos
2022-05-27 11:39 ` zimoun
2022-05-27 11:49 ` Maxime Devos
2022-05-27 12:40 ` zimoun
2022-05-27 13:04 ` Maxime Devos
2022-05-27 13:23 ` zimoun
2022-05-27 13:30 ` zimoun
2022-05-27 14:02 ` Maxime Devos
2022-05-27 16:19 ` zimoun
2022-05-27 17:23 ` Maxime Devos
2022-05-27 11:17 ` Maxime Devos
2022-05-27 11:24 ` zimoun
2022-05-27 11:40 ` Maxime Devos [this message]
2022-05-27 15:46 ` [bug#55673] [PATCH v2] " zimoun
2022-05-27 17:29 ` Maxime Devos
2022-05-30 13:09 ` zimoun
2022-05-30 13:07 ` [bug#55673] [PATCH v3] cache: Catch invalid 'last-expiry-cleanup' zimoun
2022-06-04 10:11 ` bug#55673: [PATCH] cache: Catch valid integer for 'last-expiry-cleanup' 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=0bafbbcf501fc13b9dab096bf03ce7e60afe1c4f.camel@telenet.be \
--to=maximedevos@telenet.be \
--cc=55673@debbugs.gnu.org \
--cc=ludo@gnu.org \
--cc=zimon.toutoune@gmail.com \
/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.