[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#33564: Incorrect path canonicalisation
From: |
Mattias Andrée |
Subject: |
bug#33564: Incorrect path canonicalisation |
Date: |
Sat, 1 Dec 2018 21:04:50 +0100 |
User-agent: |
Claws Mail |
Emacs 26.1 removes ..'s incorrectly from file names.
Emacs removes the directory in front the .. rather than
getting its parent directory.
Example:
cd
mkdir -p 1/2
cd 1/2
echo 3 > ../../3
ln -s ~ 4
echo 5 > 5
emacs 4/../5 # works, but shouldn't
emacs 4/../$USER/3 # does not works, should
On Linux, the proper way to get the canonical path
for a file with the file descriptor $fd:
stat(3) /dev/fd/$fd
p := readlink(3) /dev/fd/$fd
if (st_nlinks != 0) {
stat(3) /dev/fd/$fd
if (st_nlinks == 0) {
p := readlink(3) /dev/fd/$fd
remove " (deleted)" from the end of p
}
} else {
remove " (deleted)" from the end of p
}
canonical path is p
- bug#33564: Incorrect path canonicalisation,
Mattias Andrée <=
bug#33564: Incorrect path canonicalisation, Eli Zaretskii, 2018/12/01