Skip to content

Grant to spaces for user don't cause error #12168

@laines-it

Description

@laines-it

Bug description

After this commit, granting access to space is not denied for user (see below).

  • OS: Linux
  • OS Version: Archlinux
  • Architecture: amd64
$ tarantool --version
Tarantool 3.6.0-entrypoint-126-g1fd4404bf6
Target: Linux-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BACKTRACE=TRUE
Compiler: GNU-15.2.1
C_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=/home/victo/sidedisk/vk/tarantool/tarantool=. -std=c11 -Wall -Wextra -Wno-gnu-alignof-expression -fno-gnu89-inline -Wno-cast-function-type -O2 -g -DNDEBUG -ggdb -O2 
CXX_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=/home/victo/sidedisk/vk/tarantool/tarantool=. -std=c++17 -Wall -Wextra -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type -O2 -g -DNDEBUG -ggdb -O2

Steps to reproduce

The reproducer script (test.lua):

box.cfg{}

box.schema.space.create('space1')

box.schema.user.create('test1', {password = 'test1'})
box.schema.user.grant('test1', 'super', nil, nil, { if_not_exists = true })

box.schema.user.create('test2', {password = 'test1'})

box.session.su('test1')

local status, err = pcall(function() 
    box.schema.user.grant('test2', 'read', 'space', 'space1', {if_not_exists = false})
end)
print('Granted:', status)
if not status then
    print('Error:', err)
    print('Error code:', err.code)
end

Run (on the previous commit):

$ tarantool test.lua 
Granted:  false
Error:  Grant access to space 'space1' is denied for user 'test'
Error code:  42

Run (on the issue commit):

$ tarantool test.lua 
Granted:  true

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds feedbackSomething is unclear with the issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions