From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.bugs Subject: bug#15648: 24.2.50; gnutls SSL connection to IMAP server causes emacs to crash completely Date: Fri, 25 Oct 2013 09:59:06 -0400 Message-ID: <21098.31018.184128.497305@consult.pretender> References: <21089.32240.198931.971000@consult.pretender> <87y55kjayp.fsf_-_@flea.lifelogs.com> <21096.1667.116936.254737@consult.pretender> <83eh7bj1yq.fsf@gnu.org> <87ppqvke5u.fsf@flea.lifelogs.com> <87fvrun1pw.fsf@flea.lifelogs.com> <21093.32992.278229.646703@consult.pretender> <877gd5mo5x.fsf@flea.lifelogs.com> <21094.39055.449629.706850@consult.pretender> <21094.40085.664080.69561@consult.pretender> <21094.52645.645440.977584@consult.pretender> <21094.64459.131668.849138@consult.pretender> <21095.19949.639350.970770@consult.pretender> <21096.24492.292723.589004@consult.pretender> <87eh7bj5no.fsf_-_@flea.lifelogs.com> <21097.10816.221279.461499@consult.pretender> <21097.27136.910137.181740@consult.pretender> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1382709621 16181 80.91.229.3 (25 Oct 2013 14:00:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Oct 2013 14:00:21 +0000 (UTC) Cc: Ted Zlatanov , emacs@kosowsky.org, 15648@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 25 16:00:23 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VZhw6-0005Z1-Qq for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Oct 2013 16:00:23 +0200 Original-Received: from localhost ([::1]:59462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZhw6-0004BP-Hx for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Oct 2013 10:00:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZhvw-0004BK-EM for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2013 10:00:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZhvp-0007zI-3e for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2013 10:00:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZhvo-0007xm-V5 for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2013 10:00:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VZhvn-0004zf-Uf for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2013 10:00:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Oct 2013 14:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15648-submit@debbugs.gnu.org id=B15648.138270957819131 (code B ref 15648); Fri, 25 Oct 2013 14:00:03 +0000 Original-Received: (at 15648) by debbugs.gnu.org; 25 Oct 2013 13:59:38 +0000 Original-Received: from localhost ([127.0.0.1]:43500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZhvM-0004yU-Tu for submit@debbugs.gnu.org; Fri, 25 Oct 2013 09:59:37 -0400 Original-Received: from vms173007pub.verizon.net ([206.46.173.7]:51192) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZhvJ-0004yF-DZ for 15648@debbugs.gnu.org; Fri, 25 Oct 2013 09:59:34 -0400 Original-Received: from consult.pretender ([unknown] [72.93.211.25]) by vms173007.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0MV8009DJ9IJZ722@vms173007.mailsrvcs.net> for 15648@debbugs.gnu.org; Fri, 25 Oct 2013 08:59:08 -0500 (CDT) Original-Received: from consult.pretender (consult.pretender [127.0.0.1]) by consult.pretender (8.14.4/8.14.4) with ESMTP id r9PDx6jA032184; Fri, 25 Oct 2013 09:59:06 -0400 In-reply-to: X-Mailer: VM 8.2.0b under 23.1.1 (i386-redhat-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79635 Archived-At: Stefan Monnier wrote at about 20:59:06 -0400 on Thursday, October 24, 2013: > I didn't mean to say that file-accessible-directory-p is the > right answer. Only that something *like it* should be used. > I.e. a function specifically meant to give you some idea about whether > that file is known to the OS primitives. .... > > You'd first have to define what kind of "canonicalizing" you want to do. > I think in the present case what you want is to turn an Elisp file name > into a file name understood by OS-level primitives (or nil if that > can't be done). We don't have such a function right now. So my > recommendation is to add such a function. > I'm surprised that such a function doesn't (yet) exist in Emacs... But until such a function exists, one might want to consider the following: 1. Adding expand-file-name will work for any file name that cygwin-mount is designed to address (this is by definition) 2. Similarly, adding expand-file-name will likely work for any other Magic File handler that works similar to cygwin-mount in terms of just converting paths but generally won't work with Magic File handlers that work on archives or compressed file formats 3. Adding expand-file-name shouldn't have any ill effect on paths that are not Magic files To take account of the fact that expand-file-name may not give a valid OS path for all Magic File handlers, I would suggest the following slight modification to my originally suggested patch. Basically, this version does 2 things: 1. Pre-expands the file name *if* there is a Magic File handler for that file path (this will do nothing if there is no handler for that path) 2. Tests file-exists-p with all Magic File handlers shut off which tests to make sure that the OS primitives will work on the actual file path that will be passed --- gnutls.el 2013-03-17 13:52:40.000000000 -0400 +++ gnutls.el.new 2013-10-23 12:47:36.503554500 -0400 @@ -174,7 +174,8 @@ (let* ((type (or type 'gnutls-x509pki)) (trustfiles (or trustfiles (delq nil - (mapcar (lambda (f) (and f (file-exists-p f) f)) + (mapcar (lambda (f) + (and f + (if (find-file-name-handler f 'expand-file-name) + (setq f (expand-file-name f))) + (let (file-name-handler-alist) + (file-exists-p f)) f)) (if (functionp gnutls-trustfiles) (funcall gnutls-trustfiles) gnutls-trustfiles)))))