Commit Briefs


Omar Polo

gotd: Fix more double process names

Patch by Josiah Frentsos, thanks!


Omar Polo

add some helper functions to compute hashes

This adds a set of functions to abstract over SHA1Init, SHA1Update, SHA1Final, their respective SHA256 variants and how to compare digests. Replace all the SHA1*() usage with the new APIs. It's a preparatory step for sha256 handling. ok stsp@


Omar Polo

rename lib/sha1.c to lib/hash.c

It will soon grow functions to deal with sha256 too. stsp@ agrees.


Omar Polo

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>



Stefan Sperling

do not expect to see a DISCONNECT message in repo processes

The parent no longer sends this message. Perform related cleanup in the shutdown path instead. ok op@


Mark Jamsek

typo and style(9): do not use function calls in initialisers.

ok stsp@


Omar Polo

gotd: implement the delete-refs capability

Allow clients to run "got send -d" against gotd. Clients will send a zero-id as new id for a reference and, in the special but more common case of just deleting and not updating, no pack file will be sent. ok and tweaks by stsp@


Stefan Sperling

gotd: fix "bad packfile with zero objects" error while creating branches

Clients will send an empty pack file if they are only creating new references and have no objects to upload. Make gotd handle this and add a regression test which triggers the bug. Problem found by op@. The new regression test caught an unrelated issue where the client connection was left lingering after references had been updated, which made 'got send' followed by 'got clone -l' fail with the connection limit configured for the test suite (just one connection is allowed at a time). Fix this as well. ok op@


Omar Polo

replace malloc+memcpy with strndup. no functional change intended

ok stsp@



Stefan Sperling

add a gotd session process, split off from the parent process

The new session process is able to manipulate files in the repository and keeps track of the read/write client session state. The parent process now restricts its view of the filesystem to the absolute path stored in argv[0], and combines this with unveil "x" on this path. As a result the parent process can only re-exec itself. small tweaks + ok op@


Stefan Sperling

convert gotd repo_read.c and repo_write.c to single-client

Because these processes are now started on demand per client connection there is no need to keep track of multiple clients anymore. Also, these processes can now exit when a disconnect event is received. ok op, jamsek


Stefan Sperling

fork gotd repo_read/repo_write children on demand

ok op, jamsek