mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Fix for Bug#6377 "Password Generation Discrepancy"
client/mysqladmin.cc: Fix for Bug#6377 "Password Generation Discrepancy": this is not a MySQL bug. The problem is that Windows command line client doesn't trim single quotes from arguments, as any UNIX shell does. The fix just checks for this condition and gives a warning if it is true.
This commit is contained in:
parent
33a4b35ec8
commit
29b3ae4dd4
1 changed files with 9 additions and 2 deletions
|
@ -825,10 +825,17 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
}
|
||||
if (argv[1][0])
|
||||
{
|
||||
char *pw= argv[1];
|
||||
#ifdef __WIN__
|
||||
uint pw_len= strlen(pw);
|
||||
if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'')
|
||||
printf("Warning: single quotes were not trimmed from the password by"
|
||||
" your command\nline client, as you might have expected.\n");
|
||||
#endif
|
||||
if (find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD)
|
||||
make_scrambled_password_323(crypted_pw, argv[1]);
|
||||
make_scrambled_password_323(crypted_pw, pw);
|
||||
else
|
||||
make_scrambled_password(crypted_pw, argv[1]);
|
||||
make_scrambled_password(crypted_pw, pw);
|
||||
}
|
||||
else
|
||||
crypted_pw[0]=0; /* No password */
|
||||
|
|
Loading…
Reference in a new issue