]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-key.in
Merge branch 'debian/jessie' into debian/experimental
[apt.git] / cmdline / apt-key.in
index a9a729cce7dd42198f92282dff4add0056411c77..2a66ad74d182a805c5a62f410ab2a3857fc67ba8 100644 (file)
@@ -168,7 +168,7 @@ remove_key_from_keyring() {
     local GPG="$GPG_CMD --keyring $KEYRINGFILE"
     for KEY in "$@"; do
        # check if the key is in this keyring: the key id is in the 5 column at the end
-       if ! get_fingerprints_of_keyring "$KEYRINGFILE" | grep -q "^[0-9A-F]*${KEY}$"; then
+       if ! get_fingerprints_of_keyring "$KEYRINGFILE" | grep -iq "^[0-9A-F]*${KEY}$"; then
            continue
        fi
        if [ ! -w "$KEYRINGFILE" ]; then
@@ -384,6 +384,13 @@ if [ "$command" != "help" ]; then
 
     # gpg needs (in different versions more or less) files to function correctly,
     # so we give it its own homedir and generate some valid content for it
+    if [ -n "$TMPDIR" ]; then
+       # tmpdir is a directory and current user has rwx access to it
+       # same tests as in apt-pkg/contrib/fileutl.cc GetTempDir()
+       if [ ! -d "$TMPDIR" ] || [ ! -r "$TMPDIR" ] || [ ! -w "$TMPDIR" ] || [ ! -x "$TMPDIR" ]; then
+         unset TMPDIR
+       fi
+    fi
     GPGHOMEDIR="$(mktemp -d)"
     CURRENTTRAP="${CURRENTTRAP} rm -rf '${GPGHOMEDIR}';"
     trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
@@ -450,6 +457,14 @@ case "$command" in
        $GPG "$@"
        merge_back_changes
        ;;
+    verify)
+       setup_merged_keyring
+       if which gpgv >/dev/null 2>&1; then
+           gpgv --homedir "${GPGHOMEDIR}" --keyring "${GPGHOMEDIR}/pubring.gpg" --ignore-time-conflict "$@"
+       else
+           $GPG --verify "$@"
+       fi
+       ;;
     help)
         usage
         ;;