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

script/*: fix gpg usage wrt keyboxd #4189

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kolyshkin
Copy link
Contributor

I used script/keyring_validate.sh, which gave me this error:

[*] User cyphar in runc.keyring is not a maintainer!

Apparently, when gnupg 2.4.1+ sees a fresh install (i.e. no ~/.gnupg directory), it configures itself to use keyboxd instead of keyring files, and when just silently ignores options like --keyring and --no-default-keyring, working with keyboxd all the time.

The only way I found to make it not use keyboxd is to set --homedir. Let's do that when we explicitly want a separate keyring.

Similar change is made to script/release_key.sh.

Also, change "--import --import-options=show-only" to "--show-keys" which is a shortcut. When using this, there is no need to protect the default keyring since this command does not read or modify it.

I used script/keyring_validate.sh, which gave me this error:

> [*] User cyphar in runc.keyring is not a maintainer!

Apparently, when gnupg 2.4.1+ sees a fresh install (i.e. no ~/.gnupg
directory), it configures itself to use keyboxd instead of keyring
files, and when just silently ignores options like --keyring and
--no-default-keyring, working with keyboxd all the time.

The only way I found to make it not use keyboxd is to set --homedir.
Let's do that when we explicitly want a separate keyring.

Similar change is made to script/release_key.sh.

Also, change "--import --import-options=show-only" to "--show-keys"
which is a shortcut. When using this, there is no need to protect
the default keyring since this command does not read or modify it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Comment on lines +34 to +36
function gpg_user() {
gpg --homedir="$tmp_gpgdir" --no-default-keyring --keyring="$username.keyring" "$@"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like having a loop variable be used like this -- maybe make it the first argument to gpg_user?

Suggested change
function gpg_user() {
gpg --homedir="$tmp_gpgdir" --no-default-keyring --keyring="$username.keyring" "$@"
}
function gpg_user() {
local username="$1"
shift
gpg --homedir="$tmp_gpgdir" --no-default-keyring --keyring="$username.keyring" "$@"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants