Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic in generate-key-pair when trying to write to a directory without permissions #2161

Closed
Ikke opened this issue Aug 14, 2022 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@Ikke
Copy link

Ikke commented Aug 14, 2022

Description

When running cosign generate-key-pair in a directory where it cannot write to, it results in a panic:

$ docker run -it --rm -e COSIGN_PASSWORD= -u1000:1000  gcr.io/projectsigstore/cosign:v1.10.1 generate-key-pair
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xd7bd7c]

goroutine 1 [running]:
github.com/sigstore/cosign/pkg/cosign.FileExists({0x27668bd?, 0x0?})
        github.com/sigstore/cosign/pkg/cosign/common.go:35 +0x5c
github.com/sigstore/cosign/cmd/cosign/cli/generate.GenerateKeyPairCmd({0x2b8bd80, 0xc0001ac000}, {0x0?, 0x0?}, {0x3f38378?, 0x0?, 0x0?})
        github.com/sigstore/cosign/cmd/cosign/cli/generate/generate_key_pair.go:88 +0x22a
github.com/sigstore/cosign/cmd/cosign/cli.GenerateKeyPair.func1(0xc0006be000?, {0x3f38378?, 0x0?, 0x0?})
        github.com/sigstore/cosign/cmd/cosign/cli/generate_key_pair.go:66 +0x4c
github.com/spf13/cobra.(*Command).execute(0xc0006be000, {0x3f38378, 0x0, 0x0})
        github.com/spf13/cobra@v1.5.0/command.go:872 +0x694
github.com/spf13/cobra.(*Command).ExecuteC(0xc00017a000)
        github.com/spf13/cobra@v1.5.0/command.go:990 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.5.0/command.go:918
main.main()
        github.com/sigstore/cosign/cmd/cosign/main.go:61 +0x4c

Version

1.10.1

@znewman01
Copy link
Contributor

This is closed by #2162 right?

@znewman01
Copy link
Contributor

Closing as fixed by #2162.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants