commit 2d8c8ac09c9232807174b097b1ce418df50b0aa7
Author: Antoine Beaupré <anar...@koumbit.org>
Date:   Tue Aug 20 02:21:36 2013 -0400

    properly set GPG_TTY if it is missing (Closes: #719908)
    
    This is necessary because gpg seemingly determine the terminal when
    called from monkeysign. The reasons behind this are obscure and I
    couldn't understand why, but the above fix works, at least.
    
    In the gpg-agent manual, users are explicitely told to configure the
    GPG_TTY variable in their session yet I somewhat missed this myself
    and I suspect a broad range of users are not doing that, gpg-agent now
    being automatically configured by graphical session managers and so
    on.
    
    So let's help our poor users a little here.

diff --git a/debian/changelog b/debian/changelog
index b6a8dd5..b08af30 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ monkeysign (1.1~git) UNRELEASED; urgency=low
     * use STARTTLS if available
     * enable SMTP debugging only debugging is enabled
   * properly show the unencrypted email with --no-mail (Closes: #720049)
+  * properly set GPG_TTY if it is missing (Closes: #719908)
 
  -- Antoine Beaupré <anar...@debian.org>  Mon, 19 Aug 2013 10:33:52 -0400
 
diff --git a/monkeysign/cli.py b/monkeysign/cli.py
index f85d7d1..711c7da 100644
--- a/monkeysign/cli.py
+++ b/monkeysign/cli.py
@@ -16,6 +16,7 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import sys
+import os
 import getpass
 
 from monkeysign.ui import MonkeysignUi
@@ -51,6 +52,10 @@ passwords."""
 
         MonkeysignUi.main(self)
 
+        if not 'GPG_TTY' in os.environ:
+            os.environ['GPG_TTY'] = os.popen('tty').read()
+            self.log(_('reset GPG_TTY to %s') % os.environ['GPG_TTY'])
+
         # 1. fetch the key into a temporary keyring
         self.find_key()
 


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to