Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: require any privilege on table-based SHOW commands #8070

Merged
merged 1 commit into from
Aug 2, 2016
Merged

sql: require any privilege on table-based SHOW commands #8070

merged 1 commit into from
Aug 2, 2016

Conversation

maddyblue
Copy link
Contributor

@maddyblue maddyblue commented Jul 27, 2016

Fixes #8038


This change is Reviewable

@tamird
Copy link
Contributor

tamird commented Jul 27, 2016

needs tests.

@maddyblue
Copy link
Contributor Author

Added tests. Changed permissions to be any permission, similar to MySQL.


Review status: 0 of 4 files reviewed at latest revision, all discussions resolved, some commit checks pending.


Comments from Reviewable

@tamird
Copy link
Contributor

tamird commented Aug 1, 2016

:lgtm:


Reviewed 4 of 4 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks pending.


Comments from Reviewable

@tamird
Copy link
Contributor

tamird commented Aug 1, 2016

Update the commit message and PR description plz


Review status: all files reviewed at latest revision, all discussions resolved, some commit checks pending.


Comments from Reviewable

@maddyblue maddyblue changed the title sql: require SELECT on table-based SHOW commands sql: require any privilege on table-based SHOW commands Aug 1, 2016
@maddyblue maddyblue merged commit fe7c6ec into cockroachdb:master Aug 2, 2016
@maddyblue maddyblue deleted the sql-table-priv branch August 2, 2016 01:47
@jseldess
Copy link
Contributor

jseldess commented Aug 13, 2016

@mjibson, just starting to update the docs, but I'm confused about the results I'm getting for show columns. As a user who has no privileges on a certain table, users, I'm able to get a response. This PR is supposed to prevent that, right?

$ cockroach sql --user=jseldess
# Welcome to the cockroach SQL interface.
# All statements must be terminated by a semicolon.
# To exit: CTRL + D.

jseldess@:26257> show grants on test.users;
+-------+------+------------+
| Table | User | Privileges |
+-------+------+------------+
| users | root | ALL        |
+-------+------+------------+
(1 row)
jseldess@:26257> show columns from test.users;
+--------+-----------+-------+---------+
| Field  |   Type    | Null  | Default |
+--------+-----------+-------+---------+
| id     | INT       | false | NULL    |
| joined | TIMESTAMP | true  | NULL    |
| name   | STRING    | true  | NULL    |
| data   | BYTES     | true  | NULL    |
+--------+-----------+-------+---------+
(4 rows)

@maddyblue
Copy link
Contributor Author

Yeah that's odd. Could you make an issue about this and assign it to me?

@jseldess
Copy link
Contributor

Done, @mjibson: #8524

@jseldess
Copy link
Contributor

Docs updated with cockroachdb/docs#558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants