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
7e697780
Commit
7e697780
authored
Nov 29, 2002
by
peter@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct bug which exposed itself in rpl000017
Commit for merge
parent
c47ef745
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
10 deletions
+16
-10
client/connect_test.c
client/connect_test.c
+1
-0
include/mysql_com.h
include/mysql_com.h
+2
-2
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/password.c
sql/password.c
+4
-4
sql/sql_acl.cc
sql/sql_acl.cc
+8
-4
No files found.
client/connect_test.c
View file @
7e697780
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include "my_global.h"
#include "mysql.h"
#include "mysql.h"
static
void
change_user
(
MYSQL
*
sock
,
const
char
*
user
,
const
char
*
password
,
static
void
change_user
(
MYSQL
*
sock
,
const
char
*
user
,
const
char
*
password
,
...
...
include/mysql_com.h
View file @
7e697780
...
@@ -281,8 +281,8 @@ void randominit(struct rand_struct *,unsigned long seed1,
...
@@ -281,8 +281,8 @@ void randominit(struct rand_struct *,unsigned long seed1,
unsigned
long
seed2
);
unsigned
long
seed2
);
double
rnd
(
struct
rand_struct
*
);
double
rnd
(
struct
rand_struct
*
);
void
make_scrambled_password
(
char
*
to
,
const
char
*
password
,
my_bool
force_old_scramble
,
struct
rand_struct
*
rand_st
);
void
make_scrambled_password
(
char
*
to
,
const
char
*
password
,
my_bool
force_old_scramble
,
struct
rand_struct
*
rand_st
);
u
int
get_password_length
(
my_bool
force_old_scramble
);
int
get_password_length
(
my_bool
force_old_scramble
);
uint8
get_password_version
(
const
char
*
password
);
char
get_password_version
(
const
char
*
password
);
void
create_random_string
(
int
length
,
struct
rand_struct
*
rand_st
,
char
*
target
);
void
create_random_string
(
int
length
,
struct
rand_struct
*
rand_st
,
char
*
target
);
my_bool
validate_password
(
const
char
*
password
,
const
char
*
message
,
ulong
*
salt
);
my_bool
validate_password
(
const
char
*
password
,
const
char
*
message
,
ulong
*
salt
);
void
password_hash_stage1
(
char
*
to
,
const
char
*
password
);
void
password_hash_stage1
(
char
*
to
,
const
char
*
password
);
...
...
sql/mysql_priv.h
View file @
7e697780
...
@@ -70,6 +70,7 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
...
@@ -70,6 +70,7 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
#define ACL_CACHE_SIZE 256
#define ACL_CACHE_SIZE 256
/* Password lengh for 4.1 version previous versions had 16 bytes password hash */
/* Password lengh for 4.1 version previous versions had 16 bytes password hash */
#define HASH_PASSWORD_LENGTH 45
#define HASH_PASSWORD_LENGTH 45
#define HASH_OLD_PASSWORD_LENGTH 16
#define HOST_CACHE_SIZE 128
#define HOST_CACHE_SIZE 128
#define MAX_ACCEPT_RETRY 10 // Test accept this many times
#define MAX_ACCEPT_RETRY 10 // Test accept this many times
#define MAX_FIELDS_BEFORE_HASH 32
#define MAX_FIELDS_BEFORE_HASH 32
...
...
sql/password.c
View file @
7e697780
...
@@ -232,7 +232,7 @@ void hash_password(ulong *result, const char *password)
...
@@ -232,7 +232,7 @@ void hash_password(ulong *result, const char *password)
none
none
*/
*/
inline
void
password_hash_stage1
(
char
*
to
,
const
char
*
password
)
void
password_hash_stage1
(
char
*
to
,
const
char
*
password
)
{
{
SHA1_CONTEXT
context
;
SHA1_CONTEXT
context
;
sha1_reset
(
&
context
);
sha1_reset
(
&
context
);
...
@@ -259,7 +259,7 @@ inline void password_hash_stage1(char *to, const char *password)
...
@@ -259,7 +259,7 @@ inline void password_hash_stage1(char *to, const char *password)
none
none
*/
*/
inline
void
password_hash_stage2
(
char
*
to
,
const
char
*
salt
)
void
password_hash_stage2
(
char
*
to
,
const
char
*
salt
)
{
{
SHA1_CONTEXT
context
;
SHA1_CONTEXT
context
;
sha1_reset
(
&
context
);
sha1_reset
(
&
context
);
...
@@ -398,7 +398,7 @@ my_bool validate_password(const char* password, const char* message, ulong* salt
...
@@ -398,7 +398,7 @@ my_bool validate_password(const char* password, const char* message, ulong* salt
password length >0
password length >0
*/
*/
inline
u
int
get_password_length
(
my_bool
force_old_scramble
)
inline
int
get_password_length
(
my_bool
force_old_scramble
)
{
{
if
(
force_old_scramble
)
if
(
force_old_scramble
)
return
16
;
return
16
;
...
@@ -418,7 +418,7 @@ inline uint get_password_length(my_bool force_old_scramble)
...
@@ -418,7 +418,7 @@ inline uint get_password_length(my_bool force_old_scramble)
!0 password version char for newer passwords
!0 password version char for newer passwords
*/
*/
inline
uint8
get_password_version
(
const
char
*
password
)
inline
char
get_password_version
(
const
char
*
password
)
{
{
if
(
password
==
NULL
)
return
0
;
if
(
password
==
NULL
)
return
0
;
if
(
password
[
0
]
==
PVERSION41_CHAR
)
return
PVERSION41_CHAR
;
if
(
password
[
0
]
==
PVERSION41_CHAR
)
return
PVERSION41_CHAR
;
...
...
sql/sql_acl.cc
View file @
7e697780
...
@@ -732,8 +732,11 @@ static void acl_update_user(const char *user, const char *host,
...
@@ -732,8 +732,11 @@ static void acl_update_user(const char *user, const char *host,
}
}
if
(
password
)
if
(
password
)
{
{
if
(
!
password
[
0
])
if
(
!
password
[
0
])
/* If password is empty set it to null */
{
acl_user
->
password
=
0
;
acl_user
->
password
=
0
;
acl_user
->
pversion
=
0
;
// just initialize
}
else
else
{
{
acl_user
->
password
=
(
char
*
)
""
;
// Just point at something
acl_user
->
password
=
(
char
*
)
""
;
// Just point at something
...
@@ -774,7 +777,7 @@ static void acl_insert_user(const char *user, const char *host,
...
@@ -774,7 +777,7 @@ static void acl_insert_user(const char *user, const char *host,
{
{
acl_user
.
password
=
(
char
*
)
""
;
// Just point at something
acl_user
.
password
=
(
char
*
)
""
;
// Just point at something
get_salt_from_password
(
acl_user
.
salt
,
password
);
get_salt_from_password
(
acl_user
.
salt
,
password
);
acl_user
.
pversion
=
get_password_version
(
acl_user
.
password
);
acl_user
.
pversion
=
get_password_version
(
password
);
}
}
VOID
(
push_dynamic
(
&
acl_users
,(
gptr
)
&
acl_user
));
VOID
(
push_dynamic
(
&
acl_users
,(
gptr
)
&
acl_user
));
...
@@ -1337,14 +1340,15 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
...
@@ -1337,14 +1340,15 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
if
(
combo
.
password
.
str
&&
combo
.
password
.
str
[
0
])
if
(
combo
.
password
.
str
&&
combo
.
password
.
str
[
0
])
{
{
if
(
combo
.
password
.
length
!=
HASH_PASSWORD_LENGTH
)
if
((
combo
.
password
.
length
!=
HASH_PASSWORD_LENGTH
)
&&
combo
.
password
.
length
!=
HASH_OLD_PASSWORD_LENGTH
)
{
{
my_error
(
ER_PASSWORD_NO_MATCH
,
MYF
(
0
));
my_error
(
ER_PASSWORD_NO_MATCH
,
MYF
(
0
));
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
password
=
combo
.
password
.
str
;
password
=
combo
.
password
.
str
;
}
}
table
->
field
[
0
]
->
store
(
combo
.
host
.
str
,
combo
.
host
.
length
,
system_charset_info
);
table
->
field
[
0
]
->
store
(
combo
.
host
.
str
,
combo
.
host
.
length
,
system_charset_info
);
table
->
field
[
1
]
->
store
(
combo
.
user
.
str
,
combo
.
user
.
length
,
system_charset_info
);
table
->
field
[
1
]
->
store
(
combo
.
user
.
str
,
combo
.
user
.
length
,
system_charset_info
);
table
->
file
->
index_init
(
0
);
table
->
file
->
index_init
(
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