From: Jeffrey Altman Date: Tue, 24 Apr 2007 01:27:30 +0000 (+0000) Subject: viced-write-perm-grants-read-lock-20070423 X-Git-Tag: BP-openafs-windows-kdfs-ifs~723 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=bb61e1dc678ea28132c195438fc1f157fa580cd1;p=packages%2Fo%2Fopenafs.git 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. --- 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);