From owner-freebsd-hackers Sun Feb 22 17:14:59 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA18092 for freebsd-hackers-outgoing; Sun, 22 Feb 1998 17:14:59 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from time.cdrom.com (root@time.cdrom.com [204.216.27.226]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA18081 for ; Sun, 22 Feb 1998 17:14:50 -0800 (PST) (envelope-from jkh@time.cdrom.com) Received: from time.cdrom.com (jkh@localhost.cdrom.com [127.0.0.1]) by time.cdrom.com (8.8.8/8.6.9) with ESMTP id RAA29302 for ; Sun, 22 Feb 1998 17:14:25 -0800 (PST) Prev-Resent: Sun, 22 Feb 1998 17:14:24 -0800 Prev-Resent: "hackers@freebsd.org " Received: from hub.freebsd.org (hub.FreeBSD.ORG [204.216.27.18]) by time.cdrom.com (8.8.8/8.6.9) with ESMTP id NAA28550 for ; Sun, 22 Feb 1998 13:58:47 -0800 (PST) Received: from freebase.camb.opengroup.org (freebase.camb.opengroup.org [130.105.3.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA22694; Sun, 22 Feb 1998 13:59:08 -0800 (PST) (envelope-from loverso@opengroup.org) Received: from opengroup.org (localhost.camb.opengroup.org [127.0.0.1]) by freebase.camb.opengroup.org (8.8.8/8.8.7) with ESMTP id QAA10655; Sun, 22 Feb 1998 16:58:32 -0500 (EST) Message-Id: <199802222158.QAA10655@freebase.camb.opengroup.org> To: afs@FreeBSD.ORG, jkh@FreeBSD.ORG Subject: NFS-to-AFS translater and 2.2.5 "mv" X-Face: "UZ!}1W2N?eJdN(`1%|/OOPqJ).Idk?UyvWw'W-%`Gto8^IkEm>.g1O$[.;~}8E=Ire0|lO .o>:NlJS1@vO9bVmswRoq3j DdX9YGSeJ5a(mfX[1u>Z63G5_^+'8LVqjqvn X-Url: http://www.osf.org/~loverso/ Date: Sun, 22 Feb 1998 16:58:32 -0500 From: John Robert LoVerso Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I still run my FreeBSD machines against the AFS/NFS translator and have come up across a problem with FreeBSD's latest version of "mv". I'd love to make this whole problem go away by using AFS directory and no longer needing the translator, but... The translator, in adapting AFS ACLs, does some wierd things. One of them is that if you "chmod 0" a file, you lose all access to it via the translator. I don't defend this behavior, but that is what I'm stuck with. This has been no problem until I installed 2.2-STABLE, dating past 2.2.5. In an NFS mounted AFS directory, I would do: freebase:~ 67 j$ ls -l d ls: d: No such file or directory freebase:~ 66 j$ mv /tmp/d . mv: ./d: Permission denied freebase:~ 67 j$ ls -l d ls: d: Permission denied On a machine with AFS, the same file would be listed as: mule:~ 64 j$ l d ---------- 1 loverso osf 0 Feb 21 17:15 d Seeing that, I peeked at the CVS tree for mv and found: RELENG_2_2_5_RELEASE: 1.8.2.1 RELENG_2_2_2_RELEASE: 1.8 ---------------------------- revision 1.8 date: 1996/03/01 06:14:13; author: wosch; state: Exp; lines: +0 -0 branches: 1.8.2; delete unused label endarg correct indent of last new code fix usage string, option -f before option -i (alphabetic order) ---------------------------- revision 1.8.2.1 date: 1997/08/25 08:33:11; author: jkh; state: Exp; lines: +31 -13 MFC: cosmetic tweaks + error reporting mods. Sometime between 2.2.2 and 2.2.5, "mv" was changed. The crux of the change is in fastcopy(), when "mv" is copying regular files between different filesystems: < if ((to_fd = < open(to, O_CREAT | O_TRUNC | O_WRONLY, sbp->st_mode)) < 0) { ----- > while ((to_fd = > open(to, O_CREAT | O_EXCL | O_TRUNC | O_WRONLY, 0)) < 0) { That is, the new file is now created with mode 0, and afterwards, it is fchmod()'d to the correct value. I can only imagine that this change was made to close a possible race condition in when moving files. Note, however, that starting the new file with a mode of 0 only happens when "mv" is in the midst of copying a file. "cp", at least as of 2.2-980219, does NOT do this. So, if it isn't needed for "cp", why is it needed for "mv" when copying a file? (One possible answer is that a similar change for "cp" exists in the "current" branch and it hasn't been pushed to "stable"; I did not check). So, can anyone: - tell me they've got a working AFS client side - tell me why "mv" has been thus changed Meanwhile, I've backed out the change in "mv" so that I can continue using my machines on a daily basis. John To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message