From owner-freebsd-standards@FreeBSD.ORG Fri Jul 4 13:40:20 2003 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E9CC937B409 for ; Fri, 4 Jul 2003 13:40:19 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id F345A44015 for ; Fri, 4 Jul 2003 13:40:18 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h64KeIUp094769 for ; Fri, 4 Jul 2003 13:40:18 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h64KeI4M094767; Fri, 4 Jul 2003 13:40:18 -0700 (PDT) Date: Fri, 4 Jul 2003 13:40:18 -0700 (PDT) Message-Id: <200307042040.h64KeI4M094767@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Wartan Hachaturow Subject: Re: standards/41576: POSIX compliance of ln(1) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Wartan Hachaturow List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2003 20:40:20 -0000 The following reply was made to PR standards/41576; it has been noted by GNATS. From: Wartan Hachaturow To: Lukas Ertl Cc: bug-followup@freebsd.org, tjr@freebsd.org Subject: Re: standards/41576: POSIX compliance of ln(1) Date: Sat, 5 Jul 2003 00:30:46 +0400 > cd /tmp > mkdir foo bar > ln -s foo bla ### now /tmp/bla symlinks to /tmp/foo > ln -sf bar bla ### replace /tmp/bla to point to /tmp/bar, doesn't work FreeBSD is perfectly SUSv3 (IEEE Std 1003.1, 2003)-compliant here. http://www.opengroup.org/onlinepubs/007904975/utilities/ln.html says that ln should use unlink() on destination in case of "-f" option used. And conformant implementation of unlink's ".. path argument shall not name a directory unless the process has appropriate privileges and the implementation supports using unlink() on directories". Moreover, later, in informational section we see: "APPLICATION USAGE Applications should use rmdir() to remove a directory." FreeBSD's ln uses unlink() and behaves correctly on regular files, and it should not work that way with directories. Bug may be closed, I guess, and ln(1) may be changed back. One thing that we may do is to make ln print a warning in case of -f on a directory, but I personally think it's not worth it. -- Regards, Wartan. "Computers are not intelligent. They only think they are."