From owner-freebsd-current Mon Dec 16 7: 6:33 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89D7C37B401 for ; Mon, 16 Dec 2002 07:06:31 -0800 (PST) Received: from gilliam.users.flyingcroc.net (gilliam.users.flyingcroc.net [207.246.128.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2E7A43EC2 for ; Mon, 16 Dec 2002 07:06:30 -0800 (PST) (envelope-from joek@mail.flyingcroc.net) Received: from mail.flyingcroc.net (zircon.staff.flyingcroc.net [207.246.150.92]) by gilliam.users.flyingcroc.net (8.9.3/8.9.3) with ESMTP id HAA60084 for ; Mon, 16 Dec 2002 07:06:20 -0800 (PST) Message-ID: <3DFDEBEC.4090209@mail.flyingcroc.net> Date: Mon, 16 Dec 2002 07:06:20 -0800 From: Joe Kelsey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: Posix Semaphores in -CURRENT References: <3DF8F08E.8050809@mail.flyingcroc.net> <3DFA0771.BDFC87A8@mindspring.com> <3DFA0DAC.2070801@mail.flyingcroc.net> <3DFA1251.C4755C5B@mindspring.com> <3DFA18CC.8090205@mail.flyingcroc.net> <3DFC0464.A72308AC@mindspring.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Terry Lambert wrote: > Joe Kelsey wrote: > >> /* name must start with a '/' but not contain one. */ >> if (*name != '/' || len < 2 || index(name + 1, '/') != NULL) { >> free(ret, M_SEM); >> return (EINVAL); >> } >> >>The comment makes it look like this code allows a 14-character named >>semaphore which *must* start with a slash and cannot contain embedded >>slashes. In other words, it does *not* conform to pathname semantics. > > > OK, this is a bug. The semantics don't conform to POSIX. ... > I rather imagine the correct thing to do is to root it in the FS, > and, without a leading '/', treat it as relative to the process > current directory. > > Basically, this is not a two line fix... it's a lot of work, to > get a filesystem object to use. I think that it *is* a two-line fix. Remove the maximum length (or impose a maximum length of MAX_PATHNAMELEN), and simply remove the whole '/' checking. Then, the private namespace correctly emulates posix semantics, except for the rooted versus relative stuff, which would be *really* hard to do in a private namespace and of questionable value anyway. /Joe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message