From c2b95afc6aefbab69133a202cab95a50a2df82fc Mon Sep 17 00:00:00 2001 From: dev Date: Sun, 15 Nov 2026 11:28:47 +0000 Subject: Drop grant/revoke and validate's host-wiring checks Two features out, to answer a size target: src/ and cmd/ go from 2,306 non-blank lines to 1,495. `grant` and `revoke` were a convenience wrapper over a file that is a read-only mount in production by design, so they sat outside the enforcement path. src/edit.c is gone; both names now report an unknown command with exit 64. `validate` keeps the policy checks - parse errors with their line numbers, an unreadable policy, the @all-whole-repo and not-readable-by- the-git-account warnings - and stops cross-checking the machine around it. The repository cross-check, hook/hooksPath, sshd, the git account's shell and the key/htpasswd identity checks are deleted, along with --root, --hook-dir, --gitconfig, --sshd-config, --passwd, --keys, --htpasswd and --no-host; plain `validate` is what `validate --no-host` used to be. The container's build gate and the test suite are updated to match, since both called the removed flag. Orphaned by the removals and deleted with them: authz_repo_reachable, and authz_rule_validate's ref_ok parameter, which existed only so grant could interleave its own ref-pattern test. Surviving behaviour is unchanged. A 1,370-invocation differential run against the pre-removal binary - the check matrix, every authorize path, the hook reached through its own name, fake-git ancestry and HEAD, policy-only validate, the failure modes - differs only in the usage text that documented the removed surface. make strict, make test and make sanitizer are all clean, with ASan and UBSan silent. Also folded in from the same effort, since it touched the same files: authz_rule_validate as the single grammar, rule_covers() as the single answer for rule/ref coverage, vmsgv() behind the validate message tags, one kv reader for gitconfig and sshd_config while both were still there, and `sanitizer:` in the Makefile appending to CFLAGS rather than replacing it. --- container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'container') diff --git a/container/Dockerfile b/container/Dockerfile index ac0d898..53b153e 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -78,7 +78,7 @@ RUN chmod 0755 \ && git config --file /etc/gitconfig core.hooksPath /usr/local/share/git-host/hooks \ && grep -q "^git:" /etc/passwd \ && lighttpd -tt -f /etc/lighttpd/lighttpd.conf \ - && /usr/local/bin/git-authz validate --no-host + && /usr/local/bin/git-authz validate EXPOSE 8080 2222 VOLUME ["/var/lib/git"] -- cgit v1.2.3