aboutsummaryrefslogtreecommitdiff
path: root/git_hooks_handle_other.go
diff options
context:
space:
mode:
Diffstat (limited to 'git_hooks_handle_other.go')
-rw-r--r--git_hooks_handle_other.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/git_hooks_handle_other.go b/git_hooks_handle_other.go
index f1b2e04..4285784 100644
--- a/git_hooks_handle_other.go
+++ b/git_hooks_handle_other.go
@@ -315,6 +315,10 @@ func hooksHandler(conn net.Conn) {
_, _ = conn.Write([]byte{hookRet})
}
+// serveGitHooks handles connections on the specified network listener and
+// treats incoming connections as those from git hook handlers by spawning
+// sessions. The listener must be a SOCK_STREAM UNIX domain socket. The
+// function itself blocks.
func serveGitHooks(listener net.Listener) error {
for {
conn, err := listener.Accept()
@@ -325,6 +329,9 @@ func serveGitHooks(listener net.Listener) error {
}
}
+// allZero returns true if all runes in a given string are '0'. The comparison
+// is not constant time and must not be used in contexts where time-based side
+// channel attacks are a concern.
func allZero(s string) bool {
for _, r := range s {
if r != '0' {