From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Werner Koch Newsgroups: gmane.emacs.devel Subject: Re: Fix needed for communication with gpg-agent Date: Thu, 22 Feb 2007 09:13:49 +0100 Message-ID: <87r6siy5he.fsf@wheatstone.g10code.de> References: <87irdzs6pp.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1172248801 26845 80.91.229.12 (23 Feb 2007 16:40:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Feb 2007 16:40:01 +0000 (UTC) Cc: Sascha Wilde , Chong Yidong , Daiki Ueno , rms@gnu.org, emacs-devel@gnu.org To: storm@cua.dk (Kim F. Storm) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 23 17:39:54 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HKdSb-0002eU-Gu for ged-emacs-devel@m.gmane.org; Fri, 23 Feb 2007 17:39:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HKdSb-00044y-8u for ged-emacs-devel@m.gmane.org; Fri, 23 Feb 2007 11:39:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HK96k-0004jT-Ip for emacs-devel@gnu.org; Thu, 22 Feb 2007 03:15:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HK96i-0004jH-7M for emacs-devel@gnu.org; Thu, 22 Feb 2007 03:15:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HK96i-0004jE-1v for emacs-devel@gnu.org; Thu, 22 Feb 2007 03:15:16 -0500 Original-Received: from kerckhoffs.g10code.com ([217.69.77.222]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HK96h-0001TX-K9 for emacs-devel@gnu.org; Thu, 22 Feb 2007 03:15:15 -0500 Original-Received: from uucp by kerckhoffs.g10code.com with local-rmail (Exim 4.50 #1 (Debian)) id 1HK9Er-0000W3-Ag for ; Thu, 22 Feb 2007 09:23:41 +0100 Original-Received: from wk by localhost with local (Exim 4.62 #1 (Debian)) id 1HK95J-0002ud-7c; Thu, 22 Feb 2007 09:13:49 +0100 Organisation: g10 Code GmbH OpenPGP: id=5B0358A2; url=finger:wk@g10code.com In-Reply-To: (Kim F. Storm's message of "Thu\, 22 Feb 2007 00\:15\:16 +0100") User-Agent: Gnus/5.110006 (No Gnus v0.6) X-detected-kernel: Linux 2.2 (2) X-Mailman-Approved-At: Fri, 23 Feb 2007 11:39:02 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:66676 Archived-At: On Thu, 22 Feb 2007 00:15, storm@cua.dk said: > Since this was the main problem which we were concerned with, the > problem is reduced to find a way to block Emacs from reading from the > tty while pinentry needs it. So the problem is that pinentry does not have exclusive access to the tty. What we do is: /* Open the desired terminal if necessary. */ if (tty_name) { ttyfi = fopen (tty_name, "r"); if (!ttyfi) return -1; ttyfo = fopen (tty_name, "w"); if (!ttyfo) { int err = errno; fclose (ttyfi); errno = err; return -1; } screen = newterm (tty_type, ttyfo, ttyfi); set_term (screen); } else { if (!init_screen) { init_screen = 1; initscr (); } else clear (); } keypad (stdscr, TRUE); /* Enable keyboard mapping. */ nonl (); /* Tell curses not to do NL->CR/NL on output. */ cbreak (); /* Take input chars one at a time, no wait for \n. */ noecho (); /* Don't echo input - in color. */ TTY_NAME is taken from the envvar GPG_TTY. Just an idea: What about having emacs allocating a new pty pass that to gpg/gpg-agent. Emacs could then monitor the pty and thus notice if pinentry is going to use it. Salam-Shalom, Werner