Commit Briefs


Stefan Sperling

fix typo in a comment


Stefan Sperling

make gitwrapper ignore 'permission denied' for repository paths

We recommend that gotsh users should not have direct filesystem access to repositories served by gotd. Which means admins will be setting things up as follows if public read-access should be denied: chown _gotd /git chmod 700 /git su -m _gotd -c 'gotadmin init /git/repo.git" However, gitwrapper would error out when repositories listed in gotd.conf were inaccessible to the user invoking gitwrapper: git-upload-pack: /etc/gotd.conf:2: realpath /git/repo.git: Permission denied Make gitwrapper ignore such errors as they are expected in this situation. While here, add a PROC_GITWRAPPER process ID for use as a global variable parse.y can check while special-casing any specific behaviour required by gitwrapper. (The worse alternative would have been adding a new global variable to parse.y just to control the behaviour on realpath errors.) ok op@


Omar Polo

gotd: wait asynchronously for children termination

Instead of the current kill() + waitpid(WNOHANG), manage the subprocesses in a separate queue and handle SIGCHLD. A timer is installed to ensure that misbehaving subprocesses are still killed. Fixes the current "child PID 0 terminated" logs due to races with waitpid(). Issue initially reported by Josiah Frentsos. ok + tweaks stsp@


Omar Polo

add kill_repo_proc() similarly to the other kill_*_proc()

ok stsp@


Omar Polo

missing semicolon... sigh

I can't assume I can blindly add one simple line.


Omar Polo

move gotd_child_proc to gotd.c

make it opaque since it's unused outside of gotd.c. While here, drop the unused `nhelpers' field. ok/tweak stsp@


Stefan Sperling

update gotd_proc_names after session process unveil changes

fixes "proc (null)" appearing in gotd logs



Mark Jamsek

gotd: return early after disconnect on auth event error

This fixes a segv reported by Mikhail. In this path, any error is already logged, client freed, and event_del() called so we don't need to cleanup in done. ok stsp@


Stefan Sperling

add support for protecting references against 'got send -f' to gotd

ok op@


Stefan Sperling

avoid gitwrapper printing a warning when /etc/gotd.conf does not exist

gotd still requires the config file, of course, but gitwrapper must treat is as optional and remain silent if the file cannot be found.


Stefan Sperling

add gitwrapper(1)

ok op@, tracey@ earlier version


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

fix gotd segfault in libevent while disconnecting clients

Sending a DISCONNECT message to the repo process and then killing it and freeing its structure won't work. The message ends up on internal libevent queues and will soon crash because we have freed the memory for the event structre. Sending that message is a leftover from the times when the repo procs were persistent.


Omar Polo

fix gotd and gotsh usage() function declaration

"function declaration isn't a prototype" should fix the error seen by tracey@ on sparc64


Stefan Sperling

make gotd parent dispatch handlers more robust during teardown

We have observed gotd exiting after "cannot find client for fd N" errors. If this occurs then we are likely in the process of disconnecting a client session while processing an event from a child process. Treat the above error as non-fatal and stop processing more events from the child process.


Omar Polo

remove \n from log message


Stefan Sperling

make gotd store own PID after daemon(3), and avoid calling daemon(3) needlessly

ok op, jamsek


Omar Polo

gotd: disconnect on client EOF too

Otherwise gotd keeps the (client-closed) sockets around and may prevent new connections from being established since they still count for the limits. ok jamsek, stsp


Stefan Sperling

document the gotd -n option


Omar Polo

gotd: move socket path check to parse.y and error from the main process

It's handy to have a "bad unix socket path" error being reported directly from the main process since can get caught by `gotd -n'. ok jamsek stsp


Omar Polo

gotd: move nrepos check to parse_config

ok jamsek stsp


Omar Polo

gotd: print configuration errors without -d

Defer the absolute path check on argv[0] and log_init so that it becomes possible to run `gotd -n' to check the configuration file and get errors without specifying -d. Erorrs in the configuration now are actually always printed regardless of -d. While here also tweak an error message and print 'configuration OK' if -n ok stsp@