SHEPHERD-SERVICE-CANONICAL-NAME assumes a non-empty PROVISION, but such instantiation is allowed

  • Done
  • quality assurance status badge
Details
2 participants
  • Attila Lendvai
  • Ludovic Courtès
Owner
unassigned
Submitted by
Attila Lendvai
Severity
normal
A
A
Attila Lendvai wrote on 9 Jun 2023 17:18
(name . bug-guix@gnu.org)(address . bug-guix@gnu.org)
nPF3cOv2rjMEjWngE9bFQbCBsBwTEvAYKt48MJ32iUwMk7sfvdbidIecUsU7WlaRdjkO8B3opGmXWYZkfXBm6PEgoyJr9-DwoTv4xnGxWiw=@lendvai.name
it's possible to instantiate a SHEPHERD-SERVICE with an empty list as PROVISION, but then much later in time and space SHEPHERD-SERVICE-CANONICAL-NAME dies on it.

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“You live within a framework of perception that's determined by your values. […] We never think of the world as something that reveals itself through our values, but of course it does! Because you look at what you want. […] Whatever you're focusing on is directed by what you value.”
— Jordan Peterson (1962–)
L
L
Ludovic Courtès wrote on 17 Jun 2023 16:04
(name . Attila Lendvai)(address . attila@lendvai.name)(address . 63979@debbugs.gnu.org)
87r0qaqj5w.fsf@gnu.org
Attila Lendvai <attila@lendvai.name> skribis:

Toggle quote (2 lines)
> it's possible to instantiate a SHEPHERD-SERVICE with an empty list as PROVISION, but then much later in time and space SHEPHERD-SERVICE-CANONICAL-NAME dies on it.

Hi! At the level of Shepherd, this is now mitigated by Shepherd commit
ad62ce37fe3a69e83672f0817ac2b67e05d0dd87.

We should add similar checks in (gnu services shepherd).

Ludo’.
L
L
Ludovic Courtès wrote on 25 Jun 2023 23:44
Re: bug#64119: [PATCH] services: shepherd: Sanitize 'provision' field.
(name . Bruno Victal)(address . mirai@makinata.eu)
87o7l3w71m.fsf@gnu.org
Bruno Victal <mirai@makinata.eu> skribis:

Toggle quote (8 lines)
> +(define (sanitize-shepherd-service-provision expr)
> + (match expr
> + (((? symbol?) ..1) expr)
> + (_
> + (raise
> + (formatted-message
> + (G_ "'provision' must be a non-empty list of symbols"))))))

Actually I figured we could do as in other areas of the code in a way
that reports error location, so I came up with a different patch.

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 63979@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 63979
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch