unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Qiantan Hong <qhong@mit.edu>
To: dick <dick.r.chiang@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: Access control in Emacs?
Date: Tue, 14 Sep 2021 15:05:27 +0000	[thread overview]
Message-ID: <30E3A87D-0BBB-47B1-AAA8-A8DE4851D359@mit.edu> (raw)
In-Reply-To: <87r1dr5izu.fsf@dick>

> A multi-user OS exists, and it is called UNIX.  It would be hard to improve
> upon it.  What you seem to want is remote shell.  That also exists.  If port
> forwarding or a simple X11 connection is not slick enough, there is
> emacsclient.
I don’t think UNIX is a particularly good multi-user OS — the access control
model is arbitrary and coarse grain. There’re improvements like SELinux,
but a CLOS generic function in Elisp will do much better.

But that’s rather a tangent. There are things that UNIX doesn’t attempt to do,
e.g. the collaboration aspect. I think the root cause is that although UNIX manages
shared state arguably well, it uses such a low level byte-stream model such that only
very few operations on shared state make sense. E.g. two users simultaneously editing
the same file just doesn’t work (because UNIX doesn’t really know edit nor text, it knows
read/write raw bytes).

I see Emacs potentially a much better platform for collaboration than UNIX,
however I must point out there’s already a great challenge from proprietary software.
I heard people saying m$’s VSCode server and live share blow emacs tramp 
(and I suppose current state of crdt.el) "out of water”.
They can share autocompletion, tags, debugger… etc,
and I’ve heard that it’s a killer feature for mentoring and attracting freshmen.

UNIX apparently doesn’t help with the above.
Let’s consider jump-to-definition. crdt.el already have all the facility to make it happen,
one peer sends jump-to-definition remote call request (we have to allow this!),
after the server run it, it finds itself possibly in a different buffer 
(we have to allow create buffer and file access!),
then in the post-command state synchronization phase the server
add the newly created buffer into the shared session (we have to configure this!)
and tell client to go into this buffer.

If I assume we allow everything, it’s a matter of 20 lines for me to implement
it on top of current crdt.el. And in general Emacs can easily surpass VSCode
in all collaboration aspect just because we start with a much more powerful piece
Of single-user software.
However there's grave security question.

> Given the way Emacs is designed/structured this is a recipe for big
> gaping security holes.  It can be OK to allow such things for *very*
> specific cases (a few specific well understood variables), but even such
> a "whitelist" is a problem because it requires careful and
> long term maintenance.

I think for Emacs to catch-up/surpass proprietary solutions there has
to be an extensible way to add remote command/variables, ideally
each package hackers could just add a few annotations to make
their packages work over shared sessions.

In the worst case we just outsource security to underlying OS
(ask host to run inside containers etc) but that might be too coarse grain...

  reply	other threads:[~2021-09-14 15:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 12:49 Access control in Emacs? Qiantan Hong
2021-09-14 14:09 ` Phil Sainty
2021-09-14 14:28 ` dick
2021-09-14 15:05   ` Qiantan Hong [this message]
2021-09-14 15:52     ` dick
2021-09-14 16:02       ` Stefan Kangas
2021-09-14 14:49 ` Stefan Monnier
2021-09-15 20:11   ` Richard Stallman
2021-09-15 20:21   ` Robin Tarsiger
2021-09-14 18:13 ` Christine Lemmer-Webber
2021-09-14 19:59   ` tomas
2021-09-15 23:16   ` Qiantan Hong
2021-09-16  2:16     ` Christine Lemmer-Webber
2021-09-18  0:29       ` Richard Stallman

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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=30E3A87D-0BBB-47B1-AAA8-A8DE4851D359@mit.edu \
    --to=qhong@mit.edu \
    --cc=dick.r.chiang@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).