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

Creating gpg key file doesn't work in user is not root #30

Open
jimmykarily opened this issue Apr 28, 2023 · 0 comments · May be fixed by #31
Open

Creating gpg key file doesn't work in user is not root #30

jimmykarily opened this issue Apr 28, 2023 · 0 comments · May be fixed by #31

Comments

@jimmykarily
Copy link

Here: https://github.com/docker-practice/actions-setup-docker/blob/fd7ecdac7caf8e2c541a48c9bcc280aae59a8461/lib/setup-docker.js#LL290C91-L290C91

The last sudo makes sure cat is run with root privileges but not the redirection of the output >. Reproduce:

(run as non-root user)

$ sudo echo "test" >/usr/share/keyrings/docker-archive-keyring.gpg 
bash: /usr/share/keyrings/docker-archive-keyring.gpg: Permission denied

# but this works
sudo sh -c 'echo "test" >/usr/share/keyrings/docker-archive-keyring.gpg'
jimmykarily added a commit to jimmykarily/actions-setup-docker that referenced this issue Apr 28, 2023
Fixes docker-practice#30

Signed-off-by: Dimitris Karakasilis <[email protected]>
@jimmykarily jimmykarily linked a pull request Apr 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant