summaryrefslogtreecommitdiffstats
path: root/recipes-containers/docker/files/disable_sha1sum_startup.patch
blob: cc6819bdb181837ab5d7e742c349b50e9f548b56 (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
57
docker engine not running

In yocto builds, preprocessing of binaries can happen after the install phase.
Some of these can modify the size/sha1sum of the binaries.
e.g. A new .gnu_debuglink can happen

docker will not start because of these modifications. Docker initially
does a sha1sum of dockerinit to identify the dockerinit that it was built
with, this is done for security and for compatibility reasons. Since
this checking is disabled, we should rely on rpm tests for validation
of the binary instead.

Signed-off-by: Amy Fong <amy.fong@windriver.com>
---
 utils/utils.go |   17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

--- a/utils/utils.go
+++ b/utils/utils.go
@@ -4,7 +4,6 @@
 	"bufio"
 	"bytes"
 	"crypto/rand"
-	"crypto/sha1"
 	"crypto/sha256"
 	"encoding/hex"
 	"fmt"
@@ -76,20 +75,6 @@
 	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
@@ -111,7 +96,7 @@
 		}
 		return os.SameFile(targetFileInfo, selfPathFileInfo)
 	}
-	return dockerversion.INITSHA1 != "" && dockerInitSha1(target) == dockerversion.INITSHA1
+	return true
 }
 
 // Figure out the path of our dockerinit (which may be SelfPath())