Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jul 1995 16:23:07 -0400
From:      Thomas David Rivers <ponds!rivers@dg-rtp.dg.com>
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.
Message-ID:  <199507292023.QAA06773@lakes>

next in thread | raw e-mail | index | archive | help
> 
> >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 -



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507292023.QAA06773>