From owner-freebsd-bugs Tue May 9 14:19:50 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id OAA26508 for bugs-outgoing; Tue, 9 May 1995 14:19:50 -0700 Received: from gndrsh.aac.dev.com (gndrsh.aac.dev.com [198.145.92.241]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id OAA26502 for ; Tue, 9 May 1995 14:19:44 -0700 Received: (from rgrimes@localhost) by gndrsh.aac.dev.com (8.6.11/8.6.9) id OAA05612; Tue, 9 May 1995 14:19:28 -0700 From: "Rodney W. Grimes" Message-Id: <199505092119.OAA05612@gndrsh.aac.dev.com> Subject: Re: strange symlinks To: Bernard.Steiner@Germany.EU.net Date: Tue, 9 May 1995 14:19:28 -0700 (PDT) Cc: freebsd-bugs@FreeBSD.org In-Reply-To: <199505092047.WAA17816@qwerty.Germany.EU.net> from "Bernard.Steiner@Germany.EU.net" at May 9, 95 10:47:40 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1673 Sender: bugs-owner@FreeBSD.org Precedence: bulk > > Folks, > while playing with my FreeBSD 2.0R I came across the following oddity: > > Assumption: directory /tmp exits, owned by bin.bin mode 1777 > then ln -s /tmp/foo /tmp/bar produces symlink /tmp/bar *owned* by bin > regardless of who issued the symlink command, and subsequent rm /tmp/bar > is refused for non-owner, i.e. any normal user except for bin and root. > > This is bogus. EEEkkkksss.. this has been around for a long time, it has to do with the changes in BSD 4.4 on who owns symbolic links, this is part of the POSIX changes. Basically all symbolic links have the owner of the directory that holds them. Also true for the time stamps. Kirk McKusik sent us a patch for his proposal to fix it, and now that I go back and look at the mail he sent it to just David Greenman and myself. I though it had gone to the whole -arch mailling list :-(. I'll go test this patch out and if it makes things better I will apply it. > The next one may be a general 4.4 problem... > assumption: /tmp/foo does not exist, /tmp/bar is a symlink to /tmp/foo. > chdir("/tmp/bar") fails with ENOENT, but at the same time > mkdir("/tmp/bar", 0x777) fails with EEXIST. > > Okay, so that is as per the specs in the PRM (and, thusly, probably POSIX). > However, it seems sort of stranke, doesn't it ? > IMHO the mkdir ought to produce a directory /tmp/foo and not fail. > > Third, whatever happened to the fchdir() syscall that I vaguely remember > having had in (at least) 386BSD0.1 ? > > Thanks, > Bernard > -- Rod Grimes rgrimes@gndrsh.aac.dev.com Accurate Automation Company Custom computers for FreeBSD