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
1271d8b9
Commit
1271d8b9
authored
Feb 28, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into shellback.(none):/home/msvensson/mysql/mysql-5.0
parents
fedf6131
ba3b8fd8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
5 deletions
+85
-5
mysql-test/r/grant2.result
mysql-test/r/grant2.result
+22
-0
mysql-test/t/grant2.test
mysql-test/t/grant2.test
+35
-0
sql/net_serv.cc
sql/net_serv.cc
+25
-4
sql/sql_acl.cc
sql/sql_acl.cc
+3
-1
No files found.
mysql-test/r/grant2.result
View file @
1271d8b9
...
@@ -334,3 +334,25 @@ lock table mysql.user write;
...
@@ -334,3 +334,25 @@ lock table mysql.user write;
revoke all on *.* from 'mysqltest_1'@'localhost';
revoke all on *.* from 'mysqltest_1'@'localhost';
unlock tables;
unlock tables;
drop user 'mysqltest_1'@'localhost';
drop user 'mysqltest_1'@'localhost';
create database TESTDB;
create table t2(a int);
create temporary table t1 as select * from mysql.user;
delete from mysql.user where host='localhost';
INSERT INTO mysql.user VALUES
('%','mysqltest_1',password('password'),'N','N','N','N','N','N',
'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N',
'','','','',0,0,0,0);
INSERT INTO mysql.db VALUES
('%','TESTDB','mysqltest_1','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','N','Y','Y','Y','
Y','N');
Warnings:
Warning 1265 Data truncated for column 'Alter_routine_priv' at row 1
FLUSH PRIVILEGES;
create database TEStdb;
ERROR 42000: Access denied for user 'mysqltest_1'@'%' to database 'TEStdb'
delete from mysql.user;
delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB';
insert into mysql.user select * from t1;
drop table t1, t2;
drop database TESTDB;
flush privileges;
mysql-test/t/grant2.test
View file @
1271d8b9
...
@@ -429,3 +429,38 @@ disconnect con2root;
...
@@ -429,3 +429,38 @@ disconnect con2root;
disconnect
con3root
;
disconnect
con3root
;
# End of 4.1 tests
# End of 4.1 tests
#
# Bug#17279 user with no global privs and with create
# priv in db can create databases
#
create
database
TESTDB
;
create
table
t2
(
a
int
);
create
temporary
table
t1
as
select
*
from
mysql
.
user
;
delete
from
mysql
.
user
where
host
=
'localhost'
;
INSERT
INTO
mysql
.
user
VALUES
(
'%'
,
'mysqltest_1'
,
password
(
'password'
),
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
'N'
,
''
,
''
,
''
,
''
,
0
,
0
,
0
,
0
);
INSERT
INTO
mysql
.
db
VALUES
(
'%'
,
'TESTDB'
,
'mysqltest_1'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'N'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'N'
,
'Y'
,
'Y'
,
'Y'
,
'
Y'
,
'N'
);
FLUSH
PRIVILEGES
;
connect
(
con1
,
localhost
,
mysqltest_1
,
password
,
TESTDB
);
# The user mysqltest_1 should only be allowed access to
# database TESTDB, not TEStdb
--
error
1044
create
database
TEStdb
;
# Clean-up
connection
default
;
delete
from
mysql
.
user
;
delete
from
mysql
.
db
where
host
=
'%'
and
user
=
'mysqltest_1'
and
db
=
'TESTDB'
;
insert
into
mysql
.
user
select
*
from
t1
;
drop
table
t1
,
t2
;
drop
database
TESTDB
;
flush
privileges
;
sql/net_serv.cc
View file @
1271d8b9
...
@@ -208,23 +208,40 @@ my_bool net_realloc(NET *net, ulong length)
...
@@ -208,23 +208,40 @@ my_bool net_realloc(NET *net, ulong length)
RETURN VALUES
RETURN VALUES
0 No data to read
0 No data to read
1 Data or EOF to read
1 Data or EOF to read
-1 Don't know if data is ready or not
*/
*/
static
my_bool
net_data_is_ready
(
my_socket
sd
)
static
int
net_data_is_ready
(
my_socket
sd
)
{
{
#ifdef HAVE_POLL
struct
pollfd
ufds
;
int
res
;
ufds
.
fd
=
sd
;
ufds
.
events
=
POLLIN
|
POLLPRI
;
if
(
!
(
res
=
poll
(
&
ufds
,
1
,
0
)))
return
0
;
if
(
res
<
0
||
!
(
ufds
.
revents
&
(
POLLIN
|
POLLPRI
)))
return
0
;
return
1
;
#else
fd_set
sfds
;
fd_set
sfds
;
struct
timeval
tv
;
struct
timeval
tv
;
int
res
;
int
res
;
if
(
sd
>=
FD_SETSIZE
)
return
-
1
;
FD_ZERO
(
&
sfds
);
FD_ZERO
(
&
sfds
);
FD_SET
(
sd
,
&
sfds
);
FD_SET
(
sd
,
&
sfds
);
tv
.
tv_sec
=
tv
.
tv_usec
=
0
;
tv
.
tv_sec
=
tv
.
tv_usec
=
0
;
if
((
res
=
select
(
sd
+
1
,
&
sfds
,
NULL
,
NULL
,
&
tv
))
<
0
)
if
((
res
=
select
(
sd
+
1
,
&
sfds
,
NULL
,
NULL
,
&
tv
))
<
0
)
return
FALSE
;
return
0
;
else
else
return
test
(
res
?
FD_ISSET
(
sd
,
&
sfds
)
:
0
);
return
test
(
res
?
FD_ISSET
(
sd
,
&
sfds
)
:
0
);
#endif
}
}
...
@@ -251,10 +268,10 @@ static my_bool net_data_is_ready(my_socket sd)
...
@@ -251,10 +268,10 @@ static my_bool net_data_is_ready(my_socket sd)
void
net_clear
(
NET
*
net
)
void
net_clear
(
NET
*
net
)
{
{
int
count
;
int
count
,
ready
;
DBUG_ENTER
(
"net_clear"
);
DBUG_ENTER
(
"net_clear"
);
#if !defined(EMBEDDED_LIBRARY)
#if !defined(EMBEDDED_LIBRARY)
while
(
net_data_is_ready
(
net
->
vio
->
sd
)
)
while
(
(
ready
=
net_data_is_ready
(
net
->
vio
->
sd
))
!=
0
)
{
{
/* The socket is ready */
/* The socket is ready */
if
((
count
=
vio_read
(
net
->
vio
,
(
char
*
)
(
net
->
buff
),
if
((
count
=
vio_read
(
net
->
vio
,
(
char
*
)
(
net
->
buff
),
...
@@ -269,6 +286,10 @@ void net_clear(NET *net)
...
@@ -269,6 +286,10 @@ void net_clear(NET *net)
}
}
else
else
{
{
/* No data to read and 'net_data_is_ready' returned "don't know" */
if
(
ready
==
-
1
)
break
;
DBUG_PRINT
(
"info"
,(
"socket ready but only EOF to read - disconnected"
));
DBUG_PRINT
(
"info"
,(
"socket ready but only EOF to read - disconnected"
));
net
->
error
=
2
;
net
->
error
=
2
;
break
;
break
;
...
...
sql/sql_acl.cc
View file @
1271d8b9
...
@@ -148,7 +148,9 @@ my_bool acl_init(bool dont_read_acl_tables)
...
@@ -148,7 +148,9 @@ my_bool acl_init(bool dont_read_acl_tables)
acl_cache
=
new
hash_filo
(
ACL_CACHE_SIZE
,
0
,
0
,
acl_cache
=
new
hash_filo
(
ACL_CACHE_SIZE
,
0
,
0
,
(
hash_get_key
)
acl_entry_get_key
,
(
hash_get_key
)
acl_entry_get_key
,
(
hash_free_key
)
free
,
system_charset_info
);
(
hash_free_key
)
free
,
/* Use the case sensitive "binary" charset */
&
my_charset_bin
);
if
(
dont_read_acl_tables
)
if
(
dont_read_acl_tables
)
{
{
DBUG_RETURN
(
0
);
/* purecov: tested */
DBUG_RETURN
(
0
);
/* purecov: tested */
...
...
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