NetBSD Problem Report #11757

Received: (qmail 15977 invoked from network); 17 Dec 2000 23:05:25 -0000
Message-Id: <200012172306.eBHN6bI01519@saruman.ics.muni.cz>
Date: Mon, 18 Dec 2000 00:06:37 +0100 (CET)
From: Jaromír Dolecek <dolecek@ics.muni.cz>
Reply-To: dolecek@ics.muni.cz
To: gnats-bugs@gnats.netbsd.org
Subject: emulations don't treat readlink(2) and similar symlink calls correctly
X-Send-Pr-Version: 3.95

>Number:         11757
>Category:       kern
>Synopsis:       emulations don't treat readlink(2) and similar symlink calls correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 17 23:06:01 +0000 2000
>Closed-Date:    Mon Jan 22 20:09:29 +0000 2001
>Last-Modified:  Mon Jan 22 20:09:29 +0000 2001
>Originator:     Jaromír Dolecek
>Release:        1.5N 2000-12-18
>Organization:

>Environment:

System: NetBSD saruman.ics.muni.cz 1.5N NetBSD 1.5N (SARUMAN) #168: Sun Dec 17 21:37:12 CET 2000 dolecek@saruman.ics.muni.cz:/usr/home/dolecek/soft/netbsd/sys/arch/i386/compile/SARUMAN i386
Architecture: i386
Machine: i386
>Description:
	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
	on symlinks. 

	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)
>How-To-Repeat:
	ln -s U /emul/freebsd/etc/malloc.conf

	watch ktrace and find out the readlink(2) syscall fails even when
	the symlink exists.
>Fix:
	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.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jdolecek 
State-Changed-When: Mon Jan 22 12:09:04 PST 2001 
State-Changed-Why:  
Fixed on -current. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.