summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-23 06:56:00 -0400
committerGitHub <noreply@github.com>2022-04-23 06:56:00 -0400
commitf65f3320e1124c94db053c1f811487920ae2a70e (patch)
tree41659c0b0fef82bccfdccf42de784ad073170b1c /libpod
parent2df9bdc00948e24855f3da42e31a6d273861e380 (diff)
parent44642bee8720c0a19c97c6e116d725fd5f95daad (diff)
downloadpodman-f65f3320e1124c94db053c1f811487920ae2a70e.tar.gz
podman-f65f3320e1124c94db053c1f811487920ae2a70e.tar.bz2
podman-f65f3320e1124c94db053c1f811487920ae2a70e.zip
Merge pull request #13980 from lsm5/switch-sha256
libpod/networking_linux.go: switch to sha256 hash generation
Diffstat (limited to 'libpod')
-rw-r--r--libpod/networking_linux.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index 41beaf41d..0db0896cf 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -5,7 +5,7 @@ package libpod
import (
"crypto/rand"
- "crypto/sha1"
+ "crypto/sha256"
"fmt"
"io/ioutil"
"net"
@@ -402,7 +402,7 @@ func (r *Runtime) GetRootlessNetNs(new bool) (*RootlessNetNS, error) {
// the cleanup will check if there are running containers
// if you run a several libpod instances with different root/runroot directories this check will fail
// we want one netns for each libpod static dir so we use the hash to prevent name collisions
- hash := sha1.Sum([]byte(r.config.Engine.StaticDir))
+ hash := sha256.Sum256([]byte(r.config.Engine.StaticDir))
netnsName := fmt.Sprintf("%s-%x", rootlessNetNsName, hash[:10])
path := filepath.Join(nsDir, netnsName)