diff options
author | kostja@oak.local <> | 2003-08-07 13:29:25 +0400 |
---|---|---|
committer | kostja@oak.local <> | 2003-08-07 13:29:25 +0400 |
commit | c23975aace138dacbac63753576bf526ad31d984 (patch) | |
tree | 954b5b9817e9a8bde65ef90eec43911130d55cbd /sql/item_strfunc.h | |
parent | a4483aaa1d50d12ba1119e012939dc4cc98f8ca7 (diff) | |
parent | 50d3291aee85411eee59e410429206bef1afb15b (diff) | |
download | mariadb-git-c23975aace138dacbac63753576bf526ad31d984.tar.gz |
Merge oak.local:/home/kostja/mysql/mysql-4.1-root
into oak.local:/home/kostja/mysql/mysql-4.1
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r-- | sql/item_strfunc.h | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index dfcc22b3443..2400657ba58 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -254,30 +254,45 @@ public: }; +/* + Item_func_password -- new (4.1.1) PASSWORD() function implementation. + Returns strcat('*', octet2hex(sha1(sha1(password)))). '*' stands for new + password format, sha1(sha1(password) is so-called hash_stage2 value. + Length of returned string is always 41 byte. To find out how entire + authentification procedure works, see comments in password.c. +*/ + class Item_func_password :public Item_str_func { - char tmp_value[64]; /* This should be enough for new password format */ + char tmp_value[SCRAMBLED_PASSWORD_CHAR_LENGTH+1]; public: Item_func_password(Item *a) :Item_str_func(a) {} - Item_func_password(Item *a, Item *b) :Item_str_func(a,b) {} - String *val_str(String *); - void fix_length_and_dec(); + String *val_str(String *str); + void fix_length_and_dec() { max_length= SCRAMBLED_PASSWORD_CHAR_LENGTH; } const char *func_name() const { return "password"; } + static char *alloc(THD *thd, const char *password); }; +/* + Item_func_old_password -- PASSWORD() implementation used in MySQL 3.21 - 4.0 + compatibility mode. This item is created in sql_yacc.yy when + 'old_passwords' session variable is set, and to handle OLD_PASSWORD() + function. +*/ + class Item_func_old_password :public Item_str_func { - char tmp_value[17]; /* old password length +1 */ + char tmp_value[SCRAMBLED_PASSWORD_CHAR_LENGTH_323+1]; public: Item_func_old_password(Item *a) :Item_str_func(a) {} - String *val_str(String *); - void fix_length_and_dec() { max_length = get_password_length(1); } + String *val_str(String *str); + void fix_length_and_dec() { max_length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323; } const char *func_name() const { return "old_password"; } + static char *alloc(THD *thd, const char *password); }; - class Item_func_des_encrypt :public Item_str_func { String tmp_value; |