From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.bugs
Subject: bug#45198: 28.0.50; Sandbox mode
Date: Tue, 22 Dec 2020 11:57:50 +0100
Message-ID:
References:
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
logging-data="26069"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: Bastien , 45198@debbugs.gnu.org,
=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=
To: Stefan Monnier
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 22 11:59:31 2020
Return-path:
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.92)
(envelope-from )
id 1krfO3-0006Y8-Pe
for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Dec 2020 11:59:27 +0100
Original-Received: from localhost ([::1]:34126 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1krfO2-0005n2-RY
for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Dec 2020 05:59:26 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41234)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1krfNe-0005mL-6O
for bug-gnu-emacs@gnu.org; Tue, 22 Dec 2020 05:59:03 -0500
Original-Received: from debbugs.gnu.org ([209.51.188.43]:37471)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1krfNd-0003Rm-Vv
for bug-gnu-emacs@gnu.org; Tue, 22 Dec 2020 05:59:01 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1krfNd-0005xL-U3
for bug-gnu-emacs@gnu.org; Tue, 22 Dec 2020 05:59:01 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Tue, 22 Dec 2020 10:59:01 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 45198
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
Original-Received: via spool by 45198-submit@debbugs.gnu.org id=B45198.160863469322822
(code B ref 45198); Tue, 22 Dec 2020 10:59:01 +0000
Original-Received: (at 45198) by debbugs.gnu.org; 22 Dec 2020 10:58:13 +0000
Original-Received: from localhost ([127.0.0.1]:49017 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1krfMq-0005w2-NH
for submit@debbugs.gnu.org; Tue, 22 Dec 2020 05:58:12 -0500
Original-Received: from mail-oi1-f180.google.com ([209.85.167.180]:37178)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1krfMl-0005vk-RV
for 45198@debbugs.gnu.org; Tue, 22 Dec 2020 05:58:10 -0500
Original-Received: by mail-oi1-f180.google.com with SMTP id l207so14372819oib.4
for <45198@debbugs.gnu.org>; Tue, 22 Dec 2020 02:58:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=xrVTw71WVVwbQhhSXf/INk8bDBDughgLQpmEr7GfEOI=;
b=TCgsqJWvaUtT0y8gMNSgwcPT6LuvOouWY3HJP3cRgpkddN12Jnx7zad+6Pgwnvr2RT
JKPF5hSgLyhTOmuf/hlUVkvuDKRhCvwiS5JFy1FgDce0Ex9Kv9cdlwL0wjvrHdHAioYo
9hJqRhWh/+IrEi0M5N2QDqP/bvGwWQbKNENPVgfMrZXyEnTaxUzq6a3us+XmaGbkct+K
V1MpoOCWf+d0aqpuiHNOkwK56o7fziVaV6ibBvspNRt+PQlKwRn6SeLRvmMFiY9rrDQV
JnVifdRw/7Nm+tApdKykAoLEPsE8E4JsCJHIHT+NcM5DM4NA9GHrgsj/07t2S8I8kx+E
z60w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=xrVTw71WVVwbQhhSXf/INk8bDBDughgLQpmEr7GfEOI=;
b=cUb4W2XU4geiK6Lddx7Ig7ei6J9CWz37r+AZRsIHBmYbehMqyz5YWNS9tK/B9ocn5Y
qAiv2Pg6D+pff+dS4rVPUbxnb3Tyum9chNDg/x4geahMXc01yZoFOLqQCT9v2uNjvffn
kw7C9TbUcIjCCJrKrdRN2uqkOZpflPqI4EOH48mU6DP0wc9EcgO4cuYKPL046cZHMLk7
B+zaqG4NTZgNOyqcHkPvmCllRBLf31beQCxB4ZA3gs4TEccepWf7vRI3pU7vivdJO0ei
Ju0Hm6Sb1TlHQSiLQ9ZsYxr38DvB1U0qM5uypXTDcuMZ+NO3n7sObarLXba7Ng6mtupY
Ax9A==
X-Gm-Message-State: AOAM532+yUY2FvepJddgAB507UPEGoRj10soKJZ5pNVm5zMYuYdQ62YR
GLiTeXrRbBZza4m3YzYQ1J2RVeAOS5Qpov54Yxc=
X-Google-Smtp-Source: ABdhPJwwnWTk8V7qbOKyj1LkZmDpF0S3X1jCx978LwaudUKIomzsmxKjuzOUo+kdIELEyhY8Dk7bJ2/1aOp+qonQ4Ec=
X-Received: by 2002:aca:3a02:: with SMTP id h2mr13564172oia.65.1608634681911;
Tue, 22 Dec 2020 02:58:01 -0800 (PST)
In-Reply-To:
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
the Swiss army knife of text editors"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: "bug-gnu-emacs"
Xref: news.gmane.io gmane.emacs.bugs:196569
Archived-At:
Am So., 20. Dez. 2020 um 13:28 Uhr schrieb Philipp Stephani
:
>
> > If/when someone implements that, then indeed we can just use a process
> > object to represent the parent in the client as well.
> >
>
> Yes, but again, there's no difference between the standard streams and
> using newly-allocated file descriptors. In both cases, you need a
> variant of Fmake_pipe_process that doesn't call pipe2 twice, but wraps
> two existing file descriptors in its infd and outfd. Whether those
> happen to be 0 and 1 or something passed on the command line makes no
> difference.
> On the parent process side, if you want to use a separate pipe pair,
> you need a way to create a pipe process that doesn't use O_CLOEXEC and
> allows reading out the open file descriptors to be able to pass them
> to the subprocess on the command line.
> These changes aren't large, but they are necessary if you want to go
> the "extra pipe pair" route.
I've played around with this a bit (both with the pipe pair and with
the socketpair approach), but one issue is that Emacs doesn't know
about half-closed processes (that you can only write to, but not read
from). Such a state is crucial because the subprocesses will want to
read the entire input before sending output, which isn't possible if
the output gets closed after EOF from the input (and that's what
wait_reading_process_output does for both pipes and sockets). So we'd
need to introduce the 'half-closed' process state first, which
requires somewhat larger changes to Emacs's process design and
interface.