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
32af78c5
Commit
32af78c5
authored
Oct 27, 2010
by
MySQL Build Team
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge of 57689 revno: 3101 from mysql-5.5-bugteam
parent
07fd5d6f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
2 deletions
+37
-2
sql/sql_acl.cc
sql/sql_acl.cc
+37
-2
No files found.
sql/sql_acl.cc
View file @
32af78c5
...
...
@@ -8091,6 +8091,24 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
DBUG_RETURN
(
1
);
}
/*
If we're dealing with an older client we can't just send a change plugin
packet to re-initiate the authentication handshake, because the client
won't understand it. The good thing is that we don't need to : the old client
expects us to just check the user credentials here, which we can do by just reading
the cached data that are placed there by parse_com_change_user_packet()
In this case we just do nothing and behave as if normal authentication
should continue.
*/
if
(
!
(
mpvio
->
client_capabilities
&
CLIENT_PLUGIN_AUTH
))
{
DBUG_PRINT
(
"info"
,
(
"old client sent a COM_CHANGE_USER"
));
DBUG_ASSERT
(
mpvio
->
cached_client_reply
.
pkt
);
/* get the status back so the read can process the cached result */
mpvio
->
status
=
MPVIO_EXT
::
RESTART
;
DBUG_RETURN
(
0
);
}
DBUG_PRINT
(
"info"
,
(
"requesting client to use the %s plugin"
,
client_auth_plugin
));
DBUG_RETURN
(
net_write_command
(
net
,
switch_plugin_request_buf
[
0
],
...
...
@@ -8574,7 +8592,15 @@ static int server_mpvio_write_packet(MYSQL_PLUGIN_VIO *param,
int
res
;
DBUG_ENTER
(
"server_mpvio_write_packet"
);
/* reset cached_client_reply */
/*
Reset cached_client_reply if not an old client doing mysql_change_user,
as this is where the password from COM_CHANGE_USER is stored.
*/
if
(
!
((
!
(
mpvio
->
client_capabilities
&
CLIENT_PLUGIN_AUTH
))
&&
mpvio
->
status
==
MPVIO_EXT
::
RESTART
&&
mpvio
->
cached_client_reply
.
plugin
==
((
st_mysql_auth
*
)
(
plugin_decl
(
mpvio
->
plugin
)
->
info
))
->
client_auth_plugin
))
mpvio
->
cached_client_reply
.
pkt
=
0
;
/* for the 1st packet we wrap plugin data into the handshake packet */
if
(
mpvio
->
packets_written
==
0
)
...
...
@@ -8641,6 +8667,15 @@ static int server_mpvio_read_packet(MYSQL_PLUGIN_VIO *param, uchar **buf)
mpvio
->
packets_read
++
;
DBUG_RETURN
((
int
)
mpvio
->
cached_client_reply
.
pkt_len
);
}
/* older clients don't support change of client plugin request */
if
(
!
(
mpvio
->
client_capabilities
&
CLIENT_PLUGIN_AUTH
))
{
mpvio
->
status
=
MPVIO_EXT
::
FAILURE
;
pkt_len
=
packet_error
;
goto
err
;
}
/*
But if the client has used the wrong plugin, the cached data are
useless. Furthermore, we have to send a "change plugin" request
...
...
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