From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uNG/LoajiWF9fQAAgWs5BA (envelope-from ) for ; Mon, 08 Nov 2021 23:24:06 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wDVYKoajiWFgcAAAbx9fmQ (envelope-from ) for ; Mon, 08 Nov 2021 22:24:06 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 08E55C479 for ; Mon, 8 Nov 2021 23:24:05 +0100 (CET) Received: from localhost ([::1]:33868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mkD3b-0006OF-Fd for larch@yhetil.org; Mon, 08 Nov 2021 17:24:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkD3O-0006O7-3X for help-guix@gnu.org; Mon, 08 Nov 2021 17:23:50 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:41695) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkD3M-0000O1-8l for help-guix@gnu.org; Mon, 08 Nov 2021 17:23:49 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 86A613200124; Mon, 8 Nov 2021 17:23:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 08 Nov 2021 17:23:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=date:from:to:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=mesmtp; bh=J9+V6Oh6W0371yvbLvFMcMRutSWHRJzVPA83ojXsM1w=; b=ZIsXDMb9EMPa K1e3YQ6T4lJ4wbXy1tRhwG0rlK+BZipDNsWC7jny8meg8AMpuq3Dk0OFAsIOMgSn nIiy8bOAyExnRU0hxCKlJT+NI3E1KM75EflWTQ7R6Ptqy9mwgtnws2okN859uCSl EX0qMe49izd95UbBuoqB0Od9/WTW7o4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=J9+V6Oh6W0371yvbLvFMcMRutSWHRJzVPA83ojXsM 1w=; b=oB9w4vhgURjUoKfV5R8E0YRuLxSK/1TDvUT73cAfLVswAJWY4bGn1+n2y dTFwHXsPQE/COo2T+wLybb6XDNH0SIlULqXOjxBBj1qYIl1haxSB4QtS+y4IgED9 ywaPurbS/LJjmQ4nTZy+cZHDYDdgaqcMeHggM83ad5MvuQGuau+WQjNuglGHbElx rE8TeUy0B1ZLo8BRFo3cX+CkKIXlqMLEZO2+aAPbgx6QIFrYP+a8n+C6jef0tykZ WaKX8Vgr+VndeasDLoVhU+yLU1CPSIzuhmLAvHkkWBvt0wFtupbq7UMFOYUVUJ+a wMhD1nosCAFcYvwI/pasQouzBtDUA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddvgdduheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggugfgjsehtke ertddttdejnecuhfhrohhmpefnvghoucfhrghmuhhlrghrihcuoehlvghosehfrghmuhhl rghrihdrnhgrmhgvqeenucggtffrrghtthgvrhhnpefgudffteettdekkeduhffgfefgie efgeeuieetudejffelieduueeifffgudfgudenucffohhmrghinhepghhnuhdrohhrghen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlvghose hfrghmuhhlrghrihdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Nov 2021 17:23:45 -0500 (EST) Date: Mon, 8 Nov 2021 17:23:43 -0500 From: Leo Famulari To: Xinglu Chen , help-guix@gnu.org Subject: Re: How to add /bin/sh to the build environment Message-ID: References: <87bl2u37wr.fsf@disroot.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Received-SPF: pass client-ip=64.147.123.19; envelope-from=leo@famulari.name; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636410246; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=J9+V6Oh6W0371yvbLvFMcMRutSWHRJzVPA83ojXsM1w=; b=p/DMYnu3gKV/7h2NDlCHjO5CD8kXYLII22h8ZztriGTb+ahQGLcoDO/5ipKByHgNDdzf/j nfLLEe9+OVgkqHHuDj0U4f5sKNkJJVMek7vQ9gUlQpX/8/XqMQOFiNddtsD39ZQMkmi16W f69YD/07jCFs9nlkVGnyPMxp0LY8QOfWu+Attdox5e/SI4/pRlbjC5UvJXUR0OdncTdTI9 zzw6vwWk5Zh3WNqZzjbOWEZVz7CRj7/fUSoFklzJCFVy5aU2rAfQwU9hVNx9lUXKjqzW/G 617qiIPp+RzRI9wcZI6hNYPMcGCeln5ht0mMyEjcNk+N/y8Df+YY1VNh8Ya2ng== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636410246; a=rsa-sha256; cv=none; b=aH+qM54EM+RQ5ChpUSJQz2lrOvEvb8lyrtK5f9abUeMsqqOkUS2T+frRxsgYxghGApzOix Q2biEtiGI7KejhPg5/Z+r4nuxoiqFA6Oei4rWBE728OJgRF+FfqGobg0V0f6En9ST6tnZw 7aEEsBxKDQQ2mYQXEIgBqHyjUbZqzghHd8tf88HlHhvpvKfQ8p+3feGPlLvhtHKj/Rw2zg uUZ7yXnhDAG++y5/pjScQZvEcxUx4DF1AD5NNRIEE1G0E0IHMru0FzOuaPJQd+jb0yQEtP dO3TGiZY1ohFT7ZxpzDTVwtwmzbp5Ndifbi1WS70goAnuO7IEwVaeNJQV9HZdQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=famulari.name header.s=mesmtp header.b=ZIsXDMb9; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=oB9w4vhg; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=famulari.name header.s=mesmtp header.b=ZIsXDMb9; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=oB9w4vhg; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 08E55C479 X-Spam-Score: -2.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9LZh2YyzVKUA As you found, it's not possible to write to the root directory of the build environment as the build user. I don't remember exactly, but I believe this was done as part of the fix for CVE-2021-27851 [0]. Of course it can be annoying that /bin/sh cannot be added to the build environment, but specifying a particular shell is an important part of how Guix achieves the functional packaging model. Relying on /bin/sh while building *could* be done properly with some care, but since its use could indicate that the package will use /bin/sh at run-time, we choose to omit it from the build environment, although it does exist on Guix System and most systems that Guix supports. On Mon, Nov 08, 2021 at 08:19:27PM +0000, Foo Chuan Wei wrote: > * `OS.Process.system` will always use /bin/sh. This is hardcoded. I > cannot change it. If I change it, the behavior of `OS.Process.system` > would probably be wrong in the final product (the sml compiler). > > I'm not even sure if I can use `substitute*`, since the build process > relies on binary "bootfiles" where /bin/sh is hardcoded. It will be necessary to fix this issue in the SML/NJ package definition (I think you've done this in a followup patch), because Guix does not accept packages that rely on pre-built binaries — everything must be built from source code. There are some exceptions but I don't think that SML/NJ will qualify due to its obscurity compared to other language implementations. If SML/NJ cannot be built without the binary bootfiles, it probably won't be eligible for inclusion in GNU Guix. [0] The CVE ID will appear on the blog post shortly... it took several weeks to get the ID assigned and I forgot to add it to the blog post until now. https://guix.gnu.org/en/blog/2021/risk-of-local-privilege-escalation-via-guix-daemon/