forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcf5eb37
committed
Restrict the privileges of CREATEROLE users.
Previously, CREATEROLE users were permitted to make nearly arbitrarychanges to roles that they didn't create, with certain exceptions,particularly superuser roles. Instead, allow CREATEROLE users to make suchchanges to roles for which they possess ADMIN OPTION, and togrant membership only in roles for which they possess ADMIN OPTION.When a CREATEROLE user who is not a superuser creates a role, grantADMIN OPTION on the newly-created role to the creator, so that theycan administer roles they create or for which they have been givenprivileges.With these changes, CREATEROLE users still have very significantpowers that unprivileged users do not receive: they can alter, rename,drop, comment on, change the password for, and change security labelson roles. However, they can now do these things only for roles forwhich they possess appropriate privileges, rather than allnon-superuser roles; moreover, they cannot grant a role such aspg_execute_server_program unless they themselves possess it.Patch by me, reviewed by Mark Dilger.Discussion:https://postgr.es/m/CA+TgmobN59ct+Emmz6ig1Nua2Q-_o=r6DSD98KfU53kctq_kQw@mail.gmail.com1 parentf026c16 commitcf5eb37
File tree
15 files changed
+210
-106
lines changed- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- test
- modules/dummy_seclabel
- expected
- sql
- regress
- expected
- sql
15 files changed
+210
-106
lines changedLines changed: 4 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3216 | 3216 |
| |
3217 | 3217 |
| |
3218 | 3218 |
| |
3219 |
| - | |
3220 |
| - | |
| 3219 | + | |
| 3220 | + | |
3221 | 3221 |
| |
3222 | 3222 |
| |
3223 |
| - | |
3224 |
| - | |
3225 |
| - | |
| 3223 | + | |
3226 | 3224 |
| |
3227 | 3225 |
| |
3228 | 3226 |
| |
| |||
3250 | 3248 |
| |
3251 | 3249 |
| |
3252 | 3250 |
| |
3253 |
| - | |
| 3251 | + | |
3254 | 3252 |
| |
3255 | 3253 |
| |
3256 | 3254 |
| |
|
Lines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
76 |
| - | |
| 76 | + | |
| 77 | + | |
77 | 78 |
| |
78 | 79 |
| |
79 | 80 |
| |
80 | 81 |
| |
81 | 82 |
| |
82 | 83 |
| |
83 | 84 |
| |
84 |
| - | |
| 85 | + | |
85 | 86 |
| |
86 | 87 |
| |
87 | 88 |
| |
| |||
116 | 117 |
| |
117 | 118 |
| |
118 | 119 |
| |
119 |
| - | |
| 120 | + | |
| 121 | + | |
120 | 122 |
| |
121 | 123 |
| |
122 | 124 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
99 | 99 |
| |
100 | 100 |
| |
101 | 101 |
| |
102 |
| - | |
| 102 | + | |
| 103 | + | |
103 | 104 |
| |
104 | 105 |
| |
105 | 106 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
119 | 119 |
| |
120 | 120 |
| |
121 | 121 |
| |
122 |
| - | |
123 |
| - | |
| 122 | + | |
| 123 | + | |
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
252 | 252 |
| |
253 | 253 |
| |
254 | 254 |
| |
255 |
| - | |
256 |
| - | |
| 255 | + | |
257 | 256 |
| |
258 | 257 |
| |
259 | 258 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
| 35 | + | |
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
|
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 |
| - | |
39 |
| - | |
40 |
| - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
|
Lines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
271 | 271 |
| |
272 | 272 |
| |
273 | 273 |
| |
274 |
| - | |
275 |
| - | |
276 |
| - | |
| 274 | + | |
277 | 275 |
| |
278 | 276 |
| |
279 | 277 |
| |
|
Lines changed: 34 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
199 | 199 |
| |
200 | 200 |
| |
201 | 201 |
| |
202 |
| - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
203 | 208 |
| |
204 | 209 |
| |
205 | 210 |
| |
| |||
224 | 229 |
| |
225 | 230 |
| |
226 | 231 |
| |
227 |
| - | |
228 |
| - | |
229 |
| - | |
230 |
| - | |
231 |
| - | |
232 |
| - | |
233 |
| - | |
234 |
| - | |
235 |
| - | |
236 | 232 |
| |
237 | 233 |
| |
238 | 234 |
| |
| |||
329 | 325 |
| |
330 | 326 |
| |
331 | 327 |
| |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
332 | 356 |
| |
333 | 357 |
| |
334 | 358 |
| |
|
Lines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2538 | 2538 |
| |
2539 | 2539 |
| |
2540 | 2540 |
| |
2541 |
| - | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
2542 | 2544 |
| |
2543 | 2545 |
| |
2544 | 2546 |
| |
| |||
2553 | 2555 |
| |
2554 | 2556 |
| |
2555 | 2557 |
| |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
2556 | 2564 |
| |
2557 | 2565 |
| |
2558 | 2566 |
| |
|
0 commit comments
Comments
(0)