- Notifications
You must be signed in to change notification settings - Fork5.2k
Commitccacaf4
committed
Fix inconsistent quoting of role names in ACLs.
getid() and putid(), which parse and deparse role names within ACLinput/output, applied isalnum() to see if a character within a rolename requires quoting. They did this even for non-ASCII characters,which is problematic because the results would depend on encoding,locale, and perhaps even platform. So it's possible that putid()could elect not to quote some string that, later in some otherenvironment, getid() will decide is not a valid identifier, causingdump/reload or similar failures.To fix this in a way that won't risk interoperability problemswith unpatched versions, make getid() treat any non-ASCII as alegitimate identifier character (hence not requiring quotes),while making putid() treat any non-ASCII as requiring quoting.We could remove the resulting excess quoting once we feel thatno unpatched servers remain in the wild, but that'll be years.A lesser problem is that getid() did the wrong thing with an inputconsisting of just two double quotes (""). That has to represent anempty string, but getid() read it as a single double quote instead.The case cannot arise in the normal course of events, since we don'tallow empty-string role names. But let's fix it while we're here.Although we've not heard field reports of problems with non-ASCIIrole names, there's clearly a hazard there, so back-patch to allsupported versions.Reported-by: Peter Eisentraut <peter@eisentraut.org>Author: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/3792884.1751492172@sss.pgh.pa.usBackpatch-through: 131 parent3d23f68 commitccacaf4
File tree
3 files changed
+53
-8
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+53
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
137 | 153 | | |
138 | 154 | | |
139 | 155 | | |
| |||
159 | 175 | | |
160 | 176 | | |
161 | 177 | | |
162 | | - | |
163 | 178 | | |
164 | 179 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 180 | + | |
169 | 181 | | |
170 | 182 | | |
171 | 183 | | |
172 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
173 | 190 | | |
174 | 191 | | |
175 | 192 | | |
176 | | - | |
| 193 | + | |
177 | 194 | | |
178 | 195 | | |
179 | 196 | | |
| |||
207 | 224 | | |
208 | 225 | | |
209 | 226 | | |
| 227 | + | |
210 | 228 | | |
211 | 229 | | |
212 | | - | |
213 | | - | |
| 230 | + | |
214 | 231 | | |
215 | 232 | | |
216 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2568 | 2568 | | |
2569 | 2569 | | |
2570 | 2570 | | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
2571 | 2591 | | |
2572 | 2592 | | |
2573 | 2593 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1544 | 1544 | | |
1545 | 1545 | | |
1546 | 1546 | | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
1547 | 1555 | | |
1548 | 1556 | | |
1549 | 1557 | | |
| |||
0 commit comments
Comments
(0)