forked from tarantool/tarantool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
box: disallow granting execute privilege on space
Closes tarantool#9277 @TarantoolBot document Title: Document `box_space_execute_priv` compatibility option Historically, it was possible to grant the `execte` privilege on a space although this action had no effect. Since Tarantool 3.0 it isn't allowed anymore. The new `compat` module option `box_space_execute_priv` was added to revert to the old behavior. Please create a documentation page for the new compatibility option at https://tarantool.io/compat/box_space_execute_priv Example: ``` tarantool> box.cfg{log_level = 'error'} --- ... tarantool> box.schema.user.create('alice') --- ... tarantool> box.schema.user.grant('alice', 'execute', 'space') --- - error: Unsupported space privilege 'execute' ... tarantool> require('compat').box_space_execute_priv = 'old' --- ... tarantool> box.schema.user.grant('alice', 'execute', 'space') --- ... ```
- Loading branch information
Showing
18 changed files
with
103 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## bugfix/box | ||
|
||
* **[Breaking change]** `box.schema.user.grant()` now raises an error on | ||
an attempt to grant the `execute` privilege on a space. Historically, | ||
this action was allowed although it had no effect. It's still possible | ||
to revert to the old behavior with the new compatibility option | ||
`box_space_execute_priv` (gh-9277). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
local server = require('luatest.server') | ||
local t = require('luatest') | ||
|
||
local g = t.group() | ||
|
||
g.before_all(function(cg) | ||
cg.server = server:new() | ||
cg.server:start() | ||
end) | ||
|
||
g.after_all(function(cg) | ||
cg.server:drop() | ||
end) | ||
|
||
g.after_test('test_space_execute_priv', function(cg) | ||
cg.server:exec(function() | ||
local compat = require('compat') | ||
box.schema.user.drop('test', {if_exists = true}) | ||
compat.box_space_execute_priv = 'default' | ||
end) | ||
end) | ||
|
||
g.test_space_execute_priv = function(cg) | ||
cg.server:exec(function() | ||
local compat = require('compat') | ||
t.assert_equals(compat.box_space_execute_priv.current, 'default') | ||
t.assert_equals(compat.box_space_execute_priv.default, 'new') | ||
box.schema.user.create('test') | ||
t.assert_error_msg_equals( | ||
"Unsupported space privilege 'execute'", | ||
box.session.su, 'admin', | ||
box.schema.user.grant, 'test', 'execute', 'space') | ||
compat.box_space_execute_priv = 'old' | ||
box.session.su('admin', box.schema.user.grant, | ||
'test', 'execute', 'space') | ||
end) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters