From owner-freebsd-current Fri Aug 31 7:43:26 2001 Delivered-To: freebsd-current@freebsd.org Received: from green.bikeshed.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4E26D37B439; Fri, 31 Aug 2001 07:43:11 -0700 (PDT) Received: from localhost (green@localhost) by green.bikeshed.org (8.11.4/8.11.1) with ESMTP id f7VEh8h14038; Fri, 31 Aug 2001 10:43:09 -0400 (EDT) (envelope-from green@green.bikeshed.org) Message-Id: <200108311443.f7VEh8h14038@green.bikeshed.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Bruce Evans Cc: "Steve O'Hara-Smith" , David Wolfskill , current@FreeBSD.ORG Subject: Re: symlink(2) [Was: Re: tcsh.cat] In-Reply-To: Your message of "Sat, 16 Jun 2001 14:34:07 +1000." From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 31 Aug 2001 10:43:07 -0400 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 Bruce Evans wrote: > On Fri, 15 Jun 2001, Steve O'Hara-Smith wrote: > > > On Fri, 15 Jun 2001 06:31:12 -0700 (PDT) > > David Wolfskill wrote: > > > > DW> Indeed: it is my understanding that the "path name" interpretation is > > DW> an issue at the time of reference, not (necessarily) the time of > > DW> creation. It has, to the best of my knowledge, been valid to create a > > DW> symlink prior to a point when its target exists. > > > > It has been on evey platform I have ever used ln -s on. > > > > DW> One may well argue that this is "broken" in some way(s). Still, changing > > DW> it at this point could well be considered a POLA violation, at best. > > > > I would argue loud and long that changing that *would* be broken. There > > is never a guarantee (or even an implication) that a symlink points to a > > valid directory entry (think unmounted filesystems, NFS ...). I find it hard > > to imagine why creation time should be special in that regard. > > We are (or at least I am) talking about changing it to prevent links to a > string that can _never_ be a valid pathname. Fortunately, in POSIX there > is only one such string (the empty string). > > Here's an example of a standard utility being clueless about symlinks to > nothing: > > $ ln -s '' foo > $ cp foo bar > cp: foo is a directory (not copied) > > foo is certainly not a directory. The bug seems to be in fts. No, "foo" certainly _is_ a directory. It is precisely the same thing as ".". > cp is also broken for symlinks to valid pathnames for nonexistent files; > > $ rm -f foo > $ ln -s /nonesuch foo > $ cp foo bar > > This duplicates foo as a symlink, but should just fail. > > Bruce -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message