forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf39ddd8
committed
Sanitize newlines in object names in "pg_restore -l" output.
Commits89e0bac et al replaced newlines with spaces in object namesprinted in SQL comments, but we neglected to consider that the samenames are also printed by "pg_restore -l", and a newline would renderthe output unparseable by "pg_restore -L". Apply the same replacementin "-l" output. Since "pg_restore -L" doesn't actually examine anyobject names, only the dump ID field that starts each line, this isenough to fix things for its purposes.The previous fix was treated as a security issue, and we might havedone that here as well, except that the issue was reported publiclyto start with. Anyway it's hard to see how this could be exploitedfor SQL injection; "pg_restore -L" doesn't do much with the fileexcept parse it for leading integers.Per bug #14587 from Milos Urbanek. Back-patch to all supported versions.Discussion:https://postgr.es/m/20170310155318.1425.30483@wrigleys.postgresql.org1 parent8b358b4 commitf39ddd8
1 file changed
+34
-5
lines changedLines changed: 34 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1104 | 1104 |
| |
1105 | 1105 |
| |
1106 | 1106 |
| |
1107 |
| - | |
| 1107 | + | |
| 1108 | + | |
1108 | 1109 |
| |
1109 | 1110 |
| |
1110 | 1111 |
| |
| |||
1142 | 1143 |
| |
1143 | 1144 |
| |
1144 | 1145 |
| |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
1145 | 1168 |
| |
1146 | 1169 |
| |
1147 |
| - | |
1148 |
| - | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1149 | 1177 |
| |
1150 | 1178 |
| |
1151 | 1179 |
| |
| |||
3531 | 3559 |
| |
3532 | 3560 |
| |
3533 | 3561 |
| |
3534 |
| - | |
3535 |
| - | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
3536 | 3565 |
| |
3537 | 3566 |
| |
3538 | 3567 |
| |
|
0 commit comments
Comments
(0)