Subject: lib/3211: open allows a null path as an arg.
To: None <gnats-bugs@gnats.netbsd.org>
From: Paul J. Lavoie <pjl@ilx.com>
List: netbsd-bugs
Date: 02/11/1997 14:30:06
>Number:         3211
>Category:       lib
>Synopsis:       open allows a null path as an argument
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 11 06:35:01 1997
>Last-Modified:
>Originator:     Paul J. Lavoie
>Organization:
-----------------------------------------------------------------------
Paul J. Lavoie		pjl@ilx.com		(212) 510-3029
ILX Systems, Inc.	111 Fulton St		New York, NY  10038
>Release:        1.2
>Environment:
	
System: NetBSD plucky.openg.ilx.com 1.2 NetBSD 1.2 (Plucky3) #0: Mon Feb 3 14:20:54 EST 1997 pjl@plucky.openg.ilx.com:/usr/src/sys-1.2/arch/i386/compile/Plucky3 i386


>Description:
Open allows a null string to be passed as the path argument, resulting in what
appears to be the current directory. None of the other unixes that I tried
this on allowed the call.
	
>How-To-Repeat:

Compile the following program. Watch it return a valid file descriptor.
Try it on a different system.

main() {

int fd;

fd = open("", 0, 0);
printf("Returns %d\n", fd);

}

>Fix:

Check the path before proceeding with the call. 
>Audit-Trail:
>Unformatted: