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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
014ef7c1
Commit
014ef7c1
authored
Jun 28, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/tnurnberg/work/mysql-5.0-maint-19857
into mysql.com:/home/tnurnberg/mysql-5.0
parents
16a2388c
cfc10401
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
16 deletions
+122
-16
mysql-test/r/sp-security.result
mysql-test/r/sp-security.result
+31
-0
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+1
-1
mysql-test/t/sp-security.test
mysql-test/t/sp-security.test
+46
-0
sql/sql_acl.cc
sql/sql_acl.cc
+44
-15
No files found.
mysql-test/r/sp-security.result
View file @
014ef7c1
...
...
@@ -420,3 +420,34 @@ ERROR HY000: There is no 'mysqltest_1'@'localhost' registered
---> connection: root
DROP USER mysqltest_2@localhost;
DROP DATABASE mysqltest;
GRANT USAGE ON *.* TO user19857@localhost IDENTIFIED BY 'meow';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE ROUTINE, ALTER ROUTINE ON test.* TO
user19857@localhost;
SELECT Host,User,Password FROM mysql.user WHERE User='user19857';
Host User Password
localhost user19857 *82DC221D557298F6CE9961037DB1C90604792F5C
---> connection: mysqltest_2_con
use test;
CREATE PROCEDURE sp19857() DETERMINISTIC
BEGIN
DECLARE a INT;
SET a=1;
SELECT a;
END //
SHOW CREATE PROCEDURE test.sp19857;
Procedure sql_mode Create Procedure
sp19857 CREATE DEFINER=`user19857`@`localhost` PROCEDURE `sp19857`()
DETERMINISTIC
BEGIN
DECLARE a INT;
SET a=1;
SELECT a;
END
DROP PROCEDURE IF EXISTS test.sp19857;
---> connection: root
SELECT Host,User,Password FROM mysql.user WHERE User='user19857';
Host User Password
localhost user19857 *82DC221D557298F6CE9961037DB1C90604792F5C
DROP USER user19857@localhost;
mysql-test/t/mysqldump.test
View file @
014ef7c1
...
...
@@ -610,7 +610,7 @@ drop database db1;
# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
#
--
exec
$MYSQL_MY_PRINT_DEFAULTS
--
defaults
-
extra
-
file
=
$MYSQL_TEST_DIR
/
std_data
/
bug15328
.
cnf
mysqldump
--
exec
$MYSQL_MY_PRINT_DEFAULTS
--
config
-
file
=
$MYSQL_TEST_DIR
/
std_data
/
bug15328
.
cnf
mysqldump
#
...
...
mysql-test/t/sp-security.test
View file @
014ef7c1
...
...
@@ -744,4 +744,50 @@ DROP USER mysqltest_2@localhost;
DROP
DATABASE
mysqltest
;
#
# Bug#19857 - When a user with CREATE ROUTINE priv creates a routine,
# it results in NULL p/w
#
# Can't test with embedded server that doesn't support grants
GRANT
USAGE
ON
*.*
TO
user19857
@
localhost
IDENTIFIED
BY
'meow'
;
GRANT
SELECT
,
INSERT
,
UPDATE
,
DELETE
,
CREATE
ROUTINE
,
ALTER
ROUTINE
ON
test
.*
TO
user19857
@
localhost
;
SELECT
Host
,
User
,
Password
FROM
mysql
.
user
WHERE
User
=
'user19857'
;
--
connect
(
mysqltest_2_con
,
localhost
,
user19857
,
meow
,
test
)
--
echo
--
echo
--->
connection
:
mysqltest_2_con
--
connection
mysqltest_2_con
use
test
;
DELIMITER
//;
CREATE
PROCEDURE
sp19857
()
DETERMINISTIC
BEGIN
DECLARE
a
INT
;
SET
a
=
1
;
SELECT
a
;
END
//
DELIMITER
;
//
SHOW
CREATE
PROCEDURE
test
.
sp19857
;
--
disconnect
mysqltest_2_con
--
connect
(
mysqltest_2_con
,
localhost
,
user19857
,
meow
,
test
)
--
connection
mysqltest_2_con
DROP
PROCEDURE
IF
EXISTS
test
.
sp19857
;
--
echo
--
echo
--->
connection
:
root
--
connection
con1root
--
disconnect
mysqltest_2_con
SELECT
Host
,
User
,
Password
FROM
mysql
.
user
WHERE
User
=
'user19857'
;
DROP
USER
user19857
@
localhost
;
# End of 5.0 bugs.
sql/sql_acl.cc
View file @
014ef7c1
...
...
@@ -5601,6 +5601,8 @@ bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
TABLE_LIST
tables
[
1
];
List
<
LEX_USER
>
user_list
;
bool
result
;
ACL_USER
*
au
;
char
passwd_buff
[
SCRAMBLED_PASSWORD_CHAR_LENGTH
+
1
];
DBUG_ENTER
(
"sp_grant_privileges"
);
if
(
!
(
combo
=
(
LEX_USER
*
)
thd
->
alloc
(
sizeof
(
st_lex_user
))))
...
...
@@ -5609,17 +5611,20 @@ bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
combo
->
user
.
str
=
sctx
->
user
;
VOID
(
pthread_mutex_lock
(
&
acl_cache
->
lock
));
if
(
!
find_acl_user
(
combo
->
host
.
str
=
(
char
*
)
sctx
->
host_or_ip
,
combo
->
user
.
str
,
FALSE
)
&&
!
find_acl_user
(
combo
->
host
.
str
=
(
char
*
)
sctx
->
host
,
combo
->
user
.
str
,
FALSE
)
&&
!
find_acl_user
(
combo
->
host
.
str
=
(
char
*
)
sctx
->
ip
,
combo
->
user
.
str
,
FALSE
)
&&
!
find_acl_user
(
combo
->
host
.
str
=
(
char
*
)
"%"
,
combo
->
user
.
str
,
FALSE
))
{
if
((
au
=
find_acl_user
(
combo
->
host
.
str
=
(
char
*
)
sctx
->
host_or_ip
,
combo
->
user
.
str
,
FALSE
)))
goto
found_acl
;
if
((
au
=
find_acl_user
(
combo
->
host
.
str
=
(
char
*
)
sctx
->
host
,
combo
->
user
.
str
,
FALSE
)))
goto
found_acl
;
if
((
au
=
find_acl_user
(
combo
->
host
.
str
=
(
char
*
)
sctx
->
ip
,
combo
->
user
.
str
,
FALSE
)))
goto
found_acl
;
if
((
au
=
find_acl_user
(
combo
->
host
.
str
=
(
char
*
)
"%"
,
combo
->
user
.
str
,
FALSE
)))
goto
found_acl
;
VOID
(
pthread_mutex_unlock
(
&
acl_cache
->
lock
));
DBUG_RETURN
(
TRUE
);
}
found_acl:
VOID
(
pthread_mutex_unlock
(
&
acl_cache
->
lock
));
bzero
((
char
*
)
tables
,
sizeof
(
TABLE_LIST
));
...
...
@@ -5632,8 +5637,32 @@ bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
combo
->
user
.
length
=
strlen
(
combo
->
user
.
str
);
combo
->
host
.
str
=
thd
->
strmake
(
combo
->
host
.
str
,
combo
->
host
.
length
);
combo
->
user
.
str
=
thd
->
strmake
(
combo
->
user
.
str
,
combo
->
user
.
length
);
if
(
au
&&
au
->
salt_len
)
{
if
(
au
->
salt_len
==
SCRAMBLE_LENGTH
)
{
make_password_from_salt
(
passwd_buff
,
au
->
salt
);
combo
->
password
.
length
=
SCRAMBLED_PASSWORD_CHAR_LENGTH
;
}
else
if
(
au
->
salt_len
==
SCRAMBLE_LENGTH_323
)
{
make_password_from_salt_323
(
passwd_buff
,
(
ulong
*
)
au
->
salt
);
combo
->
password
.
length
=
SCRAMBLED_PASSWORD_CHAR_LENGTH_323
;
}
else
{
my_error
(
ER_PASSWD_LENGTH
,
MYF
(
0
),
SCRAMBLED_PASSWORD_CHAR_LENGTH
);
return
-
1
;
}
combo
->
password
.
str
=
passwd_buff
;
}
else
{
combo
->
password
.
str
=
(
char
*
)
""
;
combo
->
password
.
length
=
0
;
}
if
(
user_list
.
push_back
(
combo
))
DBUG_RETURN
(
TRUE
);
...
...
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