darwin-clear-va-flags-in-copyoutattrs-20010514
authorTed McCabe <ted@mit.edu>
Mon, 14 May 2001 22:30:35 +0000 (22:30 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 14 May 2001 22:30:35 +0000 (22:30 +0000)
"I noticed that when I tried copying files out of AFS, I would often
not be able to modify the destination files/dirs due to the user flags
being non-zero (see man chflags).  Turns out that not all of the
fields of Darwin's struct vattr were being set in afs_CopyOutAttrs

This patch clears the va_flags entry. I wasn't sure how the
va_filerev and va_gen fields are precisely used, but since I wasn't
noticing any trouble I could attribute to them, I left them
unspecified.  I suspect someone with more knowledge can say for sure.
"

src/afs/VNOPS/afs_vnop_attrs.c

index 311f216..eb9c218 100644 (file)
@@ -128,14 +128,14 @@ afs_CopyOutAttrs(avc, attrs)
      * Below return 0 (and not 1) blocks if the file is zero length. This conforms
      * better with the other filesystems that do return 0.     
      */
-#ifdef AFS_OSF_ENV
+#if   defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
 #ifdef va_size_rsv
     attrs->va_size_rsv = 0;
 #endif
 /* XXX do this */
 /*    attrs->va_gen = avc->m.DataVersion;*/
     attrs->va_flags = 0;
-#endif /* AFS_OSF_ENV */
+#endif /* AFS_OSF_ENV || AFS_DARWIN_ENV */
 
 #if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 #if !defined(AFS_HPUX_ENV)