Subject: kern/11757: emulations don't treat readlink(2) and similar symlink calls correctly
To: None <email@example.com>
From: Jaromír <firstname.lastname@example.org>
Date: 12/17/2000 15:06:15
>Synopsis: emulations don't treat readlink(2) and similar symlink calls correctly
>Arrival-Date: Sun Dec 17 15:06:01 PST 2000
>Originator: Jaromír Dolecek
>Release: 1.5N 2000-12-18
System: NetBSD saruman.ics.muni.cz 1.5N NetBSD 1.5N (SARUMAN) #168: Sun Dec 17 21:37:12 CET 2000 email@example.com:/usr/home/dolecek/soft/netbsd/sys/arch/i386/compile/SARUMAN i386
readlink() might behave incorrectly if the symlink doesn't lead
to real file. Emulations typically do CHECK_ALT_EXIST() check,
but since the symlink does not lead to real file and namei() call
is done with FOLLOW, it fails
and path without /emul/FOO/ prefix is used for the syscall.
This may affect also lchown() and similar syscalls which operate
This is non-critical, since the cases where it fails are pretty
seldom (and for emulations only, it works ok for 'native' calls or
if the accessed file exists under 'normal' tree)
ln -s U /emul/freebsd/etc/malloc.conf
watch ktrace and find out the readlink(2) syscall fails even when
the symlink exists.
Probably introduce third form of CHECK_ALT_*, which makes emul_find()
to use namei() with NOFOLLOW.
No patch provided, this PR is mainly a reminder to handle this later.