Commit 7028ed2
committed
client: prohibit unprivileged users from setting sgid/suid bits
Prior to fb1b72d, unprivileged users could add mode bits as long as
S_ISUID and S_ISGID were not included in the change.
After fb1b72d, unprivileged users were allowed to modify S_ISUID and
S_ISGID bits only when no other mode bits were changed in the same
operation. This inadvertently permitted unprivileged users to set
S_ISUID and/or S_ISGID bits when they were the sole bits being modified.
This behavior should not be allowed. Unprivileged users should be
prohibited from setting S_ISUID and/or S_ISGID bits under any
circumstances.
This change tightens the permission check to prevent unprivileged
users from setting these privileged bits in all cases.
Signed-off-by: Kefu Chai <[email protected]>1 parent 388cff0 commit 7028ed2
2 files changed
+32
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6204 | 6204 | | |
6205 | 6205 | | |
6206 | 6206 | | |
6207 | | - | |
6208 | 6207 | | |
6209 | 6208 | | |
6210 | 6209 | | |
6211 | 6210 | | |
6212 | 6211 | | |
6213 | 6212 | | |
6214 | | - | |
| 6213 | + | |
6215 | 6214 | | |
6216 | | - | |
6217 | | - | |
6218 | | - | |
6219 | | - | |
6220 | | - | |
6221 | | - | |
6222 | | - | |
| 6215 | + | |
| 6216 | + | |
| 6217 | + | |
| 6218 | + | |
| 6219 | + | |
| 6220 | + | |
| 6221 | + | |
| 6222 | + | |
| 6223 | + | |
6223 | 6224 | | |
6224 | 6225 | | |
6225 | 6226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
145 | 157 | | |
146 | 158 | | |
147 | 159 | | |
| |||
214 | 226 | | |
215 | 227 | | |
216 | 228 | | |
| 229 | + | |
| 230 | + | |
217 | 231 | | |
218 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
219 | 241 | | |
220 | 242 | | |
221 | 243 | | |
| |||
0 commit comments