|
5 | 5 | # and Edward Z. Yang <[email protected]>
|
6 | 6 | # and Benjamin Kaduk <[email protected]>
|
7 | 7 | # and Alexander Chernyakhovsky <[email protected]>
|
| 8 | +# and Mitchell Berger <[email protected]> |
8 | 9 | #
|
9 | 10 | # This file is available under both the MIT license and the GPL.
|
10 | 11 | #
|
@@ -119,6 +120,24 @@ index 0087073..df3e4ef 100644
|
119 | 120 | return ((fileBits & arights) == arights); /* true if all rights bits are on */
|
120 | 121 | }
|
121 | 122 | }
|
| 123 | +@@ -305,7 +329,16 @@ afs_access(OSI_VC_DECL(avc), afs_int32 amode, |
| 124 | + if ((avc->f.m.Mode & 0100) == 0) |
| 125 | + code = 0; |
| 126 | + } else if (avc->f.m.Mode & 0100) |
| 127 | +- code = 1; |
| 128 | ++ /* [scripts] Stock AFS sets code to 1 here and allows an |
| 129 | ++ * attempt at execution even if the AFS permissions don't |
| 130 | ++ * allow reading. If the read permission is really |
| 131 | ++ * missing, the server would prevent this. Because we |
| 132 | ++ * return 0 from afs_AccessOK when the read permission is |
| 133 | ++ * present but the UID doesn't match the VID, setting code |
| 134 | ++ * to 1 here would allow any user to execute (and |
| 135 | ++ * therefore read) any program Scripts can read, even if |
| 136 | ++ * it's in the wrong volume. */ |
| 137 | ++ ; |
| 138 | + } |
| 139 | + if (code && (amode & VWRITE)) { |
| 140 | + code = afs_AccessOK(avc, PRSFS_WRITE, treq, CHECK_MODE_BITS); |
122 | 141 | diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c
|
123 | 142 | index 2eb228f..d5d6e4a 100644
|
124 | 143 | --- a/src/afs/VNOPS/afs_vnop_attrs.c
|
|
0 commit comments