GNU bug report logs - #25419
give better message when trying to go to forbidden areas

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Wed, 11 Jan 2017 16:40:01 UTC

Severity: minor

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 25419 <at> debbugs.gnu.org
Subject: bug#25419: give better message when trying to go to forbidden areas
Date: Wed, 11 Jan 2017 19:58:02 +0200
> From: 積丹尼 Dan Jacobson
> 	<jidanni <at> jidanni.org>
> 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?




This bug report was last modified 8 years and 116 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.