chiark / gitweb /
server: Introduce privilege separation.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 29 Dec 2008 20:07:04 +0000 (20:07 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 29 Dec 2008 21:52:13 +0000 (21:52 +0000)
commit388e0319a0faf48193658c82228133bd1ea24eb6
tree5d8963cbf1e21f824eb26ddd89eba0ae121b71cc
parent6ebbf072683ac7ea09a0aaafa0bb12fc0678d068
server: Introduce privilege separation.

During initialization, we fork off a child which retains its root
privileges, and maintain communication with it via a Unix-domain socket
pair.  To open a new tunnel, we send it a request and it responds by
passing back the appropriate file descriptor.

The helper process running as root is implemented in a separate program,
tripe-privhelper.  This is done (a) to reduce memory use, (b) to trigger
close-on-exec behaviour and (c) to provide a clear boundary in the
source code for the parts which still run with superuser privileges.

This entails moving our tunnel-open functions into a separate program,
and doing the necessary build-system hacking.  The changes to existing
code aren't as invasive as they at first appear.
20 files changed:
Makefile.am
configure.ac
debian/tripe.install
priv/Makefile.am [new file with mode: 0644]
priv/comm.c [new file with mode: 0644]
priv/helper.c [new file with mode: 0644]
priv/priv.h [new file with mode: 0644]
priv/tripe-privhelper.8.in [new file with mode: 0644]
server/Makefile.am
server/admin.c
server/peer.c
server/privsep.c [new file with mode: 0644]
server/tests.at
server/tripe.c
server/tripe.h
server/tun-bsd.c
server/tun-linux.c
server/tun-slip.c
server/tun-unet.c
vars.am