From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25419: give better message when trying to go to forbidden areas Date: Wed, 11 Jan 2017 19:58:02 +0200 Message-ID: <83wpe1cwd1.fsf@gnu.org> References: <87ziixzmfb.fsf@jidanni.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1484160050 9542 195.159.176.226 (11 Jan 2017 18:40:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2017 18:40:50 +0000 (UTC) Cc: 25419@debbugs.gnu.org To: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 11 19:40:45 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRNp7-0001Lm-Vm for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jan 2017 19:40:38 +0100 Original-Received: from localhost ([::1]:56131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRNpC-0003U7-CZ for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jan 2017 13:40:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRNAx-0003zQ-Dt for bug-gnu-emacs@gnu.org; Wed, 11 Jan 2017 12:59:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRNAs-0003AO-JZ for bug-gnu-emacs@gnu.org; Wed, 11 Jan 2017 12:59:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34736) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRNAs-0003AJ-Fw for bug-gnu-emacs@gnu.org; Wed, 11 Jan 2017 12:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cRNAs-0004Ox-9y for bug-gnu-emacs@gnu.org; Wed, 11 Jan 2017 12:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Jan 2017 17:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25419 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25419-submit@debbugs.gnu.org id=B25419.148415749116862 (code B ref 25419); Wed, 11 Jan 2017 17:59:02 +0000 Original-Received: (at 25419) by debbugs.gnu.org; 11 Jan 2017 17:58:11 +0000 Original-Received: from localhost ([127.0.0.1]:50135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRNA3-0004Nt-BY for submit@debbugs.gnu.org; Wed, 11 Jan 2017 12:58:11 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRNA1-0004Nh-Sx for 25419@debbugs.gnu.org; Wed, 11 Jan 2017 12:58:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRN9r-0002kp-Uy for 25419@debbugs.gnu.org; Wed, 11 Jan 2017 12:58:04 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRN9r-0002kl-Rp; Wed, 11 Jan 2017 12:57:59 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3800 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cRN9r-0006GN-4Q; Wed, 11 Jan 2017 12:57:59 -0500 In-reply-to: <87ziixzmfb.fsf@jidanni.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:128008 Archived-At: > From: 積丹尼 Dan Jacobson > > Date: Wed, 11 Jan 2017 22:44:08 +0800 > > Do C-x C-f ~root > You will see: > Setting current directory: Success, /root/ That's because /root has a file-name handler, tramp-completion-file-name-handler, and although that handler turns around and calls file-accessible-directory-p, the value of errno is lost in transition: /* If the file name has special constructs in it, call the corresponding file handler. */ handler = Ffind_file_name_handler (absname, Qfile_accessible_directory_p); if (!NILP (handler)) { Lisp_Object r = call2 (handler, Qfile_accessible_directory_p, absname); errno = 0; return r; } Is there any better way than arbitrarily set errno to EACCES if the handler returns something other than t?