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
9be360ee
Commit
9be360ee
authored
Dec 09, 2002
by
peter@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor new auth fixes
parent
8762e834
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
sql/password.c
sql/password.c
+15
-5
sql/sql_parse.cc
sql/sql_parse.cc
+0
-2
No files found.
sql/password.c
View file @
9be360ee
...
...
@@ -691,10 +691,20 @@ my_bool check_scramble(const char *scrambled, const char *message,
ulong
hash_message
[
2
];
char
buff
[
16
],
*
to
,
extra
;
/* Big enough for check */
const
char
*
pos
;
char
message_buffer
[
9
];
/* Copy of message */
char
message_buffer
[
SCRAMBLE_LENGTH
+
1
];
/* Copy of message */
memcpy
(
message_buffer
,
message
,
8
);
/* Old auth uses 8 bytes at maximum */
message_buffer
[
8
]
=
0
;
/* We need to copy the message as this function can be called for MySQL 4.1
scramble which is not zero ended and can have zeroes inside
We could just write zero to proper place in original message but
this would make it harder to understand code for next generations
*/
memcpy
(
message_buffer
,
message
,
SCRAMBLE_LENGTH
);
/* Ignore the rest */
message_buffer
[
SCRAMBLE_LENGTH
]
=
0
;
/* Check if this exactly N bytes. Overwise this is something fishy */
if
(
strlen
(
message_buffer
)
!=
SCRAMBLE_LENGTH
)
return
1
;
/* Wrong password */
hash_password
(
hash_message
,
message_buffer
);
if
(
old_ver
)
...
...
sql/sql_parse.cc
View file @
9be360ee
...
...
@@ -195,8 +195,6 @@ static int check_user(THD *thd,enum_server_command command, const char *user,
thd
->
db_length
=
0
;
USER_RESOURCES
ur
;
if
(
passwd
[
0
]
&&
strlen
(
passwd
)
!=
SCRAMBLE_LENGTH
)
return
1
;
/* We shall avoid dupplicate user allocations here */
if
(
!
thd
->
user
&&
!
(
thd
->
user
=
my_strdup
(
user
,
MYF
(
0
))))
{
...
...
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