Subject: Re: mkdir with trailing / (patch proposed)
To: NetBSD Userlevel Technical Discussion List <firstname.lastname@example.org>
From: Greywolf <email@example.com>
Date: 04/29/2002 13:11:31
On Mon, 29 Apr 2002, Greg A. Woods wrote:
# Besides this "bug" exists very deep in the core of the NetBSD kernel --
# it just manifests itself most obviously and most frequently with
# mkdir(2). See for example the need to avoid it as implemented in
# /usr/src/bin/rmdir/rmdir.c too. Obviously with rmdir(2) there can be no
# mistake that the caller expects the pathname to refer to an existing
# directory. You cannot properly fix the kernel to allow the required
# interpretation for all calls except for mkdir(2), at least not with any
# sufficient degree of elegance or efficiency.
I've had problems in the past trying to rmdir("/path/to/some/directory/")
because it assumes a trailing "/" to be equivalent to a "/.", and we all
know that rmdir(".") is going to fail.
I seem to recall that we changed pathname semantics such that a trailing
slash did not get re-interpreted as a trailing slash-dot.
My other computer runs NetBSD.