pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Fix corner-case failures in has_foo_privilege() family of functi
7+ messages / 1 participants
[nested] [flat]
* pgsql: Fix corner-case failures in has_foo_privilege() family of functi
@ 2018-10-02 15:54 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 7+ messages in thread
From: Tom Lane @ 2018-10-02 15:54 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix corner-case failures in has_foo_privilege() family of functions.
The variants of these functions that take numeric inputs (OIDs or
column numbers) are supposed to return NULL rather than failing
on bad input; this rule reduces problems with snapshot skew when
queries apply the functions to all rows of a catalog.
has_column_privilege() had careless handling of the case where the
table OID didn't exist. You might get something like this:
select has_column_privilege(9999,'nosuchcol','select');
ERROR: column "nosuchcol" of relation "(null)" does not exist
or you might get a crash, depending on the platform's printf's response
to a null string pointer.
In addition, while applying the column-number variant to a dropped
column returned NULL as desired, applying the column-name variant
did not:
select has_column_privilege('mytable','........pg.dropped.2........','select');
ERROR: column "........pg.dropped.2........" of relation "mytable" does not exist
It seems better to make this case return NULL as well.
Also, the OID-accepting variants of has_foreign_data_wrapper_privilege,
has_server_privilege, and has_tablespace_privilege didn't follow the
principle of returning NULL for nonexistent OIDs. Superusers got TRUE,
everybody else got an error.
Per investigation of Jaime Casanova's report of a new crash in HEAD.
These behaviors have been like this for a long time, so back-patch to
all supported branches.
Patch by me; thanks to Stephen Frost for discussion and review
Discussion: https://postgr.es/m/CAJGNTeP=-6Gyqq5TN9OvYEydi7Fv1oGyYj650LGTnW44oAzYCg@mail.gmail.com
Branch
------
REL9_6_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/6d73983be61adde122b876308dbc6b6d52113419
Modified Files
--------------
src/backend/utils/adt/acl.c | 95 ++++++++++++++++++++++++++++----
src/test/regress/expected/privileges.out | 57 +++++++++++++++++++
src/test/regress/sql/privileges.sql | 17 ++++++
3 files changed, 159 insertions(+), 10 deletions(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix corner-case failures in has_foo_privilege() family of functi
@ 2018-10-02 15:54 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 7+ messages in thread
From: Tom Lane @ 2018-10-02 15:54 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix corner-case failures in has_foo_privilege() family of functions.
The variants of these functions that take numeric inputs (OIDs or
column numbers) are supposed to return NULL rather than failing
on bad input; this rule reduces problems with snapshot skew when
queries apply the functions to all rows of a catalog.
has_column_privilege() had careless handling of the case where the
table OID didn't exist. You might get something like this:
select has_column_privilege(9999,'nosuchcol','select');
ERROR: column "nosuchcol" of relation "(null)" does not exist
or you might get a crash, depending on the platform's printf's response
to a null string pointer.
In addition, while applying the column-number variant to a dropped
column returned NULL as desired, applying the column-name variant
did not:
select has_column_privilege('mytable','........pg.dropped.2........','select');
ERROR: column "........pg.dropped.2........" of relation "mytable" does not exist
It seems better to make this case return NULL as well.
Also, the OID-accepting variants of has_foreign_data_wrapper_privilege,
has_server_privilege, and has_tablespace_privilege didn't follow the
principle of returning NULL for nonexistent OIDs. Superusers got TRUE,
everybody else got an error.
Per investigation of Jaime Casanova's report of a new crash in HEAD.
These behaviors have been like this for a long time, so back-patch to
all supported branches.
Patch by me; thanks to Stephen Frost for discussion and review
Discussion: https://postgr.es/m/CAJGNTeP=-6Gyqq5TN9OvYEydi7Fv1oGyYj650LGTnW44oAzYCg@mail.gmail.com
Branch
------
REL9_3_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/01c7a87df98c2d012e321f38b070b99bddc54449
Modified Files
--------------
src/backend/utils/adt/acl.c | 95 ++++++++++++++++++++++++++++----
src/test/regress/expected/privileges.out | 57 +++++++++++++++++++
src/test/regress/sql/privileges.sql | 17 ++++++
3 files changed, 159 insertions(+), 10 deletions(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix corner-case failures in has_foo_privilege() family of functi
@ 2018-10-02 15:54 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 7+ messages in thread
From: Tom Lane @ 2018-10-02 15:54 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix corner-case failures in has_foo_privilege() family of functions.
The variants of these functions that take numeric inputs (OIDs or
column numbers) are supposed to return NULL rather than failing
on bad input; this rule reduces problems with snapshot skew when
queries apply the functions to all rows of a catalog.
has_column_privilege() had careless handling of the case where the
table OID didn't exist. You might get something like this:
select has_column_privilege(9999,'nosuchcol','select');
ERROR: column "nosuchcol" of relation "(null)" does not exist
or you might get a crash, depending on the platform's printf's response
to a null string pointer.
In addition, while applying the column-number variant to a dropped
column returned NULL as desired, applying the column-name variant
did not:
select has_column_privilege('mytable','........pg.dropped.2........','select');
ERROR: column "........pg.dropped.2........" of relation "mytable" does not exist
It seems better to make this case return NULL as well.
Also, the OID-accepting variants of has_foreign_data_wrapper_privilege,
has_server_privilege, and has_tablespace_privilege didn't follow the
principle of returning NULL for nonexistent OIDs. Superusers got TRUE,
everybody else got an error.
Per investigation of Jaime Casanova's report of a new crash in HEAD.
These behaviors have been like this for a long time, so back-patch to
all supported branches.
Patch by me; thanks to Stephen Frost for discussion and review
Discussion: https://postgr.es/m/CAJGNTeP=-6Gyqq5TN9OvYEydi7Fv1oGyYj650LGTnW44oAzYCg@mail.gmail.com
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/419cc8add5fb81331efbc7ea8862e08b981b7762
Modified Files
--------------
src/backend/utils/adt/acl.c | 95 ++++++++++++++++++++++++++++----
src/test/regress/expected/privileges.out | 57 +++++++++++++++++++
src/test/regress/sql/privileges.sql | 17 ++++++
3 files changed, 159 insertions(+), 10 deletions(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix corner-case failures in has_foo_privilege() family of functi
@ 2018-10-02 15:54 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 7+ messages in thread
From: Tom Lane @ 2018-10-02 15:54 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix corner-case failures in has_foo_privilege() family of functions.
The variants of these functions that take numeric inputs (OIDs or
column numbers) are supposed to return NULL rather than failing
on bad input; this rule reduces problems with snapshot skew when
queries apply the functions to all rows of a catalog.
has_column_privilege() had careless handling of the case where the
table OID didn't exist. You might get something like this:
select has_column_privilege(9999,'nosuchcol','select');
ERROR: column "nosuchcol" of relation "(null)" does not exist
or you might get a crash, depending on the platform's printf's response
to a null string pointer.
In addition, while applying the column-number variant to a dropped
column returned NULL as desired, applying the column-name variant
did not:
select has_column_privilege('mytable','........pg.dropped.2........','select');
ERROR: column "........pg.dropped.2........" of relation "mytable" does not exist
It seems better to make this case return NULL as well.
Also, the OID-accepting variants of has_foreign_data_wrapper_privilege,
has_server_privilege, and has_tablespace_privilege didn't follow the
principle of returning NULL for nonexistent OIDs. Superusers got TRUE,
everybody else got an error.
Per investigation of Jaime Casanova's report of a new crash in HEAD.
These behaviors have been like this for a long time, so back-patch to
all supported branches.
Patch by me; thanks to Stephen Frost for discussion and review
Discussion: https://postgr.es/m/CAJGNTeP=-6Gyqq5TN9OvYEydi7Fv1oGyYj650LGTnW44oAzYCg@mail.gmail.com
Branch
------
REL9_4_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/fd81fae67fa0a0b213bfc1bf6d058771c8ada8f2
Modified Files
--------------
src/backend/utils/adt/acl.c | 95 ++++++++++++++++++++++++++++----
src/test/regress/expected/privileges.out | 57 +++++++++++++++++++
src/test/regress/sql/privileges.sql | 17 ++++++
3 files changed, 159 insertions(+), 10 deletions(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix corner-case failures in has_foo_privilege() family of functi
@ 2018-10-02 15:54 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 7+ messages in thread
From: Tom Lane @ 2018-10-02 15:54 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix corner-case failures in has_foo_privilege() family of functions.
The variants of these functions that take numeric inputs (OIDs or
column numbers) are supposed to return NULL rather than failing
on bad input; this rule reduces problems with snapshot skew when
queries apply the functions to all rows of a catalog.
has_column_privilege() had careless handling of the case where the
table OID didn't exist. You might get something like this:
select has_column_privilege(9999,'nosuchcol','select');
ERROR: column "nosuchcol" of relation "(null)" does not exist
or you might get a crash, depending on the platform's printf's response
to a null string pointer.
In addition, while applying the column-number variant to a dropped
column returned NULL as desired, applying the column-name variant
did not:
select has_column_privilege('mytable','........pg.dropped.2........','select');
ERROR: column "........pg.dropped.2........" of relation "mytable" does not exist
It seems better to make this case return NULL as well.
Also, the OID-accepting variants of has_foreign_data_wrapper_privilege,
has_server_privilege, and has_tablespace_privilege didn't follow the
principle of returning NULL for nonexistent OIDs. Superusers got TRUE,
everybody else got an error.
Per investigation of Jaime Casanova's report of a new crash in HEAD.
These behaviors have been like this for a long time, so back-patch to
all supported branches.
Patch by me; thanks to Stephen Frost for discussion and review
Discussion: https://postgr.es/m/CAJGNTeP=-6Gyqq5TN9OvYEydi7Fv1oGyYj650LGTnW44oAzYCg@mail.gmail.com
Branch
------
REL9_5_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/dad4df0fc8a13a8b68f2537d91133be07562408f
Modified Files
--------------
src/backend/utils/adt/acl.c | 95 ++++++++++++++++++++++++++++----
src/test/regress/expected/privileges.out | 57 +++++++++++++++++++
src/test/regress/sql/privileges.sql | 17 ++++++
3 files changed, 159 insertions(+), 10 deletions(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix corner-case failures in has_foo_privilege() family of functi
@ 2018-10-02 15:54 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 7+ messages in thread
From: Tom Lane @ 2018-10-02 15:54 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix corner-case failures in has_foo_privilege() family of functions.
The variants of these functions that take numeric inputs (OIDs or
column numbers) are supposed to return NULL rather than failing
on bad input; this rule reduces problems with snapshot skew when
queries apply the functions to all rows of a catalog.
has_column_privilege() had careless handling of the case where the
table OID didn't exist. You might get something like this:
select has_column_privilege(9999,'nosuchcol','select');
ERROR: column "nosuchcol" of relation "(null)" does not exist
or you might get a crash, depending on the platform's printf's response
to a null string pointer.
In addition, while applying the column-number variant to a dropped
column returned NULL as desired, applying the column-name variant
did not:
select has_column_privilege('mytable','........pg.dropped.2........','select');
ERROR: column "........pg.dropped.2........" of relation "mytable" does not exist
It seems better to make this case return NULL as well.
Also, the OID-accepting variants of has_foreign_data_wrapper_privilege,
has_server_privilege, and has_tablespace_privilege didn't follow the
principle of returning NULL for nonexistent OIDs. Superusers got TRUE,
everybody else got an error.
Per investigation of Jaime Casanova's report of a new crash in HEAD.
These behaviors have been like this for a long time, so back-patch to
all supported branches.
Patch by me; thanks to Stephen Frost for discussion and review
Discussion: https://postgr.es/m/CAJGNTeP=-6Gyqq5TN9OvYEydi7Fv1oGyYj650LGTnW44oAzYCg@mail.gmail.com
Branch
------
REL_10_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/7eed72333731fabd0fc816c0dfbadebe6d7d3063
Modified Files
--------------
src/backend/utils/adt/acl.c | 95 ++++++++++++++++++++++++++++----
src/test/regress/expected/privileges.out | 57 +++++++++++++++++++
src/test/regress/sql/privileges.sql | 17 ++++++
3 files changed, 159 insertions(+), 10 deletions(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix corner-case failures in has_foo_privilege() family of functi
@ 2018-10-02 15:54 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 7+ messages in thread
From: Tom Lane @ 2018-10-02 15:54 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Fix corner-case failures in has_foo_privilege() family of functions.
The variants of these functions that take numeric inputs (OIDs or
column numbers) are supposed to return NULL rather than failing
on bad input; this rule reduces problems with snapshot skew when
queries apply the functions to all rows of a catalog.
has_column_privilege() had careless handling of the case where the
table OID didn't exist. You might get something like this:
select has_column_privilege(9999,'nosuchcol','select');
ERROR: column "nosuchcol" of relation "(null)" does not exist
or you might get a crash, depending on the platform's printf's response
to a null string pointer.
In addition, while applying the column-number variant to a dropped
column returned NULL as desired, applying the column-name variant
did not:
select has_column_privilege('mytable','........pg.dropped.2........','select');
ERROR: column "........pg.dropped.2........" of relation "mytable" does not exist
It seems better to make this case return NULL as well.
Also, the OID-accepting variants of has_foreign_data_wrapper_privilege,
has_server_privilege, and has_tablespace_privilege didn't follow the
principle of returning NULL for nonexistent OIDs. Superusers got TRUE,
everybody else got an error.
Per investigation of Jaime Casanova's report of a new crash in HEAD.
These behaviors have been like this for a long time, so back-patch to
all supported branches.
Patch by me; thanks to Stephen Frost for discussion and review
Discussion: https://postgr.es/m/CAJGNTeP=-6Gyqq5TN9OvYEydi7Fv1oGyYj650LGTnW44oAzYCg@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3d0f68dd30612db8d8cf6529455a369ad121c521
Modified Files
--------------
src/backend/utils/adt/acl.c | 95 ++++++++++++++++++++++++++++----
src/test/regress/expected/privileges.out | 57 +++++++++++++++++++
src/test/regress/sql/privileges.sql | 17 ++++++
3 files changed, 159 insertions(+), 10 deletions(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-10-02 15:54 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02 15:54 pgsql: Fix corner-case failures in has_foo_privilege() family of functi Tom Lane <tgl@sss.pgh.pa.us>
2018-10-02 15:54 pgsql: Fix corner-case failures in has_foo_privilege() family of functi Tom Lane <tgl@sss.pgh.pa.us>
2018-10-02 15:54 pgsql: Fix corner-case failures in has_foo_privilege() family of functi Tom Lane <tgl@sss.pgh.pa.us>
2018-10-02 15:54 pgsql: Fix corner-case failures in has_foo_privilege() family of functi Tom Lane <tgl@sss.pgh.pa.us>
2018-10-02 15:54 pgsql: Fix corner-case failures in has_foo_privilege() family of functi Tom Lane <tgl@sss.pgh.pa.us>
2018-10-02 15:54 pgsql: Fix corner-case failures in has_foo_privilege() family of functi Tom Lane <tgl@sss.pgh.pa.us>
2018-10-02 15:54 pgsql: Fix corner-case failures in has_foo_privilege() family of functi Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox