nixpkgs-suyu/pkgs/development/tools/skopeo/path.patch

39 lines
1.4 KiB
Diff
Raw Normal View History

2017-04-02 00:33:32 +02:00
diff --git a/cmd/skopeo/main.go b/cmd/skopeo/main.go
2017-06-28 18:38:05 +02:00
index 50e29b2..7108df5 100644
2017-04-02 00:33:32 +02:00
--- a/cmd/skopeo/main.go
+++ b/cmd/skopeo/main.go
@@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
2017-06-28 18:38:05 +02:00
+ "path/filepath"
2017-04-02 00:33:32 +02:00
"github.com/Sirupsen/logrus"
"github.com/containers/image/signature"
2017-06-28 18:38:05 +02:00
@@ -88,6 +89,11 @@ func getPolicyContext(c *cli.Context) (*signature.PolicyContext, error) {
2017-04-02 00:33:32 +02:00
policyPath := c.GlobalString("policy")
var policy *signature.Policy // This could be cached across calls, if we had an application context.
var err error
2017-06-28 18:38:05 +02:00
+ var dir string
+ if policyPath == "" {
+ dir, err = filepath.Abs(filepath.Dir(os.Args[0]))
+ policyPath = dir + "/../etc/default-policy.json"
+ }
if c.GlobalBool("insecure-policy") {
policy = &signature.Policy{Default: []signature.PolicyRequirement{signature.NewPRInsecureAcceptAnything()}}
} else if policyPath == "" {
diff --git a/vendor/github.com/containers/image/docker/docker_client.go b/vendor/github.com/containers/image/docker/docker_client.go
index b989770..697d2ee 100644
--- a/vendor/github.com/containers/image/docker/docker_client.go
+++ b/vendor/github.com/containers/image/docker/docker_client.go
@@ -154,6 +154,9 @@ func setupCertificates(dir string, tlsc *tls.Config) error {
if os.IsNotExist(err) {
return nil
}
+ if os.IsPermission(err) {
+ return nil
+ }
return err
}