From 6ebecd3b8ab0606efd8d947d8deb9527cccf4164 Mon Sep 17 00:00:00 2001 From: John Cai Date: Fri, 13 May 2022 17:18:00 -0400 Subject: cgroups: Add delimiter for key The cgroups key did not have a delimeter. This can potentially cause key collisions between two different sets of storage/repository path. Add a "/" as a delimeter in the key that gets hashed. --- internal/cgroups/v1_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cgroups/v1_linux.go b/internal/cgroups/v1_linux.go index dcbf04256..0a462c01f 100644 --- a/internal/cgroups/v1_linux.go +++ b/internal/cgroups/v1_linux.go @@ -104,7 +104,7 @@ func (cg *CGroupV1Manager) AddCommand( repo repository.GitRepo, ) error { checksum := crc32.ChecksumIEEE( - []byte(strings.Join([]string{repo.GetStorageName(), repo.GetRelativePath()}, "")), + []byte(repo.GetStorageName() + "/" + repo.GetRelativePath()), ) groupID := uint(checksum) % cg.cfg.Repositories.Count cgroupPath := cg.repoPath(int(groupID)) -- cgit v1.2.3