From bb61e1dc678ea28132c195438fc1f157fa580cd1 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 24 Apr 2007 01:27:30 +0000 Subject: [PATCH] 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. --- src/viced/afsfileprocs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 1ea8a8919..70c3f0463 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -1725,8 +1725,11 @@ HandleLocking(Vnode * targetptr, struct client *client, afs_int32 rights, ViceLo 0; Time += AFS_LOCKWAIT; if (LockingType == LockRead) { - if ( !(rights & PRSFS_LOCK) ) - return(EACCES); + if ( !(rights & PRSFS_LOCK) && + !(rights & PRSFS_WRITE) && + !(OWNSp(client, targetptr) && (rights & PRSFS_INSERT)) ) + return(EACCES); + return(EACCES); if (targetptr->disk.lock.lockCount >= 0) { ++(targetptr->disk.lock.lockCount); -- 2.39.5