Commit Briefs

c7224e4126 Omar Polo

gotd: delete unreachable code after gotd_shutdown()


77f619a844 Stefan Sperling

revoke filesystem access in gotd listen process via unveil(2)

This should avoid involuntary use of bind(2) with arbitrary socket paths. ok op@


7843333165 Stefan Sperling

expose 'gotctl info' output only to the root user

Now that anyone can connect to the socket, it is probably safer to expose information about currently connected clients only to root.


6f854dde05 Stefan Sperling

remove the gotsh group requirement from gotd; any user can now connect

Repository access is now controlled by access rules in gotd.conf, and concurrent connections to the gotd socket by local users are limited by the listen process. We should keep refining our anti-DoS measures in the future, but at least we have something in place now. ok jamsek, op


40b85cca5d Stefan Sperling

introduce connection options to gotd.conf

Allow administrators to tweak the default authentication and request timeouts if needed, and to tweak the limit of concurrent connections for specific user accounts. with several tweaks from and ok op@


77d0cae199 Omar Polo

fmt


7fdc3e5864 Mark Jamsek

gotd: nix trailing whitespace and indentation fix

ok op@, stsp@


44587340e4 Stefan Sperling

remove filesystem access via bind(2) from gotd auth process

op@ pointed out a problem in my initial patch where I forgot to call unveil(2) with a path before unveil(NULL, NULL). ok op, jamsek


365cf0f34d Stefan Sperling

move "unix" pledge promise from gotd parent to auth process

The listen process now communicates the client UID/GID to the parent, and the auth process verifies this on behalf of the parent. This allows us to remove the "unix" pledge promise from the parent, removing parent access to syscalls such as listen() and accept() in the AF_UNIX domain. ok tracey@ op@


ef4e2f01b0 Stefan Sperling

fix gotd authentication timeout

The authentication timeout was accidentally overriden by the request timeout. Fix this and set both timeouts in the same place for clarity. ok op@


5e25db14db Stefan Sperling

run gotd authentication in a separate child process

ok op@


b50a2b4639 Stefan Sperling

fork gotd repo_read/repo_write children on demand

ok op, jamsek


898c8f8fd0 Omar Polo

gotd: tweak error message if getpwnam fails

errno may not be set to something interesting so switch to fatalx, and simplify the error message (knowing the failed function, which is also wrong, doesn't buy much here.) ok jamsek


eec68231a7 Stefan Sperling

switch gotd from chroot(2) to unveil(2)

In the future, gotd will fork+exec new processes for each client connection. Using unveil instead of chroot avoids having to start such processes as root. The -portable version could use chroot(2) where no equivalent to unveil(2) exists. A future component which starts new processes will be isolated as a separate process, which could run as root in the -portable version. ok op@


d93ecf7dc6 Stefan Sperling

add a gotd "listen" process which watches the unix socket

ok op@


b1142068fd Stefan Sperling

fix gotd startup without any -v options




ddbe612c69 Stefan Sperling

fix group membership check in gotd auth

ok op@


0ccf3acb6c Stefan Sperling

implement per-repository read/write authorization rules in gotd

ok op@


86b188ee11 Omar Polo

gotd: Don't include stdlib.h twice



b90054ed55 Stefan Sperling

use mkstemps(3) instead of mkstemp(3) for opening named temporary files

Allows 'got commit' to use a ".diff" suffix for temporary diff files. ok op@


585362fdef Omar Polo

gotd: propagate confpath to children as well

otherwise they end up running with default config which isn't ideal. ok stsp@


f1752522ac Stefan Sperling

add gotctl(8); initially supported commands are 'info' and 'stop'

This will be used by an upcoming regress test suite for gotd(8). ok tracey