forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2b65de7
committed
Remove misguided SSL key file ownership check in libpq.
Commitsa59c795 et al. tried to sync libpq's SSL key filepermissions checks with what we've used for years in the backend.We did not intend to create any new failure cases, but it turns outwe did: restricting the key file's ownership breaks cases where theclient is allowed to read a key file despite not having the identicalUID. In particular a client running as root used to be able to readsomeone else's key file; and having seen that I suspect that there areother, less-dubious use cases that this restriction breaks on someplatforms.We don't really need an ownership check, since if we can read the keyfile despite its having restricted permissions, it must have the rightownership --- under normal conditions anyway, and the point of thispatch is that any additional corner cases where that works should bedeemed allowable, as they have been historically. Hence, just dropthe ownership check, and rearrange the permissions check to get ridof its faulty assumption that geteuid() can't be zero. (Note that thecomparable backend-side code doesn't have to cater for geteuid() == 0,since the server rejects that very early on.)This does have the end result that the permissions safety check usedfor a root user's private key file is weaker than that used foranyone else's. While odd, root really ought to know what she's doingwith file permissions, so I think this is acceptable.Per report from Yogendra Suralkar. Like the previous patch,back-patch to all supported branches.Discussion:https://postgr.es/m/MW3PR15MB3931DF96896DC36D21AFD47CA3D39@MW3PR15MB3931.namprd15.prod.outlook.com1 parentce21a36 commit2b65de7
File tree
2 files changed
+20
-19
lines changed- src
- backend/libpq
- interfaces/libpq
2 files changed
+20
-19
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
160 | 160 |
| |
161 | 161 |
| |
162 | 162 |
| |
163 |
| - | |
| 163 | + | |
164 | 164 |
| |
165 |
| - | |
| 165 | + | |
| 166 | + | |
166 | 167 |
| |
167 | 168 |
| |
168 | 169 |
| |
|
Lines changed: 17 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1373 | 1373 |
| |
1374 | 1374 |
| |
1375 | 1375 |
| |
1376 |
| - | |
1377 |
| - | |
1378 |
| - | |
1379 |
| - | |
1380 |
| - | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
1381 | 1383 |
| |
1382 |
| - | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
1383 | 1389 |
| |
1384 |
| - | |
| 1390 | + | |
| 1391 | + | |
1385 | 1392 |
| |
1386 | 1393 |
| |
1387 | 1394 |
| |
1388 | 1395 |
| |
1389 | 1396 |
| |
1390 | 1397 |
| |
1391 |
| - | |
1392 |
| - | |
1393 |
| - | |
1394 |
| - | |
1395 |
| - | |
1396 |
| - | |
1397 |
| - | |
1398 |
| - | |
1399 |
| - | |
1400 |
| - | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
1401 | 1401 |
| |
1402 | 1402 |
| |
1403 | 1403 |
| |
|
0 commit comments
Comments
(0)