forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit67a472d
committed
Remove arbitrary restrictions on password length.
This patch started out with the goal of harmonizing various arbitrarylimits on password length, but after awhile a better idea emerged:let's just get rid of those fixed limits.recv_password_packet() has an arbitrary limit on the packet size,which we don't really need, so just drop it. (Note that this doesn'treally affect anything for MD5 or SCRAM password verification, sincethose will hash the user's password to something shorter anyway.It does matter for auth methods that require a cleartext password.)Likewise remove the arbitrary error condition in pg_saslprep().The remaining limits are mostly in client-side code that promptsfor passwords. To improve those, refactor simple_prompt() so thatit allocates its own result buffer that can be made as big asnecessary. Actually, it proves best to make a separate routinepg_get_line() that has essentially the semantics of fgets(), exceptthat it allocates a suitable result buffer and hence will neverreturn a truncated line. (pg_get_line has a lot of potentialapplications to replace randomly-sized fgets buffers elsewhere,but I'll leave that for another patch.)I built pg_get_line() atop stringinfo.c, which requires movingthat code to src/common/; but that seems fine since it was a poorfit for src/port/ anyway.This patch is mostly mine, but it owes a good deal to Nathan Bossartwho pressed for a solution to the password length problem andcreated a predecessor patch. Also thanks to Peter Eisentraut andStephen Frost for ideas and discussion.Discussion:https://postgr.es/m/09512C4F-8CB9-4021-B455-EF4C4F0D55A0@amazon.com1 parentbe4b0c0 commit67a472d
File tree
21 files changed
+221
-167
lines changed- contrib
- oid2name
- vacuumlo
- src
- backend/libpq
- bin
- initdb
- pg_basebackup
- pg_dump
- pgbench
- psql
- scripts
- common
- include
- common
- port
- tools/msvc
21 files changed
+221
-167
lines changedLines changed: 5 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| 15 | + | |
15 | 16 |
| |
16 | 17 |
| |
17 | 18 |
| |
| |||
293 | 294 |
| |
294 | 295 |
| |
295 | 296 |
| |
296 |
| - | |
297 |
| - | |
| 297 | + | |
298 | 298 |
| |
299 | 299 |
| |
300 | 300 |
| |
| |||
316 | 316 |
| |
317 | 317 |
| |
318 | 318 |
| |
319 |
| - | |
| 319 | + | |
320 | 320 |
| |
321 | 321 |
| |
322 | 322 |
| |
| |||
336 | 336 |
| |
337 | 337 |
| |
338 | 338 |
| |
339 |
| - | |
| 339 | + | |
340 | 340 |
| |
341 | 341 |
| |
342 |
| - | |
343 |
| - | |
| 342 | + | |
344 | 343 |
| |
345 | 344 |
| |
346 | 345 |
| |
|
Lines changed: 7 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
27 | 28 |
| |
28 | 29 |
| |
29 | 30 |
| |
| |||
69 | 70 |
| |
70 | 71 |
| |
71 | 72 |
| |
72 |
| - | |
73 |
| - | |
| 73 | + | |
74 | 74 |
| |
75 | 75 |
| |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
| 76 | + | |
| 77 | + | |
81 | 78 |
| |
82 | 79 |
| |
83 | 80 |
| |
| |||
97 | 94 |
| |
98 | 95 |
| |
99 | 96 |
| |
100 |
| - | |
| 97 | + | |
101 | 98 |
| |
102 | 99 |
| |
103 | 100 |
| |
| |||
115 | 112 |
| |
116 | 113 |
| |
117 | 114 |
| |
118 |
| - | |
| 115 | + | |
119 | 116 |
| |
120 | 117 |
| |
121 | 118 |
| |
122 |
| - | |
123 |
| - | |
| 119 | + | |
124 | 120 |
| |
125 | 121 |
| |
126 | 122 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
698 | 698 |
| |
699 | 699 |
| |
700 | 700 |
| |
701 |
| - | |
| 701 | + | |
702 | 702 |
| |
703 | 703 |
| |
704 | 704 |
| |
|
Lines changed: 11 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
| 70 | + | |
70 | 71 |
| |
71 | 72 |
| |
72 | 73 |
| |
| |||
1481 | 1482 |
| |
1482 | 1483 |
| |
1483 | 1484 |
| |
1484 |
| - | |
1485 |
| - | |
| 1485 | + | |
1486 | 1486 |
| |
1487 | 1487 |
| |
1488 | 1488 |
| |
1489 | 1489 |
| |
1490 | 1490 |
| |
1491 | 1491 |
| |
| 1492 | + | |
| 1493 | + | |
1492 | 1494 |
| |
1493 | 1495 |
| |
1494 |
| - | |
1495 |
| - | |
| 1496 | + | |
| 1497 | + | |
1496 | 1498 |
| |
1497 | 1499 |
| |
1498 | 1500 |
| |
1499 | 1501 |
| |
1500 | 1502 |
| |
| 1503 | + | |
1501 | 1504 |
| |
1502 | 1505 |
| |
1503 | 1506 |
| |
| |||
1510 | 1513 |
| |
1511 | 1514 |
| |
1512 | 1515 |
| |
1513 |
| - | |
1514 | 1516 |
| |
1515 | 1517 |
| |
1516 | 1518 |
| |
1517 | 1519 |
| |
1518 | 1520 |
| |
1519 | 1521 |
| |
1520 | 1522 |
| |
1521 |
| - | |
| 1523 | + | |
| 1524 | + | |
1522 | 1525 |
| |
1523 | 1526 |
| |
1524 | 1527 |
| |
| |||
1530 | 1533 |
| |
1531 | 1534 |
| |
1532 | 1535 |
| |
1533 |
| - | |
1534 |
| - | |
1535 |
| - | |
| 1536 | + | |
1536 | 1537 |
| |
1537 | 1538 |
| |
1538 |
| - | |
| 1539 | + | |
1539 | 1540 |
| |
1540 | 1541 |
| |
1541 | 1542 |
| |
|
Lines changed: 7 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| 25 | + | |
25 | 26 |
| |
26 | 27 |
| |
27 | 28 |
| |
| |||
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
52 |
| - | |
53 |
| - | |
| 53 | + | |
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
| |||
150 | 150 |
| |
151 | 151 |
| |
152 | 152 |
| |
153 |
| - | |
| 153 | + | |
154 | 154 |
| |
155 | 155 |
| |
156 | 156 |
| |
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
160 |
| - | |
161 |
| - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
162 | 163 |
| |
163 | 164 |
| |
164 | 165 |
| |
165 | 166 |
| |
166 |
| - | |
| 167 | + | |
167 | 168 |
| |
168 | 169 |
| |
169 | 170 |
| |
|
Lines changed: 14 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
| |||
122 | 123 |
| |
123 | 124 |
| |
124 | 125 |
| |
125 |
| - | |
126 | 126 |
| |
127 | 127 |
| |
128 | 128 |
| |
| |||
141 | 141 |
| |
142 | 142 |
| |
143 | 143 |
| |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
| 144 | + | |
148 | 145 |
| |
149 | 146 |
| |
150 | 147 |
| |
| |||
191 | 188 |
| |
192 | 189 |
| |
193 | 190 |
| |
194 |
| - | |
195 |
| - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
196 | 194 |
| |
197 | 195 |
| |
198 | 196 |
| |
| |||
201 | 199 |
| |
202 | 200 |
| |
203 | 201 |
| |
| 202 | + | |
| 203 | + | |
| 204 | + | |
204 | 205 |
| |
205 | 206 |
| |
206 | 207 |
| |
| |||
242 | 243 |
| |
243 | 244 |
| |
244 | 245 |
| |
245 |
| - | |
246 | 246 |
| |
247 | 247 |
| |
248 | 248 |
| |
| |||
251 | 251 |
| |
252 | 252 |
| |
253 | 253 |
| |
254 |
| - | |
255 |
| - | |
256 |
| - | |
257 |
| - | |
| 254 | + | |
| 255 | + | |
258 | 256 |
| |
259 | 257 |
| |
260 | 258 |
| |
| |||
293 | 291 |
| |
294 | 292 |
| |
295 | 293 |
| |
296 |
| - | |
297 |
| - | |
| 294 | + | |
298 | 295 |
| |
299 | 296 |
| |
300 | 297 |
| |
| |||
309 | 306 |
| |
310 | 307 |
| |
311 | 308 |
| |
| 309 | + | |
| 310 | + | |
| 311 | + | |
312 | 312 |
| |
313 | 313 |
| |
314 | 314 |
| |
|
Lines changed: 7 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
| 24 | + | |
24 | 25 |
| |
25 | 26 |
| |
26 | 27 |
| |
| |||
1643 | 1644 |
| |
1644 | 1645 |
| |
1645 | 1646 |
| |
1646 |
| - | |
1647 |
| - | |
| 1647 | + | |
1648 | 1648 |
| |
1649 |
| - | |
1650 |
| - | |
1651 |
| - | |
1652 |
| - | |
1653 |
| - | |
| 1649 | + | |
| 1650 | + | |
1654 | 1651 |
| |
1655 | 1652 |
| |
1656 | 1653 |
| |
| |||
1730 | 1727 |
| |
1731 | 1728 |
| |
1732 | 1729 |
| |
1733 |
| - | |
| 1730 | + | |
1734 | 1731 |
| |
1735 | 1732 |
| |
1736 | 1733 |
| |
| |||
1757 | 1754 |
| |
1758 | 1755 |
| |
1759 | 1756 |
| |
1760 |
| - | |
| 1757 | + | |
1761 | 1758 |
| |
1762 | 1759 |
| |
1763 | 1760 |
| |
1764 |
| - | |
1765 |
| - | |
| 1761 | + | |
1766 | 1762 |
| |
1767 | 1763 |
| |
1768 | 1764 |
| |
|
Lines changed: 5 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| 62 | + | |
62 | 63 |
| |
63 | 64 |
| |
64 | 65 |
| |
| |||
1174 | 1175 |
| |
1175 | 1176 |
| |
1176 | 1177 |
| |
1177 |
| - | |
1178 |
| - | |
| 1178 | + | |
1179 | 1179 |
| |
1180 | 1180 |
| |
1181 | 1181 |
| |
| |||
1195 | 1195 |
| |
1196 | 1196 |
| |
1197 | 1197 |
| |
1198 |
| - | |
| 1198 | + | |
1199 | 1199 |
| |
1200 | 1200 |
| |
1201 | 1201 |
| |
| |||
1215 | 1215 |
| |
1216 | 1216 |
| |
1217 | 1217 |
| |
1218 |
| - | |
| 1218 | + | |
1219 | 1219 |
| |
1220 | 1220 |
| |
1221 |
| - | |
1222 |
| - | |
| 1221 | + | |
1223 | 1222 |
| |
1224 | 1223 |
| |
1225 | 1224 |
| |
|
0 commit comments
Comments
(0)