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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25419 in the body.
You can then email your comments to 25419 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25419; Package emacs. (Wed, 11 Jan 2017 16:40:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 11 Jan 2017 16:40:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: give better message when trying to go to forbidden areas
Date: Wed, 11 Jan 2017 22:44:08 +0800
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25419; Package emacs. (Wed, 11 Jan 2017 17:59:02 GMT) Full text and rfc822 format available.

Message #8 received at 25419 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 25419 <at> debbugs.gnu.org
Subject: Re: 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25419; Package emacs. (Thu, 19 Jan 2017 03:28:02 GMT) Full text and rfc822 format available.

Message #11 received at 25419 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25419 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#25419: give better message when trying to go to forbidden
 areas
Date: Wed, 18 Jan 2017 22:28:17 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

>> 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?

AFAICT, not without changing the interface of
file-accessible-directory-p file handler, no.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 27 Jan 2017 09:00:02 GMT) Full text and rfc822 format available.

Notification sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
bug acknowledged by developer. (Fri, 27 Jan 2017 09:00:02 GMT) Full text and rfc822 format available.

Message #16 received at 25419-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: npostavs <at> users.sourceforge.net
Cc: 25419-done <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#25419: give better message when trying to go to forbidden
 areas
Date: Fri, 27 Jan 2017 10:59:08 +0200
> From: npostavs <at> users.sourceforge.net
> Cc: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>,
>   25419 <at> debbugs.gnu.org
> Date: Wed, 18 Jan 2017 22:28:17 -0500
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> 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?
> 
> 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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 24 Feb 2017 12:24:05 GMT) Full text and rfc822 format available.

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

Previous Next


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