Skip to content

sql: default privileges, granting excess privileges when creating an object #72322

@RichardJCai

Description

@RichardJCai
create user foo with password 'roach';
# login as foo
alter default privileges grant select on tables to foo
# login as root
create table t1();
show grants on table t1;

root@localhost:26257/defaultdb> show grants on table t1;
  database_name | schema_name | table_name | grantee | privilege_type
----------------+-------------+------------+---------+-----------------
  defaultdb     | public      | t1         | admin   | ALL
  defaultdb     | public      | t1         | foo    | SELECT
  defaultdb     | public      | t1         | root    | ALL

We're granting too many privileges when creating an object due to default privileges - in this case, foo should not be getting select on this table

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-privilegesSQL privilege handling and permission checks.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions