NetBSD Problem Report #1223
From gnats Thu Jul 13 08:00:43 1995
Received: from jfwhome.funhouse.com (funhouse-gw.ultra.net [199.232.59.148]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with ESMTP id IAA23972 for <gnats-bugs@gnats.netbsd.org>; Thu, 13 Jul 1995 08:00:36 -0400
Message-Id: <199507131202.IAA06091@jfwhome.funhouse.com>
Date: Thu, 13 Jul 1995 08:02:50 -0400
From: "John F. Woods" <jfw@jfwhome.funhouse.com>
Reply-To: jfw@jfwhome.funhouse.com
To: gnats-bugs@gnats.netbsd.org
Subject: mv prints confusing, useless message
X-Send-Pr-Version: 3.2
>Number: 1223
>Category: bin
>Synopsis: mv prints a confusing, useless message on cross-filesystem mv
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jul 13 08:05:05 +0000 1995
>Closed-Date: Tue Oct 07 02:05:36 +0000 1997
>Last-Modified: Tue Oct 07 02:06:32 +0000 1997
>Originator: John F. Woods
>Release: NetBSD-current mv.c dated 21 March 1995
>Organization:
Misanthropes-R-Us
>Environment:
System: NetBSD jfwhome.funhouse.com 1.0A NetBSD 1.0A (JFW) #4: Sun Jul 9 13:19:50 EDT 1995 root@jfwhome.funhouse.com:/usr/src/sys/arch/i386/compile/JFW i386
>Description:
If you move a file that you don't own between filesystems, mv prints
a warning about the failure of the chown() to reset the file ownership. This
message confuses novice users, and fills e.g. news log files with useless
fluff.
The mv(1) manual page defers to cp(1) for the description of cross-
filesystem moves. The cp(1) manual page says cp is silent for failures to
preserve ownership; thus there is a strong implication that mv should be
silent as well, and I argue that common usage requires it.
>How-To-Repeat:
Obtain a novice UNIX user.
Find a file they don't own in a directory they can write.
Have them mv that file to another filesystem.
Observe their dismay at the error message.
>Fix:
This patch is a compromise between cp's documented behavior (no message, nohow)
and cp's actual behavior (if chown fails for a wierd reason, print a message
and set a failure code).
*** mv.c.orig Wed Jul 12 19:06:48 1995
--- mv.c Wed Jul 12 19:07:38 1995
***************
*** 266,273 ****
}
(void)close(from_fd);
! if (fchown(to_fd, sbp->st_uid, sbp->st_gid))
! warn("%s: set owner/group", to);
if (fchmod(to_fd, sbp->st_mode))
warn("%s: set mode", to);
--- 266,275 ----
}
(void)close(from_fd);
! if (fchown(to_fd, sbp->st_uid, sbp->st_gid)) {
! if (errno != EPERM)
! warn("%s: set owner/group", to);
! }
if (fchmod(to_fd, sbp->st_mode))
warn("%s: set mode", to);
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: hubertf
State-Changed-When: Mon Oct 6 19:05:36 PDT 1997
State-Changed-Why:
Change applied to suppress warning message.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.