Skip to content

ggcr: XDG_RUNTIME_DIR should be XDG_CONFIG_HOME #1516

Open

Description

Describe the bug

When searching for 'containers/auth.json', in go-containerregistry/pkg/authn/keychain.go, the environment variable XDG_RUNTIME_DIR should be replaced with XDG_CONFIG_HOME and if missing with $HOME/.config.

See: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

So
f, err := os.Open(filepath.Join(os.Getenv("XDG_RUNTIME_DIR"), "containers/auth.json"))

Should be
f, err := os.Open(filepath.Join(os.Getenv("XDG_CONFIG_HOME"), "containers/auth.json"))
and
f, err := os.Open(filepath.Join(os.Getenv("HOME"), ".config/containers/auth.json"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions