Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a7b7a40c
Commit
a7b7a40c
authored
Dec 16, 2003
by
pem@mysql.comhem.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server.
Added missing cleanup in sp-security.test.
parent
45e58963
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
3 deletions
+20
-3
mysql-test/r/sp-security.result
mysql-test/r/sp-security.result
+1
-0
mysql-test/t/sp-security.test
mysql-test/t/sp-security.test
+1
-0
sql/item_func.cc
sql/item_func.cc
+7
-1
sql/sp_head.cc
sql/sp_head.cc
+3
-1
sql/sp_head.h
sql/sp_head.h
+2
-1
sql/sql_parse.cc
sql/sql_parse.cc
+6
-0
No files found.
mysql-test/r/sp-security.result
View file @
a7b7a40c
...
...
@@ -39,6 +39,7 @@ call stamp(5);
ERROR 42000: Access denied for user: 'dummy'@'localhost' to database 'db1_secret'
call stamp(6);
ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret'
drop procedure stamp;
use test;
drop database db1_secret;
delete from mysql.user where user='dummy';
mysql-test/t/sp-security.test
View file @
a7b7a40c
...
...
@@ -94,6 +94,7 @@ call stamp(6);
# Clean up
connection
con1root
;
drop
procedure
stamp
;
use
test
;
drop
database
db1_secret
;
delete
from
mysql
.
user
where
user
=
'dummy'
;
sql/item_func.cc
View file @
a7b7a40c
...
...
@@ -3069,19 +3069,25 @@ Item_func_sp::execute(Item **itp)
{
DBUG_ENTER
(
"Item_func_sp::execute"
);
THD
*
thd
=
current_thd
;
st_sp_security_context
save_ctx
;
int
res
;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
st_sp_security_context
save_ctx
;
#endif
if
(
!
m_sp
)
m_sp
=
sp_find_function
(
thd
,
&
m_name
);
if
(
!
m_sp
)
DBUG_RETURN
(
-
1
);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
sp_change_security_context
(
thd
,
m_sp
,
&
save_ctx
);
#endif
res
=
m_sp
->
execute_function
(
thd
,
args
,
arg_count
,
itp
);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
sp_restore_security_context
(
thd
,
m_sp
,
&
save_ctx
);
#endif
DBUG_RETURN
(
res
);
}
...
...
sql/sp_head.cc
View file @
a7b7a40c
...
...
@@ -1080,7 +1080,7 @@ sp_instr_cfetch::execute(THD *thd, uint *nextp)
//
// Security context swapping
//
#ifndef NO_EMBEDDED_ACCESS_CHECKS
void
sp_change_security_context
(
THD
*
thd
,
sp_head
*
sp
,
st_sp_security_context
*
ctxp
)
{
...
...
@@ -1136,3 +1136,5 @@ sp_restore_security_context(THD *thd, sp_head *sp, st_sp_security_context *ctxp)
strncpy
(
thd
->
priv_host
,
ctxp
->
priv_host
,
sizeof
(
thd
->
priv_host
));
}
}
#endif
/* NO_EMBEDDED_ACCESS_CHECKS */
sql/sp_head.h
View file @
a7b7a40c
...
...
@@ -649,10 +649,11 @@ struct st_sp_security_context
char
*
ip
;
};
#ifndef NO_EMBEDDED_ACCESS_CHECKS
void
sp_change_security_context
(
THD
*
thd
,
sp_head
*
sp
,
st_sp_security_context
*
ctxp
);
void
sp_restore_security_context
(
THD
*
thd
,
sp_head
*
sp
,
st_sp_security_context
*
ctxp
);
#endif
/* NO_EMBEDDED_ACCESS_CHECKS */
#endif
/* _SP_HEAD_H_ */
sql/sql_parse.cc
View file @
a7b7a40c
...
...
@@ -3501,7 +3501,9 @@ mysql_execute_command(THD *thd)
}
else
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
st_sp_security_context
save_ctx
;
#endif
uint
smrx
;
LINT_INIT
(
smrx
);
...
...
@@ -3533,11 +3535,15 @@ mysql_execute_command(THD *thd)
thd
->
server_status
|=
SERVER_MORE_RESULTS_EXISTS
;
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
sp_change_security_context
(
thd
,
sp
,
&
save_ctx
);
#endif
res
=
sp
->
execute_procedure
(
thd
,
&
lex
->
value_list
);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
sp_restore_security_context
(
thd
,
sp
,
&
save_ctx
);
#endif
#ifndef EMBEDDED_LIBRARY
thd
->
net
.
no_send_ok
=
nsok
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment