Nullpath in system calls considered harmful?

Casper H.S. Dik casper at uva.UUCP
Sat Feb 4 21:53:29 AEST 1989


In article <88368 at sun.uucp> lm at sun.UUCP (Larry McVoy) writes:
>Hi-
>	A question for oldtimers: is there any good reason that null paths
>    (ie, open("", flags)) should NOT be considered an error.  If you don't
>    already know that many kernels translate "" into "." you probably
>    can't answer this question.  POSIX wants "" to be an error.
>
>Thanks,
>
>Larry McVoy, Lachman Associates.			  My opinions are that.

I'm not an oldtimer, but I think that disallowing the null path
would break many programs.

The main reason why kernels translate "" into "." is beacause of paths
containing //. Try:
% cp -i vmunix /
it responds with:
replace //vmunix?

Many more programs are affected by this. They all think
<validdir>/<file> will always give a valid pathname.
If validdir = "/" this breaks.

If POSIX still allows // in pathnames (do they?), then they disallow only
one special case of null paths, I would say that that's a bad idea.
--cd
____________________________________________________________________________
Casper H.S. Dik
University of Amsterdam     |		      dik at uva.uucp
The Netherlands             |                 ...!uunet!mcvax!uva!dik



More information about the Comp.unix.wizards mailing list