pacman-key: fix permission checks for non-root operations
Removing lock-never from the default gpg.conf file exposed a couple of bugs
in the permission checks in pacman-key.
Signed-off-by: Allan McRae <allan@archlinux.org>
(cherry picked from commit 49ebd856ec
)
This commit is contained in:
parent
2fdd017994
commit
78f17bae4d
1 changed files with 3 additions and 6 deletions
|
@ -266,13 +266,10 @@ check_keyring() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if (( (EXPORT || FINGER || LIST || VERIFY) && EUID != 0 )); then
|
||||
if ! grep -q "^[[:space:]]*lock-never[[:space:]]*$" ${PACMAN_KEYRING_DIR}/gpg.conf &>/dev/null; then
|
||||
if (( !(EXPORT || FINGER || LISTKEYS || LISTSIGS || VERIFY) && EUID != 0 )); then
|
||||
error "$(gettext "You do not have sufficient permissions to run this command.")"
|
||||
msg "$(gettext "Use '%s' to correct the keyring permissions.")" "pacman-key --init"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( LSIGNKEY || POPULATE )); then
|
||||
if [[ $(secret_keys_available) -lt 1 ]]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue