From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6NM7-00050u-2P for guix-patches@gnu.org; Thu, 04 May 2017 16:28:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6NM1-00039p-W7 for guix-patches@gnu.org; Thu, 04 May 2017 16:28:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:56706) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d6NM1-00039l-Sf for guix-patches@gnu.org; Thu, 04 May 2017 16:28:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d6NM1-0004aS-Ni for guix-patches@gnu.org; Thu, 04 May 2017 16:28:01 -0400 Subject: bug#26645: [PATCH 5/9] potluck: Add ability to load potluck package in sandbox. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170424205923.27726-1-wingo@igalia.com> <20170424205923.27726-5-wingo@igalia.com> Date: Thu, 04 May 2017 22:27:09 +0200 In-Reply-To: <20170424205923.27726-5-wingo@igalia.com> (Andy Wingo's message of "Mon, 24 Apr 2017 22:59:19 +0200") Message-ID: <87pofo9xlu.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Andy Wingo Cc: 26645@debbugs.gnu.org Andy Wingo skribis: > * guix/potluck/environment.scm: New file. > * Makefile.am (MODULES): Add new files. > * guix/potluck/packages.scm (make-potluck-sandbox-module) > (eval-in-sandbox): New helpers. > (load-potluck-package): New public function. [...] > + ((getenv "GUIX_POTLUCK_NO_SANDBOX") > + (warn "No sandbox available; be warned!!!") Perhaps this should use =E2=80=98warning=E2=80=99 from (guix ui). > +;; Because potluck package definitions come from untrusted parties, they= need > +;; to be sandboxed to prevent them from harming the host system. > +(define* (load-potluck-package file #:key > + (time-limit 1) > + (allocation-limit 50e6)) > + "Read a sequence of Scheme expressions from @var{file} and evaluate th= em in > +a potluck sandbox. The result of evaluating that expression sequence sh= ould > +be a potluck package. Any syntax error reading the expressions or run-t= ime > +error evaluating the expressions will throw an exception. The resulting > +potluck package will be validated with @code{validate-potluck-package}." Could you add a couple of tests in tests/potluck-package.scm for this part, or maybe for =E2=80=98eval-in-sandbox=E2=80=99? Otherwise LGTM, thank you! Ludo=E2=80=99.