3879 Ashish Agarwal 2012-04-24
wl2739: Build failure in windows and some additional changes.
modified:
plugin/password_validation/validate_password.cc
sql/sql_plugin.h
3878 Ashish Agarwal 2012-04-24
wl#2739: Build problem in solaris/windows
modified:
include/mysql/plugin_validate_password.h
plugin/password_validation/validate_password.cc
sql/sql_plugin.h
=== modified file 'plugin/password_validation/validate_password.cc'
--- a/plugin/password_validation/validate_password.cc 2012-04-24 11:58:02 +0000
+++ b/plugin/password_validation/validate_password.cc 2012-04-24 15:36:30 +0000
@@ -14,6 +14,8 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <m_ctype.h>
+#include <cctype>
+#include <algorithm>
#include <string>
#include <mysql/plugin_validate_password.h>
#include <set>
@@ -24,8 +26,6 @@
#define MAX_DICTIONARY_FILE_LENGTH 1024 * 1024
#define MIN_DICTIONARY_WORD_LENGTH 3
-MYSQL_PLUGIN_IMPORT char opt_plugin_dir[FN_REFLEN];
-
enum PASSWORD_POLICY { PASSWORD_STRENGTH_REJECTED, PASSWORD_STRENGTH_LOW,
PASSWORD_STRENGTH_MEDIUM, PASSWORD_STRENGTH_STRONG };
@@ -42,18 +42,20 @@ static char *validate_password_dictionar
static bool validate_dictionary_check(const char *password)
{
- string_type password_str= password;
+ string_type password_str(password);
string_type password_substr;
set_type::iterator itr;
uint password_length= strlen(password);
uint substr_length= password_length;
- uint substr_pos;
+ uint substr_pos= 0;
while (substr_length >= MIN_DICTIONARY_WORD_LENGTH)
{
substr_pos= 0;
while (substr_pos + substr_length <= password_length)
{
password_substr= password_str.substr(substr_pos, substr_length);
+ std::transform(password_substr.begin(), password_substr.end(),
+ password_substr.begin(), (int(*)(int)) std::toupper);
itr= dictionary_words.find(password_substr);
if (itr != dictionary_words.end())
return 0;
@@ -160,6 +162,8 @@ static int validate_password_init(void *
while (dictionary_stream.good())
{
std::getline(dictionary_stream, words);
+ std::transform(words.begin(), words.end(), words.begin(),
+ (int(*)(int)) std::toupper);
dictionary_words.insert(words);
}
dictionary_stream.close();
=== modified file 'sql/sql_plugin.h'
--- a/sql/sql_plugin.h 2012-04-24 11:58:02 +0000
+++ b/sql/sql_plugin.h 2012-04-24 15:36:30 +0000
@@ -136,7 +136,7 @@ typedef int (*plugin_type_init)(struct s
extern I_List<i_string> *opt_plugin_load_list_ptr;
extern char *opt_plugin_dir_ptr;
-extern MYSQL_PLUGIN_EXPORT char opt_plugin_dir[FN_REFLEN];
+extern MYSQL_PLUGIN_IMPORT char opt_plugin_dir[FN_REFLEN];
extern const LEX_STRING plugin_type_names[];
extern int plugin_init(int *argc, char **argv, int init_flags);
extern void plugin_shutdown(void);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (ashish.y.agarwal:3878 to 3879) | Ashish Agarwal | 25 Apr |