forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit9c59e48
committed
Ensure that all temp files made during pg_upgrade are non-world-readable.
pg_upgrade has always attempted to ensure that the transient dump filesit creates are inaccessible except to the owner. However, refactoringin commit76a7650 broke that for the file containing "pg_dumpall -g"output; since then, that file was protected according to the process'sdefault umask. Since that file may contain role passwords (hopefullyencrypted, but passwords nonetheless), this is a particularly unfortunateoversight. Prudent users of pg_upgrade on multiuser systems wouldprobably run it under a umask tight enough that the issue is moot, butperhaps some users are depending only on pg_upgrade's umask changes toprotect their data.To fix this in a future-proof way, let's just tighten the umask atprocess start. There are no files pg_upgrade needs to write at aweaker security level; and if there were, transiently relaxing theumask around where they're created would be a safer approach.Report and patch by Tom Lane; the idea for the fix is due to Noah Misch.Back-patch to all supported branches.Security:CVE-2018-10531 parentb76aa1f commit9c59e48
4 files changed
+6
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 35 | | |
44 | 36 | | |
45 | 37 | | |
| |||
74 | 66 | | |
75 | 67 | | |
76 | 68 | | |
77 | | - | |
78 | | - | |
79 | 69 | | |
80 | 70 | | |
81 | 71 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
389 | 391 | | |
390 | 392 | | |
391 | 393 | | |
| |||
0 commit comments
Comments
(0)