- Notifications
You must be signed in to change notification settings - Fork28
Commit6efc301
committed
Change libpq's internal uses of PQhost() to inspect host field directly.
Commit1944cdc changed PQhost() to return the hostaddr value when thatis specified and host isn't. This is a good idea in general, butfe-auth.c and related files contain PQhost() calls for which it isn't.Specifically, when we compare SSL certificates or other server identityinformation to the host field, we do not want to use hostaddr instead;that's not what's documented, that's not what happened pre-v10, andit doesn't seem like a good idea.Instead, we can just look at connhost[].host directly. This does whatwe want in v10 and up; in particular, if neither host nor hostaddrwere given, the host field will be replaced with the default host name.That seems useful, and it's likely the reason that these places werecoded to call PQhost() originally (since pre-v10, the stored field wasnot replaced with the default).Back-patch to v10, as1944cdc (just) was.Discussion:https://postgr.es/m/23287.1533227021@sss.pgh.pa.us1 parentdac7fe1 commit6efc301
2 files changed
+11
-4
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
199 | 199 |
| |
200 | 200 |
| |
201 | 201 |
| |
202 |
| - | |
| 202 | + | |
203 | 203 |
| |
204 | 204 |
| |
205 | 205 |
| |
| |||
414 | 414 |
| |
415 | 415 |
| |
416 | 416 |
| |
417 |
| - | |
| 417 | + | |
418 | 418 |
| |
419 | 419 |
| |
420 | 420 |
| |
|
Lines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
88 | 88 |
| |
89 | 89 |
| |
90 | 90 |
| |
91 |
| - | |
| 91 | + | |
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
95 | 102 |
| |
96 | 103 |
| |
97 | 104 |
| |
| |||
145 | 152 |
| |
146 | 153 |
| |
147 | 154 |
| |
148 |
| - | |
| 155 | + | |
149 | 156 |
| |
150 | 157 |
| |
151 | 158 |
| |
|
0 commit comments
Comments
(0)