From owner-freebsd-bugs@FreeBSD.ORG Wed Jan 25 12:10:15 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3641516A41F for ; Wed, 25 Jan 2006 12:10:15 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A92DE43D49 for ; Wed, 25 Jan 2006 12:10:14 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0PCAE3F097873 for ; Wed, 25 Jan 2006 12:10:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0PCAE5E097872; Wed, 25 Jan 2006 12:10:14 GMT (envelope-from gnats) Date: Wed, 25 Jan 2006 12:10:14 GMT Message-Id: <200601251210.k0PCAE5E097872@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Gleb Smirnoff Cc: Subject: Re: bin/92149: [patch] ln -f -s does not remove existing directory X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Gleb Smirnoff List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2006 12:10:15 -0000 The following reply was made to PR bin/92149; it has been noted by GNATS. From: Gleb Smirnoff To: Eugene Grosbein Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: bin/92149: [patch] ln -f -s does not remove existing directory Date: Wed, 25 Jan 2006 15:06:49 +0300 On Mon, Jan 23, 2006 at 11:40:06AM +0000, Eugene Grosbein wrote: E> On Mon, Jan 23, 2006 at 11:53:36AM +0300, Gleb Smirnoff wrote: E> E> > E> "ln -f -s" may be used to create a symlink to the file and E> > E> the target file will be unlinked if it exists. E> > E> E> > E> However, ln will fail with 'Operation not permitted' message E> > E> when target is a directory because unlink(2) does not remove E> > E> empty directories. E> > E> > I think that the current behavior is standard, while suggested behavior E> > is going to violate SUSv3. At least I understand the standard this way: E> > E> > If the destination path exists: E> > E> > 1. If the -f option is not specified, ln shall write a diagnostic message E> > to standard error, do nothing more with the current source_file, and go E> > on to any remaining source_files. E> > 2. Actions shall be performed equivalent to the unlink() function defined in E> > the System Interfaces volume of IEEE Std 1003.1-2001, called using E> > destination as the path argument. If this fails for any reason, ln shall E> > write a diagnostic message to standard error, do nothing more with the E> > current source_file, and go on to any remaining source_files. E> > E> > http://www.opengroup.org/onlinepubs/000095399/utilities/ln.html E> E> Then I'd like to introduce new command line option enabling desired E> behavour. Should I correct the patch? Yes, I think this will be acceptable. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE