all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jacob Burckhardt <jacob@teamconnectusa.com>
Cc: 64102@debbugs.gnu.org
Subject: bug#64102: 28.2; fails to find pathname with a sub dir as symlink and with parent dir ('..')
Date: Fri, 16 Jun 2023 10:11:49 +0300	[thread overview]
Message-ID: <83352rubii.fsf@gnu.org> (raw)
In-Reply-To: <SJ0PR13MB5474AA2778DC60B7CC3112D3D4569@SJ0PR13MB5474.namprd13.prod.outlook.com> (bug-gnu-emacs@gnu.org)

> Date: Thu, 15 Jun 2023 22:25:56 +0000
> msip_labels: 
> From:  Jacob Burckhardt via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Reproduce the bug by running this:
> 
> mkdir -p /tmp/usr2/lib/gcc/x86_64-linux-gnu/12
> mkdir /tmp/usr2/include
> echo symbolic link test > /tmp/usr2/include/test.h
> \ln -s usr2/lib /tmp/lib2
> cat /tmp/lib2/gcc/x86_64-linux-gnu/12/../../../../include/test.h
> emacs -q /tmp/lib2/gcc/x86_64-linux-gnu/12/../../../../include/test.h
> 
> Emacs failed to display the content of that file in a buffer.  Since the above cat command shows the contents, Emacs should be able to show it as well.  The following bug is similar and includes some explanations that also apply to my bug.
> 
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8035
> 
> Note that the following code succeeds.  You might consider using code like this to fix the bug:
> 
> (find-file (file-truename "/tmp/lib2/gcc/x86_64-linux-gnu/12/../../../../include/test.h"))

This would mean expand-file-name would need to call file-truename to
resolve such tricky symlinks, which I think is not reasonable.  We
never did that, AFAICT, and the code in find-file-noselect that begins
with expand-file-name on the argument FILENAME has been there since
1992.





  reply	other threads:[~2023-06-16  7:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 22:25 bug#64102: 28.2; fails to find pathname with a sub dir as symlink and with parent dir ('..') Jacob Burckhardt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-16  7:11 ` Eli Zaretskii [this message]
2023-06-18  8:53   ` Eli Zaretskii
2023-06-18 18:03     ` Paul Eggert
2023-06-18 18:25       ` Eli Zaretskii
2023-06-18 18:43         ` Paul Eggert
2023-06-18 20:13 ` Al Petrofsky
2023-06-19 19:03   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83352rubii.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=64102@debbugs.gnu.org \
    --cc=jacob@teamconnectusa.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.