From owner-freebsd-bugs Sat Jul 22 09:49:41 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id JAA03067 for bugs-outgoing; Sat, 22 Jul 1995 09:49:41 -0700 Received: from blob.best.net (blob.best.net [204.156.128.88]) by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id JAA03061 for ; Sat, 22 Jul 1995 09:49:40 -0700 Received: (root@localhost) by blob.best.net (8.6.12/8.6.5) id JAA11816; Sat, 22 Jul 1995 09:49:33 -0700 Date: Sat, 22 Jul 1995 09:49:33 -0700 From: Matt Dillon Message-Id: <199507221649.JAA11816@blob.best.net> To: bugs@freebsd.org Subject: Here's a new one: /bin/mv truncates destination if dest is NFS Sender: bugs-owner@freebsd.org Precedence: bulk Here's another one... /bin/mv truncates the destination file if the destination is an NFS filesytem. * Create a 24254 byte file * as root, chgrp the file to a group the user has no permissions on * as the user, /bin/mv file dest where dest is on an NFS mount. What happens is that the fchown() that /bin/mv does blows away the last dirty buffer from the filecopy (which used 8K chunks) that /bin/mv did, so the output file winds up being only 16K long!! This only occurs when fchown() fails due to not being able to transfer the group permissions to the destination file, i.e. when you get: mv2: /home/au/z: set owner/group: Operation not permitted If I put a sleep() in just before the fchown() and manually /bin/sync after the file is written but before the fchown(), the file size comes out properly. -Matt