Commit Briefs

Thomas Adam

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@



Thomas Adam

make the gotd auth process provide the user's account name for later use

with tweaks from + ok op@


Thomas Adam

portable: add back drop_privs


Thomas Adam

allow gotd repo read/write processes to max out data-size resource limits

Proccessing large pack files can easily result in out-of-memory errors if the datasize limit is too conservative.


Thomas Adam

portable: gotd: re-enable chroot

Reads (git clone) are working but writes (git push) run into an error


Thomas Adam

portable: gotd/gitwrapper: update for libs

Bring gotd and gitwrapper closer to how libraries are detected.


Thomas Adam

portable: gotd: listen

Include listen.c; make it portable.


Thomas Adam

portable: enable compiling gotd

This enables gotd -- for now, this is opt-in at compile-time, via: ./configure --enable-gotd



Thomas Adam

fix typo in a comment


Thomas Adam

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@


Thomas Adam

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@


Thomas Adam

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

ok stsp@


Thomas Adam

missing semicolon... sigh

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


Thomas Adam

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@


Thomas Adam

update gotd_proc_names after session process unveil changes

fixes "proc (null)" appearing in gotd logs



Thomas Adam

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@



Thomas Adam

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.


Thomas Adam

add gitwrapper(1)

ok op@, tracey@ earlier version


Thomas Adam

portable: configure: split out dependencies

Rather than assume all dependencies are required for all programs, split them out. This will make packaging easier, as well as splitting the code to use subprojects. Note that due to the use of config.h semantics, in most cases the got_compat.h header file is now at the top of the .c file it is included in, so that it can handle the system header inclusion properly.


Thomas Adam

portable: rework SHA detection

Simply the SHA detection by not predicating on libcrypto, but instead checking individual header files.


Thomas Adam

portable: remove sha1.h; found portably

Remove sha1.h as this is found portably across systems.