pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #13694: Row Level Security by-passed with CREATEUSER permission
11+ messages / 6 participants
[nested] [flat]
* BUG #13694: Row Level Security by-passed with CREATEUSER permission
@ 2015-10-21 16:42 justin.catterson@sofiebio.com
2015-10-21 18:05 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
0 siblings, 1 reply; 11+ messages in thread
From: justin.catterson@sofiebio.com @ 2015-10-21 16:42 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 13694
Logged by: Justin Catterson
Email address: justin.catterson@sofiebio.com
PostgreSQL version: 9.5beta1
Operating system: Ubuntu 14.10 x64
Description:
Users with the CREATEUSER permission do not evaluate Row Level Security
functions. pg_user usebypassrls is set to false.
To repeat:
CREATE POLICY ... WITH CHECK ((Select myFunction()))
CREATE USER my_user;
ALTER USER my_user WITH CREATEUSER;
Have myFunction() return a result of False;
Update a record belonging to policy.
Record will successfully update, when it should fail.
ALTER USER my_user WITH NOCREATEUSER;
Update a record belonging to policy.
Record will fail as expected.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission
2015-10-21 16:42 BUG #13694: Row Level Security by-passed with CREATEUSER permission justin.catterson@sofiebio.com
@ 2015-10-21 18:05 ` Joe Conway <mail@joeconway.com>
2015-10-21 18:17 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 11+ messages in thread
From: Joe Conway @ 2015-10-21 18:05 UTC (permalink / raw)
To: justin.catterson@sofiebio.com; pgsql-bugs
On 10/21/2015 09:42 AM, justin.catterson@sofiebio.com wrote:
> The following bug has been logged on the website:
>
> Bug reference: 13694
> Logged by: Justin Catterson
> Email address: justin.catterson@sofiebio.com
> PostgreSQL version: 9.5beta1
> Operating system: Ubuntu 14.10 x64
> Description:
>
> Users with the CREATEUSER permission do not evaluate Row Level Security
> functions. pg_user usebypassrls is set to false.
Not a bug. See
http://www.postgresql.org/docs/9.5/static/sql-createrole.html
"CREATEUSER
NOCREATEUSER
These clauses are an obsolete, but still accepted, spelling of
SUPERUSER and NOSUPERUSER. Note that they are not equivalent to
CREATEROLE as one might naively expect!"
And:
http://www.postgresql.org/docs/9.5/static/ddl-rowsecurity.html
"Table owners, superusers, and roles with the BYPASSRLS attribute bypass
the row security system when querying a table."
HTH,
Joe
--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development
Attachments:
signature.asc (application/pgp-signature, 835B) download
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission
2015-10-21 16:42 BUG #13694: Row Level Security by-passed with CREATEUSER permission justin.catterson@sofiebio.com
2015-10-21 18:05 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
@ 2015-10-21 18:17 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 18:26 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Stephen Frost <sfrost@snowman.net>
2015-10-21 18:26 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Andres Freund <andres@anarazel.de>
2015-10-21 18:26 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Justin Catterson <justin.catterson@sofiebio.com>
0 siblings, 3 replies; 11+ messages in thread
From: Tom Lane @ 2015-10-21 18:17 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: justin.catterson@sofiebio.com; pgsql-bugs
Joe Conway <mail@joeconway.com> writes:
> On 10/21/2015 09:42 AM, justin.catterson@sofiebio.com wrote:
>> Users with the CREATEUSER permission do not evaluate Row Level Security
>> functions. pg_user usebypassrls is set to false.
> Not a bug. See
> http://www.postgresql.org/docs/9.5/static/sql-createrole.html
> "CREATEUSER
> NOCREATEUSER
> These clauses are an obsolete, but still accepted, spelling of
> SUPERUSER and NOSUPERUSER. Note that they are not equivalent to
> CREATEROLE as one might naively expect!"
I wonder if it's time yet to remove those keywords. We've had the
SUPERUSER spelling since 8.1, and this report should remind us that
people get confused by the old spellings.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission
2015-10-21 16:42 BUG #13694: Row Level Security by-passed with CREATEUSER permission justin.catterson@sofiebio.com
2015-10-21 18:05 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-21 18:17 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-10-21 18:26 ` Stephen Frost <sfrost@snowman.net>
2 siblings, 0 replies; 11+ messages in thread
From: Stephen Frost @ 2015-10-21 18:26 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Joe Conway <mail@joeconway.com>; justin.catterson@sofiebio.com; pgsql-bugs
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Joe Conway <mail@joeconway.com> writes:
> > On 10/21/2015 09:42 AM, justin.catterson@sofiebio.com wrote:
> >> Users with the CREATEUSER permission do not evaluate Row Level Security
> >> functions. pg_user usebypassrls is set to false.
>
> > Not a bug. See
> > http://www.postgresql.org/docs/9.5/static/sql-createrole.html
>
> > "CREATEUSER
> > NOCREATEUSER
>
> > These clauses are an obsolete, but still accepted, spelling of
> > SUPERUSER and NOSUPERUSER. Note that they are not equivalent to
> > CREATEROLE as one might naively expect!"
>
> I wonder if it's time yet to remove those keywords. We've had the
> SUPERUSER spelling since 8.1, and this report should remind us that
> people get confused by the old spellings.
Probably past time, considering the obvious confusion to CREATEROLE and
NOCREATEROLE.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission
2015-10-21 16:42 BUG #13694: Row Level Security by-passed with CREATEUSER permission justin.catterson@sofiebio.com
2015-10-21 18:05 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-21 18:17 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-10-21 18:26 ` Andres Freund <andres@anarazel.de>
2015-10-21 18:28 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2 siblings, 1 reply; 11+ messages in thread
From: Andres Freund @ 2015-10-21 18:26 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Joe Conway <mail@joeconway.com>; justin.catterson@sofiebio.com; pgsql-bugs
On 2015-10-21 11:17:44 -0700, Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
> > "CREATEUSER
> > NOCREATEUSER
> I wonder if it's time yet to remove those keywords. We've had the
> SUPERUSER spelling since 8.1, and this report should remind us that
> people get confused by the old spellings.
+1 for doing that in 9.6.
Andres
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission
2015-10-21 16:42 BUG #13694: Row Level Security by-passed with CREATEUSER permission justin.catterson@sofiebio.com
2015-10-21 18:05 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-21 18:17 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 18:26 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Andres Freund <andres@anarazel.de>
@ 2015-10-21 18:28 ` Joe Conway <mail@joeconway.com>
2015-10-21 19:46 ` Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 11+ messages in thread
From: Joe Conway @ 2015-10-21 18:28 UTC (permalink / raw)
To: Andres Freund <andres@anarazel.de>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: justin.catterson@sofiebio.com; pgsql-bugs
On 10/21/2015 11:26 AM, Andres Freund wrote:
> On 2015-10-21 11:17:44 -0700, Tom Lane wrote:
>> Joe Conway <mail@joeconway.com> writes:
>>> "CREATEUSER
>>> NOCREATEUSER
>
>> I wonder if it's time yet to remove those keywords. We've had the
>> SUPERUSER spelling since 8.1, and this report should remind us that
>> people get confused by the old spellings.
>
> +1 for doing that in 9.6.
1++
--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development
Attachments:
signature.asc (application/pgp-signature, 835B) download
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission
2015-10-21 16:42 BUG #13694: Row Level Security by-passed with CREATEUSER permission justin.catterson@sofiebio.com
2015-10-21 18:05 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-21 18:17 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 18:26 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Andres Freund <andres@anarazel.de>
2015-10-21 18:28 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
@ 2015-10-21 19:46 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 20:06 ` Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
0 siblings, 1 reply; 11+ messages in thread
From: Tom Lane @ 2015-10-21 19:46 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Andres Freund <andres@anarazel.de>; justin.catterson@sofiebio.com; pgsql-hackers@postgreSQL.org
Joe Conway <mail@joeconway.com> writes:
> On 10/21/2015 11:26 AM, Andres Freund wrote:
>> On 2015-10-21 11:17:44 -0700, Tom Lane wrote:
>>> I wonder if it's time yet to remove those keywords. We've had the
>>> SUPERUSER spelling since 8.1, and this report should remind us that
>>> people get confused by the old spellings.
>> +1 for doing that in 9.6.
> 1++
Attached patch rips out CREATEUSER and NOCREATEUSER options lock, stock,
and barrel.
Another possibility is to change them to actually mean CREATEROLE and
NOCREATEROLE. I think probably a clean break is better though.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
remove-obsolete-createrole-options.patch (text/x-patch, 11.5K) download
diff --git a/doc/src/sgml/ref/alter_role.sgml b/doc/src/sgml/ref/alter_role.sgml
index 7638817b830a1eb73ab59174591fe6eaf3378453..da36ad96967e7c842c28f5787b5ec0dc48ec5a60 100644
*** a/doc/src/sgml/ref/alter_role.sgml
--- b/doc/src/sgml/ref/alter_role.sgml
*************** ALTER ROLE <replaceable class="PARAMETER
*** 28,34 ****
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
- | CREATEUSER | NOCREATEUSER
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
--- 28,33 ----
*************** ALTER ROLE { <replaceable class="PARAMET
*** 160,167 ****
<term><literal>NOCREATEDB</></term>
<term><literal>CREATEROLE</literal></term>
<term><literal>NOCREATEROLE</literal></term>
- <term><literal>CREATEUSER</literal></term>
- <term><literal>NOCREATEUSER</literal></term>
<term><literal>INHERIT</literal></term>
<term><literal>NOINHERIT</literal></term>
<term><literal>LOGIN</literal></term>
--- 159,164 ----
diff --git a/doc/src/sgml/ref/alter_user.sgml b/doc/src/sgml/ref/alter_user.sgml
index 0ffaa16da2fc75fcd1121dcde627837d6a8e9166..84a0c52191fc6c82687ef49df99ac30fdbfd8f1d 100644
*** a/doc/src/sgml/ref/alter_user.sgml
--- b/doc/src/sgml/ref/alter_user.sgml
*************** ALTER USER <replaceable class="PARAMETER
*** 28,34 ****
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
- | CREATEUSER | NOCREATEUSER
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
--- 28,33 ----
diff --git a/doc/src/sgml/ref/create_group.sgml b/doc/src/sgml/ref/create_group.sgml
index 981ce51e5f4aa7a4e54ed962c4675c80281137c8..1d5cc9b5969842985fc657c27d3becd3a3f6af0e 100644
*** a/doc/src/sgml/ref/create_group.sgml
--- b/doc/src/sgml/ref/create_group.sgml
*************** CREATE GROUP <replaceable class="PARAMET
*** 28,34 ****
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
- | CREATEUSER | NOCREATEUSER
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
--- 28,33 ----
diff --git a/doc/src/sgml/ref/create_role.sgml b/doc/src/sgml/ref/create_role.sgml
index 240c21ce85fcd1bd4cddd4bb6af109ef319f8175..38cd4c83696053f5b70fc514e9b3939cb842fb3a 100644
*** a/doc/src/sgml/ref/create_role.sgml
--- b/doc/src/sgml/ref/create_role.sgml
*************** CREATE ROLE <replaceable class="PARAMETE
*** 28,34 ****
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
- | CREATEUSER | NOCREATEUSER
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
--- 28,33 ----
*************** CREATE ROLE <replaceable class="PARAMETE
*** 125,143 ****
</varlistentry>
<varlistentry>
- <term><literal>CREATEUSER</literal></term>
- <term><literal>NOCREATEUSER</literal></term>
- <listitem>
- <para>
- These clauses are an obsolete, but still accepted, spelling of
- <literal>SUPERUSER</literal> and <literal>NOSUPERUSER</literal>.
- Note that they are <emphasis>not</> equivalent to
- <literal>CREATEROLE</literal> as one might naively expect!
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
<term><literal>INHERIT</literal></term>
<term><literal>NOINHERIT</literal></term>
<listitem>
--- 124,129 ----
diff --git a/doc/src/sgml/ref/create_user.sgml b/doc/src/sgml/ref/create_user.sgml
index 065999c85a4df610908c1e762d7bc3435406986b..6c690b36df561573f234de073e4ddbb10e6e9ec7 100644
*** a/doc/src/sgml/ref/create_user.sgml
--- b/doc/src/sgml/ref/create_user.sgml
*************** CREATE USER <replaceable class="PARAMETE
*** 28,34 ****
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
- | CREATEUSER | NOCREATEUSER
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
--- 28,33 ----
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 8bd511952c9fd9706bc2c262e7f72154c91f99c6..fba91d53ac3f3e70e5b196ebfbd35efebf55eed3 100644
*** a/src/backend/parser/gram.y
--- b/src/backend/parser/gram.y
*************** AlterOptRoleElem:
*** 966,981 ****
$$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
else if (strcmp($1, "nosuperuser") == 0)
$$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
- else if (strcmp($1, "createuser") == 0)
- {
- /* For backwards compatibility, synonym for SUPERUSER */
- $$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
- }
- else if (strcmp($1, "nocreateuser") == 0)
- {
- /* For backwards compatibility, synonym for SUPERUSER */
- $$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
- }
else if (strcmp($1, "createrole") == 0)
$$ = makeDefElem("createrole", (Node *)makeInteger(TRUE));
else if (strcmp($1, "nocreaterole") == 0)
--- 966,971 ----
diff --git a/src/backend/utils/mb/conversion_procs/regress_prolog b/src/backend/utils/mb/conversion_procs/regress_prolog
index f5c71790cf28cf06a4d3e0c8ff512bd2911d9f22..f35241a2d097918049a858d289b2131b84c4d509 100644
*** a/src/backend/utils/mb/conversion_procs/regress_prolog
--- b/src/backend/utils/mb/conversion_procs/regress_prolog
***************
*** 1,7 ****
--
-- create user defined conversion
--
! CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEUSER;
SET SESSION AUTHORIZATION conversion_test_user;
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
--
--- 1,7 ----
--
-- create user defined conversion
--
! CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEROLE;
SET SESSION AUTHORIZATION conversion_test_user;
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
--
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 4eb5058416c1dd3d24463e5511ddea5e6acccd98..0e8d3951a29ff24c1098f9d4acd09e72270d697b 100644
*** a/src/bin/psql/tab-complete.c
--- b/src/bin/psql/tab-complete.c
*************** psql_completion(const char *text, int st
*** 1264,1271 ****
{
static const char *const list_ALTERUSER[] =
{"BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
! "CREATEUSER", "ENCRYPTED", "INHERIT", "LOGIN", "NOBYPASSRLS",
! "NOCREATEDB", "NOCREATEROLE", "NOCREATEUSER", "NOINHERIT",
"NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD", "RENAME TO",
"REPLICATION", "RESET", "SET", "SUPERUSER", "UNENCRYPTED",
"VALID UNTIL", "WITH", NULL};
--- 1264,1271 ----
{
static const char *const list_ALTERUSER[] =
{"BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
! "ENCRYPTED", "INHERIT", "LOGIN", "NOBYPASSRLS",
! "NOCREATEDB", "NOCREATEROLE", "NOINHERIT",
"NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD", "RENAME TO",
"REPLICATION", "RESET", "SET", "SUPERUSER", "UNENCRYPTED",
"VALID UNTIL", "WITH", NULL};
*************** psql_completion(const char *text, int st
*** 1282,1289 ****
/* Similar to the above, but don't complete "WITH" again. */
static const char *const list_ALTERUSER_WITH[] =
{"BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
! "CREATEUSER", "ENCRYPTED", "INHERIT", "LOGIN", "NOBYPASSRLS",
! "NOCREATEDB", "NOCREATEROLE", "NOCREATEUSER", "NOINHERIT",
"NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD", "RENAME TO",
"REPLICATION", "RESET", "SET", "SUPERUSER", "UNENCRYPTED",
"VALID UNTIL", NULL};
--- 1282,1289 ----
/* Similar to the above, but don't complete "WITH" again. */
static const char *const list_ALTERUSER_WITH[] =
{"BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
! "ENCRYPTED", "INHERIT", "LOGIN", "NOBYPASSRLS",
! "NOCREATEDB", "NOCREATEROLE", "NOINHERIT",
"NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD", "RENAME TO",
"REPLICATION", "RESET", "SET", "SUPERUSER", "UNENCRYPTED",
"VALID UNTIL", NULL};
*************** psql_completion(const char *text, int st
*** 2671,2678 ****
{
static const char *const list_CREATEROLE[] =
{"ADMIN", "BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
! "CREATEUSER", "ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOBYPASSRLS",
! "NOCREATEDB", "NOCREATEROLE", "NOCREATEUSER", "NOINHERIT",
"NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD",
"REPLICATION", "ROLE", "SUPERUSER", "SYSID", "UNENCRYPTED",
"VALID UNTIL", "WITH", NULL};
--- 2671,2678 ----
{
static const char *const list_CREATEROLE[] =
{"ADMIN", "BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
! "ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOBYPASSRLS",
! "NOCREATEDB", "NOCREATEROLE", "NOINHERIT",
"NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD",
"REPLICATION", "ROLE", "SUPERUSER", "SYSID", "UNENCRYPTED",
"VALID UNTIL", "WITH", NULL};
*************** psql_completion(const char *text, int st
*** 2690,2697 ****
/* Similar to the above, but don't complete "WITH" again. */
static const char *const list_CREATEROLE_WITH[] =
{"ADMIN", "BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
! "CREATEUSER", "ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOBYPASSRLS",
! "NOCREATEDB", "NOCREATEROLE", "NOCREATEUSER", "NOINHERIT",
"NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD",
"REPLICATION", "ROLE", "SUPERUSER", "SYSID", "UNENCRYPTED",
"VALID UNTIL", NULL};
--- 2690,2697 ----
/* Similar to the above, but don't complete "WITH" again. */
static const char *const list_CREATEROLE_WITH[] =
{"ADMIN", "BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
! "ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOBYPASSRLS",
! "NOCREATEDB", "NOCREATEROLE", "NOINHERIT",
"NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD",
"REPLICATION", "ROLE", "SUPERUSER", "SYSID", "UNENCRYPTED",
"VALID UNTIL", NULL};
diff --git a/src/test/regress/expected/conversion.out b/src/test/regress/expected/conversion.out
index 13f1cf3447b42c9be8303e7618eee566e44a4b14..96ea3b9e19089253d9d4e23afdb954ac5233e57b 100644
*** a/src/test/regress/expected/conversion.out
--- b/src/test/regress/expected/conversion.out
*************** SET bytea_output TO escape;
*** 3,9 ****
--
-- create user defined conversion
--
! CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEUSER;
SET SESSION AUTHORIZATION conversion_test_user;
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
--
--- 3,9 ----
--
-- create user defined conversion
--
! CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEROLE;
SET SESSION AUTHORIZATION conversion_test_user;
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
--
diff --git a/src/test/regress/sql/conversion.sql b/src/test/regress/sql/conversion.sql
index e27f06f5c7516df6fe83e599afc75546a80d4abd..fb184453c24a92e6eb7ba20a113d3c86038cd246 100644
*** a/src/test/regress/sql/conversion.sql
--- b/src/test/regress/sql/conversion.sql
*************** SET bytea_output TO escape;
*** 4,10 ****
--
-- create user defined conversion
--
! CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEUSER;
SET SESSION AUTHORIZATION conversion_test_user;
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
--
--- 4,10 ----
--
-- create user defined conversion
--
! CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEROLE;
SET SESSION AUTHORIZATION conversion_test_user;
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
--
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission
2015-10-21 16:42 BUG #13694: Row Level Security by-passed with CREATEUSER permission justin.catterson@sofiebio.com
2015-10-21 18:05 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-21 18:17 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 18:26 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Andres Freund <andres@anarazel.de>
2015-10-21 18:28 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-21 19:46 ` Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-10-21 20:06 ` Joe Conway <mail@joeconway.com>
2015-10-22 15:54 ` Re: Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission Stephen Frost <sfrost@snowman.net>
0 siblings, 1 reply; 11+ messages in thread
From: Joe Conway @ 2015-10-21 20:06 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andres Freund <andres@anarazel.de>; justin.catterson@sofiebio.com; pgsql-hackers@postgreSQL.org
On 10/21/2015 12:46 PM, Tom Lane wrote:
> Attached patch rips out CREATEUSER and NOCREATEUSER options lock, stock,
> and barrel.
Looks good to me.
> Another possibility is to change them to actually mean CREATEROLE and
> NOCREATEROLE. I think probably a clean break is better though.
I think that would be too confusing. I'd rather see them go away ala
your patch.
Joe
--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development
Attachments:
signature.asc (application/pgp-signature, 835B) download
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission
2015-10-21 16:42 BUG #13694: Row Level Security by-passed with CREATEUSER permission justin.catterson@sofiebio.com
2015-10-21 18:05 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-21 18:17 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 18:26 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Andres Freund <andres@anarazel.de>
2015-10-21 18:28 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-21 19:46 ` Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 20:06 ` Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
@ 2015-10-22 15:54 ` Stephen Frost <sfrost@snowman.net>
2015-10-22 16:34 ` Re: Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 11+ messages in thread
From: Stephen Frost @ 2015-10-22 15:54 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Andres Freund <andres@anarazel.de>; justin.catterson@sofiebio.com; pgsql-hackers@postgreSQL.org
* Joe Conway (mail@joeconway.com) wrote:
> On 10/21/2015 12:46 PM, Tom Lane wrote:
> > Attached patch rips out CREATEUSER and NOCREATEUSER options lock, stock,
> > and barrel.
>
> Looks good to me.
>
> > Another possibility is to change them to actually mean CREATEROLE and
> > NOCREATEROLE. I think probably a clean break is better though.
>
>
> I think that would be too confusing. I'd rather see them go away ala
> your patch.
Agreed.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission
2015-10-21 16:42 BUG #13694: Row Level Security by-passed with CREATEUSER permission justin.catterson@sofiebio.com
2015-10-21 18:05 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-21 18:17 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 18:26 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Andres Freund <andres@anarazel.de>
2015-10-21 18:28 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-21 19:46 ` Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 20:06 ` Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-22 15:54 ` Re: Re: [BUGS] BUG #13694: Row Level Security by-passed with CREATEUSER permission Stephen Frost <sfrost@snowman.net>
@ 2015-10-22 16:34 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 11+ messages in thread
From: Tom Lane @ 2015-10-22 16:34 UTC (permalink / raw)
To: Stephen Frost <sfrost@snowman.net>; +Cc: Joe Conway <mail@joeconway.com>; Andres Freund <andres@anarazel.de>; justin.catterson@sofiebio.com; pgsql-hackers@postgresql.org
Stephen Frost <sfrost@snowman.net> writes:
> * Joe Conway (mail@joeconway.com) wrote:
>> On 10/21/2015 12:46 PM, Tom Lane wrote:
>>> Attached patch rips out CREATEUSER and NOCREATEUSER options lock, stock,
>>> and barrel.
>> Looks good to me.
>>> Another possibility is to change them to actually mean CREATEROLE and
>>> NOCREATEROLE. I think probably a clean break is better though.
>> I think that would be too confusing. I'd rather see them go away ala
>> your patch.
> Agreed.
Hearing no objections, done that way.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission
2015-10-21 16:42 BUG #13694: Row Level Security by-passed with CREATEUSER permission justin.catterson@sofiebio.com
2015-10-21 18:05 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Joe Conway <mail@joeconway.com>
2015-10-21 18:17 ` Re: BUG #13694: Row Level Security by-passed with CREATEUSER permission Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-10-21 18:26 ` Justin Catterson <justin.catterson@sofiebio.com>
2 siblings, 0 replies; 11+ messages in thread
From: Justin Catterson @ 2015-10-21 18:26 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Joe Conway <mail@joeconway.com>; pgsql-bugs
Thanks for the quick response,
I had read the documentation but got a little confused with the
phrasing. The option I wanted was CREATEROLE.
"These clauses are an obsolete, but still accepted, spelling of SUPERUSER
and NOSUPERUSER."
I saw obsolete prior to reaching out, but I still did not understand these
clauses had been replaced with SUPERUSER and NOSUPERUSER. Perhaps those
options should be removed from the Synopsis to avoid tempting users.
Overall good work,
I am looking forward to this release.
On Wed, Oct 21, 2015 at 11:17 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Joe Conway <mail@joeconway.com> writes:
> > On 10/21/2015 09:42 AM, justin.catterson@sofiebio.com wrote:
> >> Users with the CREATEUSER permission do not evaluate Row Level Security
> >> functions. pg_user usebypassrls is set to false.
>
> > Not a bug. See
> > http://www.postgresql.org/docs/9.5/static/sql-createrole.html
>
> > "CREATEUSER
> > NOCREATEUSER
>
> > These clauses are an obsolete, but still accepted, spelling of
> > SUPERUSER and NOSUPERUSER. Note that they are not equivalent to
> > CREATEROLE as one might naively expect!"
>
> I wonder if it's time yet to remove those keywords. We've had the
> SUPERUSER spelling since 8.1, and this report should remind us that
> people get confused by the old spellings.
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 11+ messages in thread
end of thread, other threads:[~2015-10-22 16:34 UTC | newest]
Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-10-21 16:42 BUG #13694: Row Level Security by-passed with CREATEUSER permission justin.catterson@sofiebio.com
2015-10-21 18:05 ` Joe Conway <mail@joeconway.com>
2015-10-21 18:17 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 18:26 ` Stephen Frost <sfrost@snowman.net>
2015-10-21 18:26 ` Andres Freund <andres@anarazel.de>
2015-10-21 18:28 ` Joe Conway <mail@joeconway.com>
2015-10-21 19:46 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 20:06 ` Joe Conway <mail@joeconway.com>
2015-10-22 15:54 ` Stephen Frost <sfrost@snowman.net>
2015-10-22 16:34 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-10-21 18:26 ` Justin Catterson <justin.catterson@sofiebio.com>
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