From 5026d73c8624e3eb36908ce16cc2bb6509eb4e37 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Thu, 11 Mar 2010 12:10:38 -0500 Subject: [PATCH] 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 --- src/afs/DARWIN/osi_vnodeops.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index 8fe2a50..9dadf2c 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) { -- 1.9.4