From 6e1a4895c02a63fccf54b6c42a354ebd0671da16 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 24 Apr 2007 01:41:03 +0000 Subject: [PATCH] STABLE14-viced-write-perm-grants-read-lock-20070423 the permission to obtain a write-lock is granted either by having the "w" permission or the "i" when owning the file. The permission to obtain a read-lock has been granted by having the "k" permission. However it makes no sense that someone can obtain a write-lock but not a read-lock. This patch grants permission to obtain read-locks to those who can obtain write-locks. (cherry picked from commit bb61e1dc678ea28132c195438fc1f157fa580cd1) --- src/viced/afsfileprocs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 2fef7eba5d..0d6c75ec5f 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -1760,7 +1760,9 @@ HandleLocking(Vnode * targetptr, struct client *client, afs_int32 rights, ViceLo 0; Time += AFS_LOCKWAIT; if (LockingType == LockRead) { - if ( !(rights & PRSFS_LOCK) ) + if ( !(rights & PRSFS_LOCK) && + !(rights & PRSFS_WRITE) && + !(OWNSp(client, targetptr) && (rights & PRSFS_INSERT)) ) return(EACCES); if (targetptr->disk.lock.lockCount >= 0) {