pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix error case for CREATE ROLE ... IN ROLE.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix error case for CREATE ROLE ... IN ROLE.
@ 2020-04-25 04:21  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Andrew Gierth @ 2020-04-25 04:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix error case for CREATE ROLE ... IN ROLE.

CreateRole() was passing a Value node, not a RoleSpec node, for the
newly-created role name when adding the role as a member of existing
roles for the IN ROLE syntax.

This mistake went unnoticed because the node in question is used only
for error messages and is not accessed on non-error paths.

In older pg versions (such as 9.5 where this was found), this results
in an "unexpected node type" error in place of the real error. That
node type check was removed at some point, after which the code would
accidentally fail to fail on 64-bit platforms (on which accessing the
Value node as if it were a RoleSpec would be mostly harmless) or give
an "unexpected role type" error on 32-bit platforms.

Fix the code to pass the correct node type, and add an lfirst_node
assertion just in case.

Per report on irc from user m1chelangelo.

Backpatch all the way, because this error has been around for a long
time.

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/287f6d2d96ddca279518348f88667d9ef10028b5

Modified Files
--------------
src/backend/commands/user.c | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix error case for CREATE ROLE ... IN ROLE.
@ 2020-04-25 04:21  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Andrew Gierth @ 2020-04-25 04:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix error case for CREATE ROLE ... IN ROLE.

CreateRole() was passing a Value node, not a RoleSpec node, for the
newly-created role name when adding the role as a member of existing
roles for the IN ROLE syntax.

This mistake went unnoticed because the node in question is used only
for error messages and is not accessed on non-error paths.

In older pg versions (such as 9.5 where this was found), this results
in an "unexpected node type" error in place of the real error. That
node type check was removed at some point, after which the code would
accidentally fail to fail on 64-bit platforms (on which accessing the
Value node as if it were a RoleSpec would be mostly harmless) or give
an "unexpected role type" error on 32-bit platforms.

Fix the code to pass the correct node type, and add an lfirst_node
assertion just in case.

Per report on irc from user m1chelangelo.

Backpatch all the way, because this error has been around for a long
time.

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b3824ca221223afedc2976f0577cf58dfa8a9804

Modified Files
--------------
src/backend/commands/user.c | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix error case for CREATE ROLE ... IN ROLE.
@ 2020-04-25 04:21  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Andrew Gierth @ 2020-04-25 04:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix error case for CREATE ROLE ... IN ROLE.

CreateRole() was passing a Value node, not a RoleSpec node, for the
newly-created role name when adding the role as a member of existing
roles for the IN ROLE syntax.

This mistake went unnoticed because the node in question is used only
for error messages and is not accessed on non-error paths.

In older pg versions (such as 9.5 where this was found), this results
in an "unexpected node type" error in place of the real error. That
node type check was removed at some point, after which the code would
accidentally fail to fail on 64-bit platforms (on which accessing the
Value node as if it were a RoleSpec would be mostly harmless) or give
an "unexpected role type" error on 32-bit platforms.

Fix the code to pass the correct node type, and add an lfirst_node
assertion just in case.

Per report on irc from user m1chelangelo.

Backpatch all the way, because this error has been around for a long
time.

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/86b7a4e6fd7db56022bf49b1c7eb482fdfddf8e5

Modified Files
--------------
src/backend/commands/user.c | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix error case for CREATE ROLE ... IN ROLE.
@ 2020-04-25 04:21  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Andrew Gierth @ 2020-04-25 04:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix error case for CREATE ROLE ... IN ROLE.

CreateRole() was passing a Value node, not a RoleSpec node, for the
newly-created role name when adding the role as a member of existing
roles for the IN ROLE syntax.

This mistake went unnoticed because the node in question is used only
for error messages and is not accessed on non-error paths.

In older pg versions (such as 9.5 where this was found), this results
in an "unexpected node type" error in place of the real error. That
node type check was removed at some point, after which the code would
accidentally fail to fail on 64-bit platforms (on which accessing the
Value node as if it were a RoleSpec would be mostly harmless) or give
an "unexpected role type" error on 32-bit platforms.

Fix the code to pass the correct node type, and add an lfirst_node
assertion just in case.

Per report on irc from user m1chelangelo.

Backpatch all the way, because this error has been around for a long
time.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d9a4cce29d563e4e6f6eec8b807736d98b1ad553

Modified Files
--------------
src/backend/commands/user.c | 37 ++++++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix error case for CREATE ROLE ... IN ROLE.
@ 2020-04-25 04:21  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Andrew Gierth @ 2020-04-25 04:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix error case for CREATE ROLE ... IN ROLE.

CreateRole() was passing a Value node, not a RoleSpec node, for the
newly-created role name when adding the role as a member of existing
roles for the IN ROLE syntax.

This mistake went unnoticed because the node in question is used only
for error messages and is not accessed on non-error paths.

In older pg versions (such as 9.5 where this was found), this results
in an "unexpected node type" error in place of the real error. That
node type check was removed at some point, after which the code would
accidentally fail to fail on 64-bit platforms (on which accessing the
Value node as if it were a RoleSpec would be mostly harmless) or give
an "unexpected role type" error on 32-bit platforms.

Fix the code to pass the correct node type, and add an lfirst_node
assertion just in case.

Per report on irc from user m1chelangelo.

Backpatch all the way, because this error has been around for a long
time.

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d0360632d39fca05f6f6e13e98184e72d44c6b3a

Modified Files
--------------
src/backend/commands/user.c | 37 ++++++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix error case for CREATE ROLE ... IN ROLE.
@ 2020-04-25 04:21  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Andrew Gierth @ 2020-04-25 04:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix error case for CREATE ROLE ... IN ROLE.

CreateRole() was passing a Value node, not a RoleSpec node, for the
newly-created role name when adding the role as a member of existing
roles for the IN ROLE syntax.

This mistake went unnoticed because the node in question is used only
for error messages and is not accessed on non-error paths.

In older pg versions (such as 9.5 where this was found), this results
in an "unexpected node type" error in place of the real error. That
node type check was removed at some point, after which the code would
accidentally fail to fail on 64-bit platforms (on which accessing the
Value node as if it were a RoleSpec would be mostly harmless) or give
an "unexpected role type" error on 32-bit platforms.

Fix the code to pass the correct node type, and add an lfirst_node
assertion just in case.

Per report on irc from user m1chelangelo.

Backpatch all the way, because this error has been around for a long
time.

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0f4970d1a9b97f7d57cb3dc281532e6034c4ca48

Modified Files
--------------
src/backend/commands/user.c | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2020-04-25 04:21 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25 04:21 pgsql: Fix error case for CREATE ROLE ... IN ROLE. Andrew Gierth <rhodiumtoad@postgresql.org>
2020-04-25 04:21 pgsql: Fix error case for CREATE ROLE ... IN ROLE. Andrew Gierth <rhodiumtoad@postgresql.org>
2020-04-25 04:21 pgsql: Fix error case for CREATE ROLE ... IN ROLE. Andrew Gierth <rhodiumtoad@postgresql.org>
2020-04-25 04:21 pgsql: Fix error case for CREATE ROLE ... IN ROLE. Andrew Gierth <rhodiumtoad@postgresql.org>
2020-04-25 04:21 pgsql: Fix error case for CREATE ROLE ... IN ROLE. Andrew Gierth <rhodiumtoad@postgresql.org>
2020-04-25 04:21 pgsql: Fix error case for CREATE ROLE ... IN ROLE. Andrew Gierth <rhodiumtoad@postgresql.org>

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