From owner-freebsd-bugs Tue Sep 25 8:10:10 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (unknown [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A1DED37B427 for ; Tue, 25 Sep 2001 08:10:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f8PFA1D46818; Tue, 25 Sep 2001 08:10:01 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (unknown [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id CD59637B446 for ; Tue, 25 Sep 2001 08:03:25 -0700 (PDT) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f8PF3Pr42822; Tue, 25 Sep 2001 08:03:25 -0700 (PDT) (envelope-from nobody) Message-Id: <200109251503.f8PF3Pr42822@freefall.freebsd.org> Date: Tue, 25 Sep 2001 08:03:25 -0700 (PDT) From: Jeremy Chadwick To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/30819: /bin/mv results in warnings when /bin/cp -p does not. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 30819 >Category: bin >Synopsis: /bin/mv results in warnings when /bin/cp -p does not. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 25 08:10:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Jeremy Chadwick >Release: 4.4-STABLE >Organization: >Environment: Not applicable. >Description: From mv(1): As the rename(2) call does not work across file systems, mv uses cp(1) and rm(1) to accomplish the move. The effect is equivalent to: rm -f destination_path && \ cp -pRP source_file destination && \ rm -rf source_file From cp(1): -p Cause cp to preserve in the copy as many of the modification time, access time, file flags, file mode, user ID, and group ID as allowed by permissions. If the user ID and group ID cannot be preserved, no error message is displayed and the exit value is not altered. It seems to me the "warning" spit out by mv(1) is worthless, as cp(1) does not do this. Could this warning in mv(1) be removed? It seems very contradictory to what's in the cp(1) manpage. >How-To-Repeat: $ id uid=502(jdc) gid=100(users) groups=100(users) $ ls -ld /tmp drwxrwxrwt 4 root wheel 512 Sep 25 07:56 /tmp $ touch /tmp/foo $ ls -ld /tmp/foo -rw------- 1 jdc wheel 0 Sep 25 07:54 /tmp/foo $ cp -pRP /tmp/foo ./foo $ ls -ld ./foo -rw------- 1 jdc users 0 Sep 25 07:54 ./foo $ rm ./foo $ mv /tmp/foo ./foo mv: ./foo: set owner/group (was: 502/0): Operation not permitted >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message