diff options
Diffstat (limited to 'ssh_handle_receive_pack.go')
-rw-r--r-- | ssh_handle_receive_pack.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ssh_handle_receive_pack.go b/ssh_handle_receive_pack.go index 317609f..33262e4 100644 --- a/ssh_handle_receive_pack.go +++ b/ssh_handle_receive_pack.go @@ -11,7 +11,6 @@ import ( gliderSSH "github.com/gliderlabs/ssh" "github.com/go-git/go-git/v5" - "go.lindenii.runxiyu.org/lindenii-common/cmap" ) // packPass contains information known when handling incoming SSH connections @@ -30,9 +29,6 @@ type packPass struct { contribReq string } -// packPasses contains hook cookies mapped to their packPass. -var packPasses = cmap.Map[string, packPass]{} - // sshHandleRecvPack handles attempts to push to repos. func (s *server) sshHandleRecvPack(session gliderSSH.Session, pubkey, repoIdentifier string) (err error) { groupPath, repoName, repoID, repoPath, directAccess, contribReq, userType, userID, err := s.getRepoInfo2(session.Context(), repoIdentifier, pubkey) @@ -95,7 +91,7 @@ func (s *server) sshHandleRecvPack(session gliderSSH.Session, pubkey, repoIdenti fmt.Fprintln(session.Stderr(), "Error while generating cookie:", err) } - packPasses.Store(cookie, packPass{ + s.packPasses.Store(cookie, packPass{ session: session, pubkey: pubkey, directAccess: directAccess, @@ -108,7 +104,7 @@ func (s *server) sshHandleRecvPack(session gliderSSH.Session, pubkey, repoIdenti contribReq: contribReq, userType: userType, }) - defer packPasses.Delete(cookie) + defer s.packPasses.Delete(cookie) // The Delete won't execute until proc.Wait returns unless something // horribly wrong such as a panic occurs. |