From a20326646dead6256637229b6456c380177a28ca Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Fri, 16 Apr 2010 11:49:43 -0400 Subject: [PATCH] work around finder setting modes on symlinks we could mask the mode setting on symlinks, however, it would be nice to change the fileserver to allow mode setting on symlinks in some (safe) cases. preserve our ability to do so. Change-Id: Iba69965c607530bcf2210b508c7aa37403c47477 Reviewed-on: http://gerrit.openafs.org/1764 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afs/DARWIN/osi_vnodeops.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index 07d3939ea..4190d8bea 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -766,16 +766,24 @@ afs_vop_setattr(ap) * struct proc *a_p; * } */ *ap; { - int code; + int code, pass = 0; + struct vcache *avc = VTOAFS(ap->a_vp); #ifdef AFS_DARWIN80_ENV /* fsevents tries to set attributes. drop it. */ if (ap->a_context == afs_osi_ctxtp) return 0; #endif AFS_GLOCK(); - code = afs_setattr(VTOAFS(ap->a_vp), ap->a_vap, vop_cred); +retry: + code = afs_setattr(avc, ap->a_vap, vop_cred); /* This is legit; it just forces the fstrace event to happen */ code = afs_CheckCode(code, NULL, 59); + if (!pass && code == EINVAL && (VATTR_IS_ACTIVE(ap->a_vap, va_mode) && + (vType(avc) == VLNK))) { + VATTR_CLEAR_ACTIVE(ap->a_vap, va_mode); + pass++; + goto retry; + } AFS_GUNLOCK(); return code; } -- 2.39.5