Browse Source

apt-key del should correctly handle keyids prefixed with 0x

tags/debian/1.2.5
Daniel Kahn Gillmor Julian Andres Klode 5 years ago
parent
commit
f7bd44bae0
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      cmdline/apt-key.in

+ 4
- 0
cmdline/apt-key.in View File

@@ -191,6 +191,10 @@ remove_key_from_keyring() {
for KEY in "$@"; do
local FINGERPRINTS="${GPGHOMEDIR}/keyringfile.keylst"
get_fingerprints_of_keyring "$KEYRINGFILE" > "$FINGERPRINTS"

# strip leading 0x, if present:
KEY="$(printf %s "$KEY" | sed s/^0x//)"

# check if the key is in this keyring
if ! grep -iq "^[0-9A-F]*${KEY}$" "$FINGERPRINTS"; then
continue


Loading…
Cancel
Save