forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbe4585b
committed
Replace use of credential control messages with getsockopt(LOCAL_PEERCRED).
It turns out the reason we hadn't found out about the portability issueswith our credential-control-message code is that almost no modern platformsuse that code at all; the ones that used to need it now offer getpeereid(),which we choose first. The last holdout was NetBSD, and they addedgetpeereid() as of 5.0. So far as I can tell, the only live platform onwhich that code was being exercised was Debian/kFreeBSD, ie, FreeBSD kernelwith Linux userland --- since glibc doesn't provide getpeereid(), we fellback to the control message code. However, the FreeBSD kernel provides aLOCAL_PEERCRED socket parameter that's functionally equivalent to Linux'sSO_PEERCRED. That is both much simpler to use than control messages, andsuperior because it doesn't require receiving a message from the other endat just the right time.Therefore, add code to use LOCAL_PEERCRED when necessary, and rip out allthe credential-control-message code in the backend. (libpq still has suchcode so that it can still talk to pre-9.1 servers ... but eventually we canget rid of it there too.) Clean up related autoconf probes, too.This means that libpq's requirepeer parameter now works on exactly the sameplatforms where the backend supports peer authentication, so adjust thedocumentation accordingly.1 parent13c00ae commitbe4585b
File tree
10 files changed
+119
-434
lines changed- doc/src/sgml
- src
- backend/libpq
- include
- interfaces/libpq
10 files changed
+119
-434
lines changedLines changed: 6 additions & 225 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9990 | 9990 |
| |
9991 | 9991 |
| |
9992 | 9992 |
| |
9993 |
| - | |
| 9993 | + | |
| 9994 | + | |
9994 | 9995 |
| |
9995 | 9996 |
| |
9996 | 9997 |
| |
| |||
17037 | 17038 |
| |
17038 | 17039 |
| |
17039 | 17040 |
| |
17040 |
| - | |
17041 |
| - | |
17042 | 17041 |
| |
| 17042 | + | |
17043 | 17043 |
| |
| 17044 | + | |
17044 | 17045 |
| |
17045 | 17046 |
| |
17046 | 17047 |
| |
| |||
17075 | 17076 |
| |
17076 | 17077 |
| |
17077 | 17078 |
| |
17078 |
| - | |
17079 |
| - | |
17080 | 17079 |
| |
| 17080 | + | |
17081 | 17081 |
| |
| 17082 | + | |
17082 | 17083 |
| |
17083 | 17084 |
| |
17084 | 17085 |
| |
| |||
17134 | 17135 |
| |
17135 | 17136 |
| |
17136 | 17137 |
| |
17137 |
| - | |
17138 |
| - | |
17139 |
| - | |
17140 |
| - | |
17141 |
| - | |
17142 |
| - | |
17143 |
| - | |
17144 |
| - | |
17145 |
| - | |
17146 |
| - | |
17147 |
| - | |
17148 |
| - | |
17149 |
| - | |
17150 |
| - | |
17151 |
| - | |
17152 |
| - | |
17153 |
| - | |
17154 |
| - | |
17155 |
| - | |
17156 |
| - | |
17157 |
| - | |
17158 |
| - | |
17159 |
| - | |
17160 |
| - | |
17161 |
| - | |
17162 |
| - | |
17163 |
| - | |
17164 |
| - | |
17165 |
| - | |
17166 |
| - | |
17167 |
| - | |
17168 |
| - | |
17169 |
| - | |
17170 |
| - | |
17171 |
| - | |
17172 |
| - | |
17173 |
| - | |
17174 |
| - | |
17175 |
| - | |
17176 |
| - | |
17177 |
| - | |
17178 |
| - | |
17179 |
| - | |
17180 |
| - | |
17181 |
| - | |
17182 |
| - | |
17183 |
| - | |
17184 |
| - | |
17185 |
| - | |
17186 |
| - | |
17187 |
| - | |
17188 |
| - | |
17189 |
| - | |
17190 |
| - | |
17191 |
| - | |
17192 |
| - | |
17193 |
| - | |
17194 |
| - | |
17195 |
| - | |
17196 |
| - | |
17197 |
| - | |
17198 |
| - | |
17199 |
| - | |
17200 |
| - | |
17201 |
| - | |
17202 |
| - | |
17203 |
| - | |
17204 |
| - | |
17205 |
| - | |
17206 |
| - | |
17207 |
| - | |
17208 |
| - | |
17209 |
| - | |
17210 |
| - | |
17211 |
| - | |
17212 |
| - | |
17213 |
| - | |
17214 |
| - | |
17215 |
| - | |
17216 |
| - | |
17217 |
| - | |
17218 |
| - | |
17219 |
| - | |
17220 |
| - | |
17221 |
| - | |
17222 |
| - | |
17223 |
| - | |
17224 |
| - | |
17225 |
| - | |
17226 |
| - | |
17227 |
| - | |
17228 |
| - | |
17229 |
| - | |
17230 |
| - | |
17231 |
| - | |
17232 |
| - | |
17233 |
| - | |
17234 |
| - | |
17235 |
| - | |
17236 |
| - | |
17237 |
| - | |
17238 |
| - | |
17239 |
| - | |
17240 |
| - | |
17241 |
| - | |
17242 |
| - | |
17243 |
| - | |
17244 |
| - | |
17245 |
| - | |
17246 |
| - | |
17247 |
| - | |
17248 |
| - | |
17249 |
| - | |
17250 |
| - | |
17251 |
| - | |
17252 |
| - | |
17253 |
| - | |
17254 |
| - | |
17255 |
| - | |
17256 |
| - | |
17257 |
| - | |
17258 |
| - | |
17259 |
| - | |
17260 |
| - | |
17261 |
| - | |
17262 |
| - | |
17263 |
| - | |
17264 |
| - | |
17265 |
| - | |
17266 |
| - | |
17267 |
| - | |
17268 |
| - | |
17269 |
| - | |
17270 |
| - | |
17271 |
| - | |
17272 |
| - | |
17273 |
| - | |
17274 |
| - | |
17275 |
| - | |
17276 |
| - | |
17277 |
| - | |
17278 |
| - | |
17279 |
| - | |
17280 |
| - | |
17281 |
| - | |
17282 |
| - | |
17283 |
| - | |
17284 |
| - | |
17285 |
| - | |
17286 |
| - | |
17287 |
| - | |
17288 |
| - | |
17289 |
| - | |
17290 |
| - | |
17291 |
| - | |
17292 |
| - | |
17293 |
| - | |
17294 |
| - | |
17295 |
| - | |
17296 |
| - | |
17297 |
| - | |
17298 |
| - | |
17299 |
| - | |
17300 |
| - | |
17301 |
| - | |
17302 |
| - | |
17303 |
| - | |
17304 |
| - | |
17305 |
| - | |
17306 |
| - | |
17307 |
| - | |
17308 |
| - | |
17309 |
| - | |
17310 |
| - | |
17311 |
| - | |
17312 |
| - | |
17313 |
| - | |
17314 |
| - | |
17315 |
| - | |
17316 |
| - | |
17317 |
| - | |
17318 |
| - | |
17319 |
| - | |
17320 |
| - | |
17321 |
| - | |
17322 |
| - | |
17323 |
| - | |
17324 |
| - | |
17325 |
| - | |
17326 |
| - | |
17327 |
| - | |
17328 |
| - | |
17329 |
| - | |
17330 |
| - | |
17331 |
| - | |
17332 |
| - | |
17333 |
| - | |
17334 |
| - | |
17335 |
| - | |
17336 |
| - | |
17337 |
| - | |
17338 |
| - | |
17339 |
| - | |
17340 |
| - | |
17341 |
| - | |
17342 |
| - | |
17343 |
| - | |
17344 |
| - | |
17345 |
| - | |
17346 |
| - | |
17347 |
| - | |
17348 |
| - | |
17349 |
| - | |
17350 |
| - | |
17351 |
| - | |
17352 |
| - | |
17353 |
| - | |
17354 |
| - | |
17355 |
| - | |
17356 |
| - | |
17357 | 17138 |
| |
17358 | 17139 |
| |
17359 | 17140 |
| |
|
Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
984 | 984 |
| |
985 | 985 |
| |
986 | 986 |
| |
987 |
| - | |
| 987 | + | |
988 | 988 |
| |
989 | 989 |
| |
990 | 990 |
| |
| |||
1125 | 1125 |
| |
1126 | 1126 |
| |
1127 | 1127 |
| |
1128 |
| - | |
1129 |
| - | |
1130 |
| - | |
1131 |
| - | |
1132 |
| - | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1133 | 1133 |
| |
1134 | 1134 |
| |
1135 | 1135 |
| |
|
Lines changed: 12 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
51 |
| - | |
| 51 | + | |
| 52 | + | |
52 | 53 |
| |
53 | 54 |
| |
54 | 55 |
| |
| |||
472 | 473 |
| |
473 | 474 |
| |
474 | 475 |
| |
475 |
| - | |
476 |
| - | |
| 476 | + | |
| 477 | + | |
477 | 478 |
| |
478 | 479 |
| |
479 | 480 |
| |
| |||
1304 | 1305 |
| |
1305 | 1306 |
| |
1306 | 1307 |
| |
1307 |
| - | |
| 1308 | + | |
1308 | 1309 |
| |
1309 | 1310 |
| |
1310 | 1311 |
| |
| |||
1323 | 1324 |
| |
1324 | 1325 |
| |
1325 | 1326 |
| |
1326 |
| - | |
1327 |
| - | |
1328 |
| - | |
1329 |
| - | |
1330 |
| - | |
1331 |
| - | |
1332 |
| - | |
1333 |
| - | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
1334 | 1334 |
| |
1335 | 1335 |
| |
1336 | 1336 |
| |
|
Lines changed: 15 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
549 | 549 |
| |
550 | 550 |
| |
551 | 551 |
| |
552 |
| - | |
553 |
| - | |
554 |
| - | |
555 |
| - | |
556 |
| - | |
557 |
| - | |
558 |
| - | |
559 |
| - | |
560 |
| - | |
561 |
| - | |
562 |
| - | |
563 |
| - | |
564 |
| - | |
565 |
| - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
566 | 567 |
| |
567 | 568 |
| |
568 | 569 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
314 | 314 |
| |
315 | 315 |
| |
316 | 316 |
| |
| 317 | + | |
| 318 | + | |
317 | 319 |
| |
318 | 320 |
| |
319 | 321 |
| |
|
0 commit comments
Comments
(0)