From: Derrick Brashear Date: Thu, 11 Mar 2010 17:10:38 +0000 (-0500) Subject: macos dropbox fix for finder X-Git-Tag: openafs-devel-1_5_73~64 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5026d73c8624e3eb36908ce16cc2bb6509eb4e37;p=packages%2Fo%2Fopenafs.git macos dropbox fix for finder sadly this can mean we lie and say delete will work when it will fail, but finder looks for KAUTH_VNODE_DELETE_CHILD along with KAUTH_VNODE_ADD_SUBDIRECTORY and KAUTH_VNODE_ADD_FILE, not as one-offs. Change-Id: I4079b89e188992ee33594cad5bd15f7bf6106203 Reviewed-on: http://gerrit.openafs.org/1561 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index 8fe2a509a..9dadf2cbb 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -615,13 +615,17 @@ afs_vop_access(ap) /* we can't check for KAUTH_VNODE_TAKE_OWNERSHIP, so we always permit it */ code = afs_AccessOK(tvc, bits, &treq, cmb); -#if defined(AFS_DARWIN80_ENV) - /* In a dropbox, cp on 10.4 behaves badly, looping on EACCES */ - /* In a dropbox, Finder may reopen the file. Let it. */ - if (code == 0 && ((bits &~(PRSFS_READ|PRSFS_WRITE)) == 0)) { + /* + * Special cased dropbox handling: + * cp on 10.4 behaves badly, looping on EACCES + * Finder may reopen the file. Let it. + */ + if (code == 0 && ((bits &~(PRSFS_READ|PRSFS_WRITE)) == 0)) code = afs_AccessOK(tvc, PRSFS_ADMINISTER|PRSFS_INSERT|bits, &treq, cmb); - } -#endif + /* Finder also treats dropboxes as insert+delete. fake it out. */ + if (code == 0 && (bits == (PRSFS_INSERT|PRSFS_DELETE))) + code = afs_AccessOK(tvc, PRSFS_INSERT, &treq, cmb); + if (code == 1 && vnode_vtype(ap->a_vp) == VREG && ap->a_action & KAUTH_VNODE_EXECUTE && (tvc->f.m.Mode & 0100) != 0100) {