From unknown Tue Jun 24 22:40:06 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#64119] [PATCH] services: shepherd: Sanitize 'provision' field. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, attila@lendvai.name, guix-patches@gnu.org Resent-Date: Fri, 16 Jun 2023 20:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64119 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64119@debbugs.gnu.org Cc: Bruno Victal , ludo@gnu.org, attila@lendvai.name X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: ludo@gnu.org, attila@lendvai.name Received: via spool by submit@debbugs.gnu.org id=B.168694715714674 (code B ref -1); Fri, 16 Jun 2023 20:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Jun 2023 20:25:57 +0000 Received: from localhost ([127.0.0.1]:50445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAG16-0003oc-PF for submit@debbugs.gnu.org; Fri, 16 Jun 2023 16:25:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:60874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAG14-0003oU-QT for submit@debbugs.gnu.org; Fri, 16 Jun 2023 16:25:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAG14-0001fE-Il for guix-patches@gnu.org; Fri, 16 Jun 2023 16:25:54 -0400 Received: from smtpmciv5.myservices.hosting ([185.26.107.241]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAG12-0002Do-D7 for guix-patches@gnu.org; Fri, 16 Jun 2023 16:25:54 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv5.myservices.hosting (Postfix) with ESMTP id 7B9CE20DAD for ; Fri, 16 Jun 2023 22:25:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id CAABE8009E; Fri, 16 Jun 2023 22:25:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ovOEIYKzWLKU; Fri, 16 Jun 2023 22:25:35 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 155CF8009D; Fri, 16 Jun 2023 22:25:35 +0200 (CEST) From: Bruno Victal Date: Fri, 16 Jun 2023 21:25:24 +0100 Message-Id: <9770a88a008fd1d087e829a6ad57b556346be9c0.1686947093.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.26.107.241; envelope-from=mirai@makinata.eu; helo=smtpmciv5.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Fixes . * gnu/services/shepherd.scm ()[provision]: Set field sanitizer. (sanitize-shepherd-service-provision): New procedure. --- gnu/services/shepherd.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index de40454f7d..1333067817 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2018 Carlo Zancanaro ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +22,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu services shepherd) + #:use-module (guix diagnostics) #:use-module (guix ui) #:use-module (guix sets) #:use-module (guix gexp) @@ -186,12 +188,21 @@ (define %default-modules ((guix build utils) #:hide (delete)) (guix build syscalls))) +(define (sanitize-shepherd-service-provision expr) + (match expr + (((? symbol?) ..1) expr) + (_ + (raise + (formatted-message + (G_ "'provision' must be a non-empty list of symbols")))))) + (define-record-type* shepherd-service make-shepherd-service shepherd-service? (documentation shepherd-service-documentation ;string (default "[No documentation.]")) - (provision shepherd-service-provision) ;list of symbols + (provision shepherd-service-provision ;list of symbols + (sanitize sanitize-shepherd-service-provision)) (requirement shepherd-service-requirement ;list of symbols (default '())) (one-shot? shepherd-service-one-shot? ;Boolean base-commit: 31336e9f5d68512a9c1c6826bce9f17c892a2125 -- 2.39.2 From unknown Tue Jun 24 22:40:06 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Bruno Victal Subject: bug#64119: closed (Re: bug#64119: [PATCH] services: shepherd: Sanitize 'provision' field.) Message-ID: References: <87cz1jxnaz.fsf@gnu.org> <9770a88a008fd1d087e829a6ad57b556346be9c0.1686947093.git.mirai@makinata.eu> X-Gnu-PR-Message: they-closed 64119 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 64119@debbugs.gnu.org Date: Sun, 25 Jun 2023 21:09:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1687727342-16452-1" This is a multi-part message in MIME format... ------------=_1687727342-16452-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #64119: [PATCH] services: shepherd: Sanitize 'provision' field. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 64119@debbugs.gnu.org. --=20 64119: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D64119 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1687727342-16452-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 64119-done) by debbugs.gnu.org; 25 Jun 2023 21:08:36 +0000 Received: from localhost ([127.0.0.1]:43777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDWyJ-0004Gi-Qi for submit@debbugs.gnu.org; Sun, 25 Jun 2023 17:08:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDWyH-0004GS-Ro for 64119-done@debbugs.gnu.org; Sun, 25 Jun 2023 17:08:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDWyB-0007bn-E4; Sun, 25 Jun 2023 17:08:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=on/eo6rjrXz8Pb+4WGzOxuwI78LAe+DWfjqPTYbjDgg=; b=KZ0u/tbgzLFHP8og/tpg +zof7mnRD3w5M3feixTBPahjLG11yIEfGbaL+l29KxEUOhIdi4qdAvfv8enyBxgfvO737w6SO601r aV4M2wxpDCxnWbJ1bjf76Y51RRlGWdze+H/F9ZfF/yFpNMcjdWCAb0ah0W/o2OPx0PsTGn7yAU6lv bXOropJoPe23YmIvDmcNBAlpy0Z4cea4aeLQ2JFhcXD2dKprhazRRbwc/slGAudVQa4Dmy5UDfKpy EUX0AwV4MjmoF1V8csHuktqU01ISWlIKi4vJkC5c9yfc3UpI06Z6Em8583BnT5y5MMvQcTmuyD/e/ Am6Jst6Er3VjUw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDWyB-0000UG-1P; Sun, 25 Jun 2023 17:08:27 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Bruno Victal Subject: Re: bug#64119: [PATCH] services: shepherd: Sanitize 'provision' field. References: <9770a88a008fd1d087e829a6ad57b556346be9c0.1686947093.git.mirai@makinata.eu> Date: Sun, 25 Jun 2023 23:08:20 +0200 In-Reply-To: <9770a88a008fd1d087e829a6ad57b556346be9c0.1686947093.git.mirai@makinata.eu> (Bruno Victal's message of "Fri, 16 Jun 2023 21:25:24 +0100") Message-ID: <87cz1jxnaz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64119-done Cc: attila@lendvai.name, 64119-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Bruno, Bruno Victal skribis: > Fixes . > > * gnu/services/shepherd.scm ()[provision]: Set field > sanitizer. > (sanitize-shepherd-service-provision): New procedure. Applied, thanks! Ludo=E2=80=99. ------------=_1687727342-16452-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 16 Jun 2023 20:25:57 +0000 Received: from localhost ([127.0.0.1]:50445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAG16-0003oc-PF for submit@debbugs.gnu.org; Fri, 16 Jun 2023 16:25:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:60874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAG14-0003oU-QT for submit@debbugs.gnu.org; Fri, 16 Jun 2023 16:25:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAG14-0001fE-Il for guix-patches@gnu.org; Fri, 16 Jun 2023 16:25:54 -0400 Received: from smtpmciv5.myservices.hosting ([185.26.107.241]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAG12-0002Do-D7 for guix-patches@gnu.org; Fri, 16 Jun 2023 16:25:54 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv5.myservices.hosting (Postfix) with ESMTP id 7B9CE20DAD for ; Fri, 16 Jun 2023 22:25:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id CAABE8009E; Fri, 16 Jun 2023 22:25:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ovOEIYKzWLKU; Fri, 16 Jun 2023 22:25:35 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 155CF8009D; Fri, 16 Jun 2023 22:25:35 +0200 (CEST) From: Bruno Victal To: guix-patches@gnu.org Subject: [PATCH] services: shepherd: Sanitize 'provision' field. Date: Fri, 16 Jun 2023 21:25:24 +0100 Message-Id: <9770a88a008fd1d087e829a6ad57b556346be9c0.1686947093.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Debbugs-CC: ludo@gnu.org, attila@lendvai.name Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.26.107.241; envelope-from=mirai@makinata.eu; helo=smtpmciv5.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Fixes . * gnu/services/shepherd.scm ()[provision]: Set field sanitizer. (sanitize-shepherd-service-provision): New procedure. --- gnu/services/shepherd.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index de40454f7d..1333067817 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2018 Carlo Zancanaro ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +22,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu services shepherd) + #:use-module (guix diagnostics) #:use-module (guix ui) #:use-module (guix sets) #:use-module (guix gexp) @@ -186,12 +188,21 @@ (define %default-modules ((guix build utils) #:hide (delete)) (guix build syscalls))) +(define (sanitize-shepherd-service-provision expr) + (match expr + (((? symbol?) ..1) expr) + (_ + (raise + (formatted-message + (G_ "'provision' must be a non-empty list of symbols")))))) + (define-record-type* shepherd-service make-shepherd-service shepherd-service? (documentation shepherd-service-documentation ;string (default "[No documentation.]")) - (provision shepherd-service-provision) ;list of symbols + (provision shepherd-service-provision ;list of symbols + (sanitize sanitize-shepherd-service-provision)) (requirement shepherd-service-requirement ;list of symbols (default '())) (one-shot? shepherd-service-one-shot? ;Boolean base-commit: 31336e9f5d68512a9c1c6826bce9f17c892a2125 -- 2.39.2 ------------=_1687727342-16452-1-- From unknown Tue Jun 24 22:40:06 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#64119] [PATCH] services: shepherd: Sanitize 'provision' field. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 25 Jun 2023 21:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64119 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Bruno Victal Cc: attila@lendvai.name, 64119@debbugs.gnu.org, 63979-done@debbugs.gnu.org Received: via spool by 64119-submit@debbugs.gnu.org id=B64119.168772951423008 (code B ref 64119); Sun, 25 Jun 2023 21:46:01 +0000 Received: (at 64119) by debbugs.gnu.org; 25 Jun 2023 21:45:14 +0000 Received: from localhost ([127.0.0.1]:43908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDXXl-0005xr-Pj for submit@debbugs.gnu.org; Sun, 25 Jun 2023 17:45:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDXXj-0005YE-36; Sun, 25 Jun 2023 17:45:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDXXc-0007z9-Pf; Sun, 25 Jun 2023 17:45:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=4ZF/uLy7I7/o5ecYjRfh7C4edyJ0UuKr4gA0UYpjzCo=; b=DrBVksNcVqKnxS6IjAeh VpCzCN78pgduXI/wD/51J08KEK0Pqs9Fl3RpKdJ7c5fDy6IUPK3eADXR8aDtQmGi8QnsOOYzII3vf rzjdJNtjcCDLKE//nYVq6O84pGtPwsFYQPYsxA9gNQSKWGXs4JuVRQIPU+Nnlj0BV9Vhn3n0bChPb G5BAe7yHrSw5R2r5xsJwXNMiUAwZD/ejDW/vNllew7lqFc03m0imKgkTb3DGSlxpEncD6YBd/rpif hAOe21HaBZqLKAtkPK4Lp118n+gx8uzQ3GvrGwTrIhxPyZ2KmQBRq+XWBrX8k+Mrrpk9Yhq6AtMLB 4r2qofWn+r3hfg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDXXY-00018w-5k; Sun, 25 Jun 2023 17:45:03 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <9770a88a008fd1d087e829a6ad57b556346be9c0.1686947093.git.mirai@makinata.eu> Date: Sun, 25 Jun 2023 23:44:53 +0200 In-Reply-To: <9770a88a008fd1d087e829a6ad57b556346be9c0.1686947093.git.mirai@makinata.eu> (Bruno Victal's message of "Fri, 16 Jun 2023 21:25:24 +0100") Message-ID: <87o7l3w71m.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Bruno Victal skribis: > +(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=E2=80=99.