Plugin to keep bzr loaded in memory

Martin Pool martinpool at gmail.com
Thu Oct 6 00:46:09 BST 2005


On 06/10/05, John A Meinel <john at arbash-meinel.com> wrote:

> > The security issue could be fixed by making a unix domain socket.  We
> > could multiplex stdout and stderr across it.
>
> I'm not sure how you would split back out, I was thinking it would be
> possible to do that with FIFOs. So that the spawned process would just
> redirect its output through the fifos, and the client could do a
> select() or poll() accross them and print to the appropriate output.

What I would suggest is in the server, capturing stdout and stderr by
file-like objects.  When one of them gets some data, it writes it to
the pipe prefixed by a header saying which stream it is and how many
bytes.  Conceptually 'e' or 'o' for either fd, and then a uint32 for
the number of bytes.  The client just reverses this transform to
extract them to both fds.

> However, the TCPServer is bound to just localhost, so I also think the
> security is fine. (Unless I miss how TCPServer works).

As Matthieu says it's not secure against other people on localhost. 
It should be easy to adapt it to go over a unix domain socket instead,
and that can be given 0700 permissions.  I guess you can do something
similar on NT with a named pipe.

--
Martin




More information about the bazaar mailing list