Subject: kern/12861: fdesc doesn't handle append-only files well
To: None <gnats-bugs@gnats.netbsd.org>
From: Jaromír <jdolecek@NetBSD.org>
List: netbsd-bugs
Date: 05/07/2001 19:34:45
>Number:         12861
>Category:       kern
>Synopsis:       fdesc doesn't handle append-only files well
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 07 10:35:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jaromír Dolecek
>Release:        2001-05-07
>Organization:
	
>Environment:
	
System: NetBSD saruman.ics.muni.cz 1.5U NetBSD 1.5U (SARUMAN) #52: Fri May 4 08:44:44 CEST 2001 dolecek@saruman.ics.muni.cz:/usr/home/dolecek/soft/netbsd/sys/arch/i386/compile/SARUMAN i386
Architecture: i386
Machine: i386
>Description:
	If fdesc filesystem is used for /dev/fd, opening a
	/dev/fd/X entry with O_TRUNC on filedescriptor opened
	append-only can cause the target file to be truncated.
	This can bite e.g. for stdout (if fdesc is used, /dev/stdout
	is linked to /dev/fd/1), for example if a process opens /dev/stdout
	for write via fopen("/dev/stdout", "w").

	See also bin/12239 (worked around in rev. 1.24 of
	basesrc/usr.bin/sort/sort.c)
>How-To-Repeat:
	See above (and bin/12239).
>Fix:
	None provided, sorry.
>Release-Note:
>Audit-Trail:
>Unformatted: