* bug#25419: give better message when trying to go to forbidden areas
@ 2017-01-11 14:44 積丹尼 Dan Jacobson
2017-01-11 17:58 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-01-11 14:44 UTC (permalink / raw)
To: 25419
Do C-x C-f ~root
You will see:
Setting current directory: Success, /root/
But that is about all.
Because normally,
$ cd ~root
bash: cd: /root: Permission denied
Which better reflects reality.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#25419: give better message when trying to go to forbidden areas
2017-01-11 14:44 bug#25419: give better message when trying to go to forbidden areas 積丹尼 Dan Jacobson
@ 2017-01-11 17:58 ` Eli Zaretskii
2017-01-19 3:28 ` npostavs
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2017-01-11 17:58 UTC (permalink / raw)
To: 積丹尼 Dan Jacobson; +Cc: 25419
> 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?
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#25419: give better message when trying to go to forbidden areas
2017-01-11 17:58 ` Eli Zaretskii
@ 2017-01-19 3:28 ` npostavs
2017-01-27 8:59 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: npostavs @ 2017-01-19 3:28 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 25419, 積丹尼 Dan Jacobson
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#25419: give better message when trying to go to forbidden areas
2017-01-19 3:28 ` npostavs
@ 2017-01-27 8:59 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2017-01-27 8:59 UTC (permalink / raw)
To: npostavs; +Cc: 25419-done, jidanni
> From: npostavs@users.sourceforge.net
> Cc: 積丹尼 Dan Jacobson <jidanni@jidanni.org>,
> 25419@debbugs.gnu.org
> Date: Wed, 18 Jan 2017 22:28:17 -0500
>
> 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.
OK, thanks. I made that change, and I'm marking this bug done.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-27 8:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-11 14:44 bug#25419: give better message when trying to go to forbidden areas 積丹尼 Dan Jacobson
2017-01-11 17:58 ` Eli Zaretskii
2017-01-19 3:28 ` npostavs
2017-01-27 8:59 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).