docker / docker/cli

Inconsistent directory permissions for ~/.docker directory

Open
#2,727 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/context kind/bug
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Opening as a tracking issue, following the discussion on https://github.com/moby/buildkit/pull/1660#discussion_r487596550, which highlighted that depending on which path in the code is taken, permissions on the ~/.docker may be either 0700 or 0755;

https://github.com/docker/cli/blob/6703919c7149b96b42b8a451bfb335321f70d12e/cli/config/configfile/file.go#L187

https://github.com/docker/cli/blob/6703919c7149b96b42b8a451bfb335321f70d12e/cli/context/store/metadatastore.go#L31

The second example was added later, so should probably be updated to match the former, although less restrictive permissions would likely not be a problem in most cases as this directory (in the default case) will be inside the user's home directory, which should already be inaccessible for other users.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the directory creation paths in cli/config/configfile/file.go and cli/context/store/metadatastore.go at the linked locations. Confirm the differing permissions and make both paths consistent, then run the relevant Docker CLI tests to verify directory creation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.