unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Leo Famulari <leo@famulari.name>
To: Xinglu Chen <public@yoctocell.xyz>, help-guix@gnu.org
Subject: Re: How to add /bin/sh to the build environment
Date: Mon, 8 Nov 2021 17:23:43 -0500	[thread overview]
Message-ID: <YYmjbxVwrZVTMSJ4@jasmine.lan> (raw)
In-Reply-To: <PU1PR01MB215542A6FC3573244C89C7D28D919@PU1PR01MB2155.apcprd01.prod.exchangelabs.com>

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/


  reply	other threads:[~2021-11-08 22:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08  9:25 How to add /bin/sh to the build environment Foo Chuan Wei
2021-11-08 16:54 ` Xinglu Chen
2021-11-08 20:19   ` Foo Chuan Wei
2021-11-08 22:23     ` Leo Famulari [this message]
2021-11-09  1:36       ` Philip McGrath
2021-11-09  3:51         ` Foo Chuan Wei
2021-11-10  1:41         ` Leo Famulari
2021-11-08 22:58     ` Philip McGrath

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YYmjbxVwrZVTMSJ4@jasmine.lan \
    --to=leo@famulari.name \
    --cc=help-guix@gnu.org \
    --cc=public@yoctocell.xyz \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).