#793994 gnupg2: gpg2 / use-agent does not clearly states that the tty has the wrong owner

#793994#5
Date:
2015-07-29 16:06:27 UTC
From:
To:
Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?

after su to a user from root or another user, the tty is still owned by the user calling su.
gpg does not warn about it and complain that operation is cancelled

su - user1 # from root

gpg2 -r user1 -e test.txt

$ gpg2 -d test.txt.gpg

You need a passphrase to unlock the secret key for
user: "user1"
4096-bit RSA key, ID 8B826A29, created 2015-07-16 (main key ID 269B8B97)

gpg-agent[14770]: command get_passphrase failed: Operation cancelled
gpg: cancelled by user
gpg: encrypted with 4096-bit RSA key, ID 8B826A29, created 2015-07-16
      "user1"
gpg: public key decryption failed: Operation cancelled
gpg: decryption failed: No secret key



   * What exactly did you do (or not do) that was effective (or
     ineffective)?

agent or no agent has no effect

   * What was the outcome of this action?

i cant decrypt.

   * What outcome did you expect instead?

a message saying the tty XXX is not owned by the user.



work around : script /dev/null # creates a new tty correctly owned


*** End of the template - remove these template lines ***