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.
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);