From owner-freebsd-bugs@FreeBSD.ORG Sat Jan 26 01:17:56 2008 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C89DA16A41A for ; Sat, 26 Jan 2008 01:17:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by mx1.freebsd.org (Postfix) with ESMTP id 6073313C469 for ; Sat, 26 Jan 2008 01:17:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c211-30-219-213.carlnfd3.nsw.optusnet.com.au [211.30.219.213]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m0Q1H95f025121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 26 Jan 2008 12:17:53 +1100 Date: Sat, 26 Jan 2008 12:07:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: linimon@freebsd.org In-Reply-To: <200801260007.m0Q07gsd008266@freefall.freebsd.org> Message-ID: <20080126114530.I60881@besplex.bde.org> References: <200801260007.m0Q07gsd008266@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-bugs@freebsd.org Subject: Re: bin/1375: [patch] Extraneous warning from mv(1) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2008 01:17:56 -0000 On Sat, 26 Jan 2008 linimon@freebsd.org wrote: > Synopsis: [patch] Extraneous warning from mv(1) > Responsible-Changed-Why: > One of our bugbusters claims that this has been fixed. To submitter: > can you confirm this? Thanks. I hope not, since the warning is correct. mv's man page remains broken and the missing warning for the directory case remain broken. POSIX.1 has clearly specified that the warning is required (as I said when the PR was submitted in 1996) since at least 2001. From a 2001 draft: %%% 25185 If the duplication of the file characteristics fails for any reason, mv shall write a diagnostic 25186 message to standard error, but this failure shall not cause mv to modify its exit status. %%% (The warning is for failure to duplicate ownerships). mv.1 remains broken in its claim that mv across file systems is equivalent to cp -pRP plus a few things. Using cp -pRP gives the cases that are claimed to work in the (but are actually broken) -- mv handles the case of copying a single file internally, and does what is required by POSIX, but for directories it invokes cp -pRP, but cp -pRP has slightly wrong semantics for mv. dds@ has done some work towards having a cp mode that does the right things for mv, but this has not been committed AFAIK. One obvious inconsistency with the above requirement of POSIX is that cp writes the diagnostic for a chown() failure iff it considers the failure to be fatal. This is when chown() fails with errno != EPERM. This alone gives the following brokenness: - if chown() fails with errno EPERM, then the diagnostic is missing but cp's and thus mv's exit status is not affected - if chown() fails with errno != EPERM, then the diagnostic isn't missing but cp exits with a nonzero status, and mv has no way of distinguishing this from a failure to duplicate data. In practice, mv just treats all errors from cp as fatal. Bruce