DockerCLI/cli/config
Sebastiaan van Stijn 22a291f703
config: preserve ownership and permissions on configfile
When running `docker login` or `docker logout`, the CLI updates
the configuration file by creating a temporary file, to replace
the old one (if exists).

When using `sudo`, this caused the file to be created as `root`,
making it inaccessible to the current user.

This patch updates the CLI to fetch permissions and ownership of
the existing configuration file, and applies those permissions
to the new file, so that it has the same permissions as the
existing file (if any).

Currently, only done for "Unix-y" systems (Mac, Linux), but
can be implemented for Windows in future if there's a need.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-12-17 09:57:33 +01:00
..
configfile config: preserve ownership and permissions on configfile 2019-12-17 09:57:33 +01:00
credentials Remove docker api dependency from cli/config 2019-01-31 21:25:43 +00:00
types Remove docker api dependency from cli/config 2019-01-31 21:25:43 +00:00
config.go config: revert to using pkg/homedir 2019-10-07 21:05:58 +00:00
config_test.go cli: remove unnecessary newlines (whitespace) 2019-10-31 19:22:36 +01:00