Package: ksh Version: 93u+20120801-3.4+deb10u1 Severity: normal Tags: upstream
ksh doesn’t pay attention to tracked aliases during execution – it
always does a PATH search:
$ strace -e signal=none -P /usr/local/bin/ls -P /usr/bin/ls -P /bin/ls ksh
+E
$ ls -a
stat("/usr/local/bin/ls", 0x7ffde8d749c0) = -1 ENOENT (No such file or
directory)
stat("/usr/bin/ls", 0x7ffde8d749c0) = -1 ENOENT (No such file or
directory)
stat("/bin/ls", {st_mode=S_IFREG|0755, st_size=138856, ...}) = 0
lstat("/bin/ls", {st_mode=S_IFREG|0755, st_size=138856, ...}) = 0
. ..
$ whence -a ls
ls is a tracked alias for /bin/ls
$ ls -a
stat("/usr/local/bin/ls", 0x7ffde8d749c0) = -1 ENOENT (No such file or
directory)
stat("/usr/bin/ls", 0x7ffde8d749c0) = -1 ENOENT (No such file or
directory)
stat("/bin/ls", {st_mode=S_IFREG|0755, st_size=138856, ...}) = 0
lstat("/bin/ls", {st_mode=S_IFREG|0755, st_size=138856, ...}) = 0
. ..
This is inefficient. It’s also surprising, given that tracked aliases
were originally intended to avoid PATH lookups in cases like this.
This appears to have been first noticed in 2011 by Siddhesh Poyarekar.
marc.info has mangled the thread a bit, but I think it’s
https://marc.info/[email protected]
└ https://marc.info/[email protected]
├
https://marc.info/[email protected]
│ ├
https://marc.info/[email protected]
│ └ https://marc.info/[email protected]
└ https://marc.info/[email protected]
-- System Information:
Debian Release: 10.6
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Versions of packages ksh depends on:
ii binfmt-support 2.2.0-2
ii libc6 2.28-10
ksh recommends no packages.
ksh suggests no packages.
-- no debconf information
signature.asc
Description: PGP signature

