From owner-freebsd-hackers Sat Jul 29 15:44:14 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id PAA01918 for hackers-outgoing; Sat, 29 Jul 1995 15:44:14 -0700 Received: from mail.barrnet.net (mail.barrnet.net [131.119.246.7]) by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id PAA01905 for ; Sat, 29 Jul 1995 15:44:12 -0700 Received: from dg-rtp.dg.com (dg-rtp.rtp.dg.com [128.222.1.2]) by mail.barrnet.net (8.6.10/MAIL-RELAY-LEN) with SMTP id OAA18554 for ; Sat, 29 Jul 1995 14:44:18 -0700 Received: by dg-rtp.dg.com (5.4R2.01/dg-rtp-v02) id AA20042; Sat, 29 Jul 1995 16:36:04 -0400 Received: from lakes (lakes [192.96.3.39]) by ponds.UUCP (8.6.11/8.6.5) with ESMTP id QAA02565; Sat, 29 Jul 1995 16:18:42 -0400 Received: (from rivers@localhost) by lakes (8.6.11/8.6.9) id QAA06773; Sat, 29 Jul 1995 16:23:07 -0400 Date: Sat, 29 Jul 1995 16:23:07 -0400 From: Thomas David Rivers Message-Id: <199507292023.QAA06773@lakes> To: zeta.org.au!bde@dg-rtp.dg.com, freebsd-bugs@FreeBSD.org, freebsd-hackers@FreeBSD.org, ponds!rivers@relay1.uu.net Subject: Re: Problem with /bin/mv on 2.0.5. Sender: hackers-owner@FreeBSD.org Precedence: bulk > > >If you have the following directory: > > > /usr/user/DIR > > >and the mode of DIR is as in: > > >drwx------ 2 user general 512 Jul 28 20:34 DIR/ > > >and you execute the following (as the user 'user'): > > > cd /tmp > > touch t > > mv t /usr/user/DIR > > >you will get a message from mv: > > > mv: /usr/user/DIR/t: set owner/group: Operation not permitted > > When a file is moved across file systems, it is impossible to preserve > the group if the user is not a member of the original group. > > >the message was not produced at 2.0. I have determined that /bin/mv > >hasn't changed, and that this message is produced by /bin/mv when > >the fchown() call for the destination failed, with errno set to EPERM. > > > So, what's changed in fchown() that would cause this - the message > >is quite aggravating. > > fchown() was changed to reduce the problem. Now it is not an error to > fchown() a file to the same owner/group that it already has. Previously > this was an error if the user didn't belong to the target group. Now it > is possible to move a file across file systems without getting the error > provided the target directory has the same gid as the source file, but > there is no difference for the more common case of a file in /tmp that > has a different gid to your home directory. > > You probably had your user directory on the same file system as /tmp in 2.0. > > mv was too broken to report the error in 1.1.5. > > Bruce > There appears to be some confusion (not to beat on Bruce at all, his was just the message I chose to reply to :-) ): 1) The owner of all the files/directories is 'user'; there group id of all the files/directories is the same, and is 'user'. 2) This operated "correctly" at 1.1.5 and 2.0 - that is, no message was generated when the 'mv' occured. 3) The source for 'mv' hasn't changed from 2.0 to 2.0.5; so I don't think that would be a fruitful place to look. 4) /tmp is a different file system from /usr, and I have always done that (that is, in my 2.0 system, /tmp was a different file system.) I think the problem is the fchown() is being more aggressive at checking in 2.0.5 than it did at 2.0 - possible more so than is correct. - Dave Rivers -