FS#66575 - accepting PGP key with lowercase 'y' causes pacman to ask again until answer is blank

Attached to Project: Pacman
Opened by Peter Bartyik (vanek) - Thursday, 07 May 2020, 11:54 GMT
Last edited by Andrew Gregory (andrewgregory) - Thursday, 02 July 2020, 20:05 GMT
Task Type Bug Report
Category Scripts & Tools
Status Closed
Assigned To No-one
Architecture x86_64
Severity Low
Priority Normal
Reported Version 5.2.1
Due in Version 5.2.2
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
During full system upgrade when importing PGP key and accepting with lowercase 'y' I got prompted to accept the key again. This occasion when answering with uppercase 'Y' pacman asks again until I enter nothing and hit enter.

Exact output of the issue:

user@host$ sudo pacman -Syu
<... omitted ...>
(70/70) checking keys in keyring [------------------------------------------------------] 100%
downloading required keys...
:: Import PGP key 45A650E2638C536D, "kpcyrd <kpcyrd@archlinux.org>"? [Y/n] y
:: Import PGP key 45A650E2638C536D, "kpcyrd <kpcyrd@archlinux.org>"? [Y/n] Y
:: Import PGP key 45A650E2638C536D, "kpcyrd <kpcyrd@archlinux.org>"? [Y/n] Y
:: Import PGP key 45A650E2638C536D, "kpcyrd <kpcyrd@archlinux.org>"? [Y/n]
(70/70) checking package integrity [------------------------------------------------------] 100%
<... omitted ...>
This task depends upon

Closed by  Andrew Gregory (andrewgregory)
Thursday, 02 July 2020, 20:05 GMT
Reason for closing:  Fixed
Additional comments about closing:  Commit 540b19164b1ab3a4950b4a828fb90d047f4a591d
Comment by Eli Schwartz (eschwartz) - Sunday, 24 May 2020, 20:53 GMT
Accepting with "y" works perfectly for me...

IIRC this can be localized and will then accept localized responses, but that doesn't seem to be the case here!
Comment by Mario Aichigner (aichingm) - Monday, 15 June 2020, 20:09 GMT
I had a very similar issue:

$ pacman -Syu
<... package downloads ...>
downloading required keys...
:: Import PGP key 3B94A80E50A477C7, "Jan Alexander Steffens (heftig) <heftig@archlinux.org>"? [Y/n]
:: Import PGP key 3B94A80E50A477C7, "Jan Alexander Steffens (heftig) <heftig@archlinux.org>"? [Y/n]
:: Import PGP key 3B94A80E50A477C7, "Jan Alexander Steffens (heftig) <heftig@archlinux.org>"? [Y/n] y
:: Import PGP key 3B94A80E50A477C7, "Jan Alexander Steffens (heftig) <heftig@archlinux.org>"? [Y/n] Y
:: Import PGP key 3B94A80E50A477C7, "Jan Alexander Steffens (heftig) <heftig@archlinux.org>"? [Y/n] Yes
:: Import PGP key 3B94A80E50A477C7, "Jan Alexander Steffens (heftig) <heftig@archlinux.org>"? [Y/n] yes
:: Import PGP key 3B94A80E50A477C7, "Jan Alexander Steffens (heftig) <heftig@archlinux.org>"? [Y/n] ^C
Interrupt signal received

But in my case even just hitting enter wouldn't work. I had to interrupt pacman with ctrl-c. It seams that adding the key worked because restarting `pacman -Syu` seamed to pick up the key just fine.

I tested this on three different machines. After only passing 'n' or <ctrl-c> the next `pacman -Syu` asks again for the key, passing 'y' and then 'n' lets the next `pacman -Syu` succeed as does 'Y' and then <ctrl-c>.

/var/log/pacman.log (the first 'pacman -Syu' is the asking one):

[PACMAN] Running 'pacman -Syu'
[PACMAN] synchronizing package lists
[PACMAN] starting full system upgrade
[PACMAN] Running 'pacman -Syu'

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=


Not a major inconvenience but an unexpected hiccup.
Comment by Eli Schwartz (eschwartz) - Monday, 15 June 2020, 21:35 GMT
Oh, right, I think I get what's going on here. This is just bad timing. The original bug reporter coincidentally had 4 packages which needed this key, and tried 3 times to answer "y". But both "y" and "" would be valid answers.

However, pacman was going to ask 4 times no matter what, due to a bug which was fixed in https://git.archlinux.org/pacman.git/commit/?id=540b19164b1ab3a4950b4a828fb90d047f4a591d

As I forgot this was an issue that was fixed, I neglected to mention it. The reason it worked for me can be down to two reasons:

- the number of times you get prompted is equal to the number of packages which need the key, I only tested with one package
- I am running pacman-git, so it was already fixed for me

You can try to replicate the bug using my pacman-git package from the AUR, prebuilt + signed packages at https://wiki.archlinux.org/index.php/Unofficial_user_repositories#eschwartz
It should be fixed.

IIRC agregory was planning to tag a maintenance release sometime soon, which this should hopefully be fixed in.

Loading...