Commits
- Commit:
3d97effaa4fe16c79f725bf260f06220e62e5c6a
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
convert to use imsg_get_fd()
While here also fix a fd leak in got-read-pack. We were dup'ing
imsg.fd without closing imsg.fd later; instead just use imsg_get_fd()
to extract the file descriptor.
Tested by falsifian and Kyle Ackerman, thanks!
'go ahead' stsp@
- Commit:
98670ba726486c39efff220ab1e074c62023aae7
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: rework SHA detection
Simply the SHA detection by not predicating on libcrypto, but instead
checking individual header files.
- Commit:
4680f704353811c8bb6ce65eac3714d1bd200c26
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: remove sha1.h; found portably
Remove sha1.h as this is found portably across systems.
- Commit:
be288a59f42e0b5e203e2c5545bf3e042ff4b79f
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
rename lib/sha1.c to lib/hash.c
It will soon grow functions to deal with sha256 too. stsp@ agrees.
- Commit:
588a8092bc282294ee23585991e81586905a8fd4
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
include sha2.h too where sha1.h is included
In preparation for wide sha256 support; stsp@ agrees. Change done
mechanically with
find . -iname \*.[cy] -exec sam {} +
X ,x/<sha1\.h>/i/\n#include <sha2.h>
- Commit:
3efd8e3122b7d03a046d23fd5eed22c1b78f8ceb
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
introduce gotd(8), a Git repository server reachable via ssh(1)
This is an initial barebones implementation which provides the absolute
minimum of functionality required to serve got(1) and git(1) clients.
Basic fetch/send functionality has been tested and seems to work here,
but this server is not yet expected to be stable.
More testing is welcome. See the man pages for setup instructions.
The current design uses one reader and one writer process per repository,
which will have to be extended to N readers and N writers in the future.
At startup, each process will chroot(2) into its assigned repository.
This works because gotd(8) can only be started as root, and will then
fork+exec, chroot, and privdrop.
At present the parent process runs with the following pledge(2) promises:
"stdio rpath wpath cpath proc getpw sendfd recvfd fattr flock unix unveil"
The parent is the only process able to modify the repository in a way
that becomes visible to Git clients. The parent uses unveil(2) to
restrict its view of the filesystem to /tmp and the repositories
listed in the configuration file gotd.conf(5).
Per-repository chroot(2) processes use "stdio rpath sendfd recvfd".
The writer defers to the parent for modifying references in the
repository to point at newly uploaded commits. The reader is fine
without such help, because Git repositories can be read without
having to create any lock-files.
gotd(8) requires a dedicated user ID, which should own repositories
on the filesystem, and a separate secondary group, which should not
have filesystem-level repository access, and must be allowed access
to the gotd(8) socket.
To obtain Git repository access, users must be members of this
secondary group, and must have their login shell set to gotsh(1).
gotsh(1) connects to the gotd(8) socket and speaks Git-protocol
towards the client on the other end of the SSH connection.
gotsh(1) is not an interactive command shell.
At present, authenticated clients are granted read/write access to
all repositories and all references (except for the "refs/got/" and
the "refs/remotes/" namespaces, which are already being protected
from modification).
While complicated access control mechanism are not a design goal,
making it possible to safely offer anonymous Git repository access
over ssh(1) is on the road map.
- Commit:
8b925c6ccd3968917253ea191906a1710c40ed2d
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: add back sys/queue.h
Now that the handling of including sys/queue.h is better, there's no
need to remove those lines from the source. Copy the location of those
original sys/queue.h lines from upstream at the same line number, so as
to avoid any conflicts in the future.
- Commit:
5d120ea8410ddc2808e476d554ba931dc19d8c50
- From:
- Omar Polo <op@omarpolo.com>
- Date:
use capsicum on FreeBSD
Thanks to the design of Got, the libexec helpers don't need any resource
(in fact they run under pledge "stdio recvfd" on OpenBSD) and so using
cap_enter(2) on FreeBSD is dead-easy.
While the main process can't be sandboxed on FreeBSD (needs to exec the
helpers), all the tough work is done by these small libexec helpers
which is also the biggest attack surface.
tested by naddy, ok thomas
- Commit:
97799ccd4b67a81f97039305d4fdd66588da9962
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: add support for landlock
landlock is a new set of linux APIs that is conceptually similar to
unveil(2): the idea is to restrict what a process can do on a
specified part of the filesystem. There are some differences in the
behaviour: the major one being that the landlock ruleset is inherited
across execve(2).
This just restricts the libexec helpers by completely revoking ANY
filesystem access; after all they are the biggest attack surface. got
send/fetch/clone *may* end up spawning ssh(1), so at the moment is not
possible to landlock the main process.
From Omar Polo.
- Commit:
92a9e85d28a30997176ce0d3c2915e3ea70782c7
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: add FreeBSD support
This adds the capability to compile got-portable on FreeBSD.
- Commit:
dd038bc6ec835ad3fd3c0b5303b8af9ad506c8cc
- From:
- Thomas Adam <thomas@xteddy.org>
- Via:
- Thomas Adam <thomas.adam@smoothwall.net>
- Date:
portable: initial Linux compilation
This commit modifies the GoT main branch to be able to compile it under
linux.
- Commit:
d5c81d448ae4eec21053152e1c82c66eb11ca7a4
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
verify object ID checksums while loose objects are being accessed
- Commit:
12f2167a2e638b44a8d0c2c163448011485067b3
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add checksum parameters to got_inflate functions which did not provide them yet
- Commit:
08578a35f60be8657db97b705f27a55ab61850c8
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make close(2) failure checks consistent; check 'close() == -1' everywhere
ok millert, naddy
- Commit:
56b63ca4ab1049de6fa2d6910ce22c16e2b42a53
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make fclose(3) failure checks consistent; check 'fclose() == EOF' everywhere
ok millert, naddy
- Commit:
23c57b285fdcf9a8a0a5913ea096232038bf0ac3
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
Stop including <sys/syslimits.h> directly.
POSIX says the limits defined there are available from <limits.h>,
which almost all affected source files already included anyway.
ok millert stsp
- Commit:
81a12da58651e79380d81dea7020bf6af20bb28b
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
do not rely on <zlib.h> to pull in <unistd.h>
ok stsp
- Commit:
6fb3a4970337c135644ac0ef619a7e96616e4230
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add optional 'consumed' output parameter to got_inflate_to_mem()
- Commit:
12ce7a6cb20e62e36b3430f7bbada96069749f8b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
include <limits.h> instead of <sys/limits.h>; patch by Thomas Klausner
- Commit:
638f9024045bbe2420143f8868dcc484c231c634
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
rename got_error_prefix_errno() to got_error_from_errno()
- Commit:
656b1f76d3a6f52318782284fa83ae47894cbffb
- From:
- joshua stein <jcs@jcs.org>
- Date:
while (1) -> for (;;)
- Commit:
230a42bdc60c6136d2a5ce65bf1a2f26d990c096
- From:
- joshua stein <jcs@jcs.org>
- Date:
got_error_from_errno -> got_error_prefix_errno
also add got_error_prefix_errno2 and got_error_prefix_errno3 which
should hopefully all be merged into a single function with variadic
args (but can't alloc mem)
- Commit:
3a6ce05aff1497b3b590a07e1dccad289ad84d0f
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
check for errors from close(2)
- Commit:
fb43ecf1500cf7f8b2e22348bd1635edcda97fee
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
check for errors from fclose()
- Commit:
268f7291e63638be363b7bccd95f97a73298d039
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
eliminate got_object_open() round-trip when opening tags