summaryrefslogtreecommitdiffstats
path: root/import-layers/meta-virtualization/recipes-containers/docker/files/disable_sha1sum_startup.patch
blob: d37d7a060cf46ac1f8e7062072268195f80c89c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 12fd6388a033ab5ec9b3a7b144c4976031e6aa52 Mon Sep 17 00:00:00 2001
From: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Date: Fri, 20 Nov 2015 10:02:09 +0000
Subject: [PATCH] disable sha1sum startup

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
---
 utils/utils.go | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/utils/utils.go b/utils/utils.go
index a17ab9d..3fc514a 100644
--- a/utils/utils.go
+++ b/utils/utils.go
@@ -2,8 +2,6 @@ package utils
 
 import (
 	"bufio"
-	"crypto/sha1"
-	"encoding/hex"
 	"fmt"
 	"io"
 	"io/ioutil"
@@ -42,20 +40,6 @@ func SelfPath() string {
 	return path
 }
 
-func dockerInitSha1(target string) string {
-	f, err := os.Open(target)
-	if err != nil {
-		return ""
-	}
-	defer f.Close()
-	h := sha1.New()
-	_, err = io.Copy(h, f)
-	if err != nil {
-		return ""
-	}
-	return hex.EncodeToString(h.Sum(nil))
-}
-
 func isValidDockerInitPath(target string, selfPath string) bool { // target and selfPath should be absolute (InitPath and SelfPath already do this)
 	if target == "" {
 		return false
@@ -77,7 +61,7 @@ func isValidDockerInitPath(target string, selfPath string) bool { // target and
 		}
 		return os.SameFile(targetFileInfo, selfPathFileInfo)
 	}
-	return dockerversion.INITSHA1 != "" && dockerInitSha1(target) == dockerversion.INITSHA1
+	return true
 }
 
 // DockerInitPath figures out the path of our dockerinit (which may be SelfPath())
-- 
1.9.1

OpenPOWER on IntegriCloud