Subject: lib/3211: open allows a null path as an arg.
To: None <>
From: Paul J. Lavoie <>
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
>Originator:     Paul J. Lavoie
Paul J. Lavoie		(212) 510-3029
ILX Systems, Inc.	111 Fulton St		New York, NY  10038
>Release:        1.2
System: NetBSD 1.2 NetBSD 1.2 (Plucky3) #0: Mon Feb 3 14:20:54 EST 1997 i386

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.

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);



Check the path before proceeding with the call.