diff options
author | unknown <konstantin@mysql.com> | 2004-12-02 14:28:59 +0300 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2004-12-02 14:28:59 +0300 |
commit | 29b3ae4dd4017239058a6280b713cf2f18457bf5 (patch) | |
tree | 00c03e01b92e614e4463f49a6abbcb0cf621b9bb /client/mysqladmin.cc | |
parent | 33a4b35ec8199af03eb1b5b64e47c9e940f253b1 (diff) | |
download | mariadb-git-29b3ae4dd4017239058a6280b713cf2f18457bf5.tar.gz |
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.
Diffstat (limited to 'client/mysqladmin.cc')
-rw-r--r-- | client/mysqladmin.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index b95ad83f7e8..2e8b3cd588a 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -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 */ |