[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25419: give better message when trying to go to forbidden areas
From: |
npostavs |
Subject: |
bug#25419: give better message when trying to go to forbidden areas |
Date: |
Wed, 18 Jan 2017 22:28:17 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: 積丹尼 Dan Jacobson
>> <jidanni@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?
AFAICT, not without changing the interface of
file-accessible-directory-p file handler, no.