forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit59bd34c
committed
Fix bugs in manipulation of large objects.
In v16 and up (since commitafbfc02), large object ownershipchecking has been broken because object_ownercheck() didn't take careof the discrepancy between our object-address representation of largeobjects (classId == LargeObjectRelationId) and the catalog where theirownership info is actually stored (LargeObjectMetadataRelationId).This resulted in failures such as "unrecognized class ID: 2613"when trying to update blob properties as a non-superuser.Poking around for related bugs, I found that AlterObjectOwner_internalwould pass the wrong classId to the PostAlterHook in the no-op codepath where the large object already has the desired owner. Also,recordExtObjInitPriv checked for the wrong classId; that bug is onlylatent because the stanza is dead code anyway, but as long as we'recarrying it around it should be less wrong. These bugs are quite old.In HEAD, we can reduce the scope for future bugs of this ilk bychanging AlterObjectOwner_internal's API to let the translation happeninside that function, rather than requiring callers to know about it.A more bulletproof fix, perhaps, would be to start usingLargeObjectMetadataRelationId as the dependency and object-addressclassId for blobs. However that has substantial risk of breakingthird-party code; even within our own code, it'd create hasslesfor pg_dump which would have to cope with a version-dependentrepresentation. For now, keep the status quo.Discussion:https://postgr.es/m/2650449.1702497209@sss.pgh.pa.us1 parent0e91750 commit59bd34c
File tree
9 files changed
+54
-55
lines changed- src
- backend
- catalog
- commands
- libpq
- storage/large_object
- include/commands
- test/regress
- expected
- sql
9 files changed
+54
-55
lines changedLines changed: 7 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4103 | 4103 |
| |
4104 | 4104 |
| |
4105 | 4105 |
| |
| 4106 | + | |
| 4107 | + | |
| 4108 | + | |
| 4109 | + | |
4106 | 4110 |
| |
4107 | 4111 |
| |
4108 | 4112 |
| |
| 4113 | + | |
4109 | 4114 |
| |
4110 | 4115 |
| |
4111 | 4116 |
| |
| |||
4122 | 4127 |
| |
4123 | 4128 |
| |
4124 | 4129 |
| |
4125 |
| - | |
4126 | 4130 |
| |
4127 | 4131 |
| |
4128 | 4132 |
| |
| |||
4442 | 4446 |
| |
4443 | 4447 |
| |
4444 | 4448 |
| |
4445 |
| - | |
4446 |
| - | |
| 4449 | + | |
4447 | 4450 |
| |
| 4451 | + | |
4448 | 4452 |
| |
4449 | 4453 |
| |
4450 | 4454 |
| |
|
Lines changed: 3 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1614 | 1614 |
| |
1615 | 1615 |
| |
1616 | 1616 |
| |
1617 |
| - | |
1618 |
| - | |
1619 |
| - | |
1620 |
| - | |
1621 |
| - | |
1622 |
| - | |
1623 |
| - | |
1624 |
| - | |
1625 |
| - | |
1626 |
| - | |
1627 |
| - | |
1628 |
| - | |
1629 |
| - | |
1630 |
| - | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
1631 | 1620 |
| |
1632 | 1621 |
| |
1633 | 1622 |
| |
|
Lines changed: 22 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
918 | 918 |
| |
919 | 919 |
| |
920 | 920 |
| |
921 |
| - | |
922 | 921 |
| |
923 |
| - | |
924 | 922 |
| |
925 | 923 |
| |
926 | 924 |
| |
| |||
929 | 927 |
| |
930 | 928 |
| |
931 | 929 |
| |
932 |
| - | |
933 | 930 |
| |
934 |
| - | |
935 |
| - | |
936 |
| - | |
937 |
| - | |
938 |
| - | |
939 |
| - | |
940 |
| - | |
941 |
| - | |
942 |
| - | |
943 |
| - | |
944 |
| - | |
945 |
| - | |
| 931 | + | |
| 932 | + | |
946 | 933 |
| |
947 | 934 |
| |
948 | 935 |
| |
| |||
960 | 947 |
| |
961 | 948 |
| |
962 | 949 |
| |
963 |
| - | |
| 950 | + | |
964 | 951 |
| |
965 | 952 |
| |
| 953 | + | |
| 954 | + | |
| 955 | + | |
966 | 956 |
| |
967 | 957 |
| |
968 |
| - | |
| 958 | + | |
969 | 959 |
| |
970 |
| - | |
971 |
| - | |
972 |
| - | |
973 |
| - | |
974 |
| - | |
975 |
| - | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
976 | 968 |
| |
977 | 969 |
| |
978 | 970 |
| |
979 | 971 |
| |
980 | 972 |
| |
981 | 973 |
| |
| 974 | + | |
| 975 | + | |
982 | 976 |
| |
983 | 977 |
| |
984 | 978 |
| |
| |||
1026 | 1020 |
| |
1027 | 1021 |
| |
1028 | 1022 |
| |
1029 |
| - | |
| 1023 | + | |
| 1024 | + | |
1030 | 1025 |
| |
1031 | 1026 |
| |
1032 | 1027 |
| |
| |||
1079 | 1074 |
| |
1080 | 1075 |
| |
1081 | 1076 |
| |
1082 |
| - | |
1083 |
| - | |
1084 | 1077 |
| |
1085 | 1078 |
| |
1086 | 1079 |
| |
| |||
1089 | 1082 |
| |
1090 | 1083 |
| |
1091 | 1084 |
| |
| 1085 | + | |
1092 | 1086 |
| |
| 1087 | + | |
| 1088 | + | |
1093 | 1089 |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
46 |
| - | |
| 46 | + | |
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
| |||
323 | 323 |
| |
324 | 324 |
| |
325 | 325 |
| |
326 |
| - | |
| 326 | + | |
327 | 327 |
| |
328 | 328 |
| |
329 | 329 |
| |
|
Lines changed: 4 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
221 | 221 |
| |
222 | 222 |
| |
223 | 223 |
| |
224 |
| - | |
225 |
| - | |
226 |
| - | |
227 |
| - | |
228 |
| - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
229 | 228 |
| |
230 | 229 |
| |
231 | 230 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
21 | 20 |
| |
22 | 21 |
| |
23 | 22 |
| |
| |||
29 | 28 |
| |
30 | 29 |
| |
31 | 30 |
| |
32 |
| - | |
| 31 | + | |
33 | 32 |
| |
34 | 33 |
| |
35 | 34 |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
| 19 | + | |
18 | 20 |
| |
19 | 21 |
| |
| 22 | + | |
20 | 23 |
| |
21 | 24 |
| |
22 | 25 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
| 19 | + | |
18 | 20 |
| |
19 | 21 |
| |
| 22 | + | |
20 | 23 |
| |
21 | 24 |
| |
22 | 25 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 |
| |
17 | 21 |
| |
18 | 22 |
| |
| 23 | + | |
| 24 | + | |
19 | 25 |
| |
20 | 26 |
| |
21 | 27 |
| |
|
0 commit comments
Comments
(0)