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)
This commit is contained in:
Jeffrey Altman 2007-04-24 01:41:03 +00:00
parent 9b627ccc5d
commit 6e1a4895c0

View File

@ -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) {