Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
c9f4724b
Commit
c9f4724b
authored
10 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
Add comments.
parent
2dd025fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/box/alter.cc
+11
-0
11 additions, 0 deletions
src/box/alter.cc
src/box/lua/call.cc
+6
-1
6 additions, 1 deletion
src/box/lua/call.cc
with
17 additions
and
1 deletion
src/box/alter.cc
+
11
−
0
View file @
c9f4724b
...
...
@@ -1321,6 +1321,17 @@ func_def_create_from_tuple(struct func_def *func, struct tuple *tuple)
{
func
->
fid
=
tuple_field_u32
(
tuple
,
ID
);
func
->
uid
=
tuple_field_u32
(
tuple
,
UID
);
/*
* Do not initialize the privilege cache right away since
* when loading up a function definition during recovery,
* user cache may not be filled up yet (space _user is
* recovered after space _func), so no user cache entry
* may exist yet for such user. The cache will be filled
* up on demand upon first access.
*
* Later on consistency of the cache is ensured by DDL
* checks (see user_has_data()).
*/
func
->
auth_token
=
BOX_USER_MAX
;
/* invalid value */
func
->
setuid
=
false
;
const
char
*
name
=
tuple_field_cstr
(
tuple
,
NAME
);
...
...
This diff is collapsed.
Click to expand it.
src/box/lua/call.cc
+
6
−
1
View file @
c9f4724b
...
...
@@ -523,7 +523,12 @@ SetuidGuard::SetuidGuard(const char *name, uint32_t name_len,
if
(
func
->
setuid
)
{
/** Remember and change the current user id. */
if
(
unlikely
(
func
->
auth_token
>=
BOX_USER_MAX
))
{
/* Optimization: cache auth_token on first access */
/*
* Fill the cache upon first access, since
* when func_def is created, no user may
* be around to fill it (recovery of
* system spaces from a snapshot).
*/
struct
user_def
*
owner
=
user_by_id
(
func
->
uid
);
assert
(
owner
!=
NULL
);
/* checked by user_has_data() */
func
->
auth_token
=
owner
->
auth_token
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment