List:Commits« Previous MessageNext Message »
From:Ashish Agarwal Date:May 21 2012 2:23pm
Subject:bzr push into mysql-trunk branch (ashish.y.agarwal:3898 to 3899) WL#2739
View as plain text  
 3899 Ashish Agarwal	2012-05-21
      WL#2739: Auditing Password Security
      ******
      WL#2739: Failing test case in WL branch.
      ******
      WL#2739: Some tests were failing.
               Unable to compile in windows.
               patch to correct the test cases and
               make it compile in windows.
      ******
      wl#2739: Changes in the the test case
               compiling it in windows. 
      ******
      WL#2739: Still some problem exsists with compilation in windows.
               Patch to solve it.
      ******
      wl2739: Auditing Password Security
              Some performance issue.
      ******
      WL#2739: some important changes regarding implementation
               Test fail in windows
      ******
      wl#2739: Build problem in solaris/windows
      ******
      wl2739: Build failure in windows and some additional changes.
      ******
      WL2739: Including password validation on multiple
              character set. 
      ******
      wl2739: Changing the dictionary file
      ******
      WL2739: Test failing on windows.
              Dictionary file is not found in plugin
              directory.
      ******
      wl2739: Test case fails in linux due to dictionary
              file.
      ******
      wl2739: Auditing Password Security
              Impementing review comments.
      ******
      wl2739: Auditing Password Security
              Build failure in windows.
      ******
      wl2739: Auditing Password Security
              Build failure in windows
      ******
      wl2739: Auditing Password Security
              Build failure in windows.
      ******
      WL2739: Auditing Password Security
              Implementing review comments.
      ******
      WL2739: Auditing Password Security
              Implementing review comment
      ******
      wl2739: Auditing Password Security
              Implementing suggestions.
      ******
      wl2739: Auditing Password Security
              Implementing code review.
      ******
      wl2739: Auditing Password Security
              Implementing code review
      ******
      wl2739: Auditing Password Security
              Compilation error in solaris.
      ******
      wl#2739: Auditing Password Security
               Test failure in windows 
      ******
      WL#2739: Auditing Password Security
               Change in the .cnf file

    added:
      include/mysql/plugin_validate_password.h
      include/mysql/service_mysql_string.h
      libservices/mysql_string_service.c
      mysql-test/include/have_validate_password_plugin.inc
      mysql-test/r/validate_password_plugin.result
      mysql-test/t/validate_password_plugin-master.opt
      mysql-test/t/validate_password_plugin.test
      plugin/password_validation/
      plugin/password_validation/CMakeLists.txt
      plugin/password_validation/validate_password.cc
      sql/share/dictionary.txt
      sql/string_service.cc
      sql/string_service.h
    modified:
      include/CMakeLists.txt
      include/mysql/plugin.h
      include/mysql/plugin_audit.h.pp
      include/mysql/plugin_auth.h.pp
      include/mysql/plugin_ftparser.h.pp
      include/mysql/services.h
      include/service_versions.h
      libservices/CMakeLists.txt
      mysql-test/include/plugin.defs
      sql/CMakeLists.txt
      sql/item_create.cc
      sql/item_func.cc
      sql/item_func.h
      sql/item_strfunc.cc
      sql/share/CMakeLists.txt
      sql/share/errmsg-utf8.txt
      sql/sql_acl.cc
      sql/sql_acl.h
      sql/sql_plugin.cc
      sql/sql_plugin_services.h
      sql/sql_yacc.yy
      support-files/CMakeLists.txt
      support-files/my-huge.cnf.sh
      support-files/my-large.cnf.sh
      support-files/my-medium.cnf.sh
      support-files/my-small.cnf.sh
 3898 Mayank Prasad	2012-05-21
      BUG#13784804 : REMOVE THE LEGACY SHA1 AND MD5 CODE FROM THE SERVER
      
      Details:
       - Removing MySQL implementation of MD5 and SHA1.
       - Removed -DWITH_SSL=no compile option for SSL. 
      
      NOTE:
        As per include/my_global.h, HAVE_OPENSSL is undefined in embedded library:
       
         #ifdef EMBEDDED_LIBRARY
       
         /* Things we don't need in the embedded version of MySQL */
         /* TODO HF add #undef HAVE_VIO if we don't want client in embedded library
         */
       
         #undef HAVE_OPENSSL
         #undef HAVE_SMEM                /* No shared memory */
       
         #endif /* EMBEDDED_LIBRARY */
       
        If embedded library is built with -DWITH_SSL=system option, earlier (before
        this bug) it was suppose to go into MySQL implementation of SSL but now this
        has been removed, so it wouldn't have SSL support.

    removed:
      mysys/md5.c
      mysys/sha1.c
    modified:
      CMakeLists.txt
      cmake/ssl.cmake
      include/my_md5.h
      include/sha1.h
      mysql-test/t/disabled.def
      mysys/CMakeLists.txt
      sql/md5.cc
      sql/sha1.cc
=== modified file 'include/CMakeLists.txt'
--- a/include/CMakeLists.txt	2012-02-16 09:51:14 +0000
+++ b/include/CMakeLists.txt	2012-05-21 14:22:56 +0000
@@ -30,6 +30,7 @@ SET(HEADERS_ABI
   mysql/plugin.h
   mysql/plugin_audit.h
   mysql/plugin_ftparser.h
+  mysql/plugin_validate_password.h
 )
 
 SET(HEADERS 

=== modified file 'include/mysql/plugin.h'
--- a/include/mysql/plugin.h	2012-03-06 14:29:42 +0000
+++ b/include/mysql/plugin.h	2012-05-21 14:22:56 +0000
@@ -73,7 +73,7 @@ typedef struct st_mysql_xid MYSQL_XID;
   Plugin API. Common for all plugin types.
 */
 
-#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0103
+#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0104
 
 /*
   The allowable types of plugins
@@ -86,7 +86,8 @@ typedef struct st_mysql_xid MYSQL_XID;
 #define MYSQL_AUDIT_PLUGIN           5  /* The Audit plugin type        */
 #define MYSQL_REPLICATION_PLUGIN     6	/* The replication plugin type */
 #define MYSQL_AUTHENTICATION_PLUGIN  7  /* The authentication plugin type */
-#define MYSQL_MAX_PLUGIN_TYPE_NUM    8  /* The number of plugin types   */
+#define MYSQL_VALIDATE_PASSWORD_PLUGIN  8   /* validate password plugin type */
+#define MYSQL_MAX_PLUGIN_TYPE_NUM    9  /* The number of plugin types   */
 
 /* We use the following strings to define licenses for plugins */
 #define PLUGIN_LICENSE_PROPRIETARY 0

=== modified file 'include/mysql/plugin_audit.h.pp'
--- a/include/mysql/plugin_audit.h.pp	2012-03-01 13:53:55 +0000
+++ b/include/mysql/plugin_audit.h.pp	2012-05-21 14:22:56 +0000
@@ -73,6 +73,35 @@ extern struct my_plugin_log_service
 } *my_plugin_log_service;
 int my_plugin_log_message(MYSQL_PLUGIN *plugin, enum plugin_log_level level,
                           const char *format, ...);
+#include <mysql/service_mysql_string.h>
+typedef void *mysql_string_iterator_handle;
+typedef void *mysql_string_handle;
+extern struct mysql_string_service_st {
+  int (*mysql_string_convert_to_char_ptr_type)
+       (mysql_string_handle, const char *, char *, int *);
+  mysql_string_iterator_handle (*mysql_string_get_iterator_type)
+                                (mysql_string_handle);
+  int (*mysql_string_iterator_next_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_isupper_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_islower_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_isdigit_type)(mysql_string_iterator_handle);
+  mysql_string_handle (*mysql_string_to_lowercase_type)(mysql_string_handle);
+  void (*mysql_string_free_type)(mysql_string_handle);
+  void (*mysql_string_iterator_free_type)(mysql_string_iterator_handle);
+} *mysql_string_service;
+int mysql_string_convert_to_char_ptr(mysql_string_handle string_handle,
+                                     const char *charset_name, char *buffer,
+                                     int *error);
+mysql_string_iterator_handle mysql_string_get_iterator(mysql_string_handle
+                                                       string_handle);
+int mysql_string_iterator_next(mysql_string_iterator_handle iterator_handle);
+int mysql_string_iterator_isupper(mysql_string_iterator_handle iterator_handle);
+int mysql_string_iterator_islower(mysql_string_iterator_handle iterator_handle);
+int mysql_string_iterator_isdigit(mysql_string_iterator_handle iterator_handle);
+mysql_string_handle mysql_string_to_lowercase(mysql_string_handle
+                                              string_handle);
+void mysql_string_free(mysql_string_handle);
+void mysql_string_iterator_free(mysql_string_iterator_handle);
 struct st_mysql_xid {
   long formatID;
   long gtrid_length;

=== modified file 'include/mysql/plugin_auth.h.pp'
--- a/include/mysql/plugin_auth.h.pp	2012-03-01 13:53:55 +0000
+++ b/include/mysql/plugin_auth.h.pp	2012-05-21 14:22:56 +0000
@@ -73,6 +73,35 @@ extern struct my_plugin_log_service
 } *my_plugin_log_service;
 int my_plugin_log_message(MYSQL_PLUGIN *plugin, enum plugin_log_level level,
                           const char *format, ...);
+#include <mysql/service_mysql_string.h>
+typedef void *mysql_string_iterator_handle;
+typedef void *mysql_string_handle;
+extern struct mysql_string_service_st {
+  int (*mysql_string_convert_to_char_ptr_type)
+       (mysql_string_handle, const char *, char *, int *);
+  mysql_string_iterator_handle (*mysql_string_get_iterator_type)
+                                (mysql_string_handle);
+  int (*mysql_string_iterator_next_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_isupper_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_islower_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_isdigit_type)(mysql_string_iterator_handle);
+  mysql_string_handle (*mysql_string_to_lowercase_type)(mysql_string_handle);
+  void (*mysql_string_free_type)(mysql_string_handle);
+  void (*mysql_string_iterator_free_type)(mysql_string_iterator_handle);
+} *mysql_string_service;
+int mysql_string_convert_to_char_ptr(mysql_string_handle string_handle,
+                                     const char *charset_name, char *buffer,
+                                     int *error);
+mysql_string_iterator_handle mysql_string_get_iterator(mysql_string_handle
+                                                       string_handle);
+int mysql_string_iterator_next(mysql_string_iterator_handle iterator_handle);
+int mysql_string_iterator_isupper(mysql_string_iterator_handle iterator_handle);
+int mysql_string_iterator_islower(mysql_string_iterator_handle iterator_handle);
+int mysql_string_iterator_isdigit(mysql_string_iterator_handle iterator_handle);
+mysql_string_handle mysql_string_to_lowercase(mysql_string_handle
+                                              string_handle);
+void mysql_string_free(mysql_string_handle);
+void mysql_string_iterator_free(mysql_string_iterator_handle);
 struct st_mysql_xid {
   long formatID;
   long gtrid_length;

=== modified file 'include/mysql/plugin_ftparser.h.pp'
--- a/include/mysql/plugin_ftparser.h.pp	2012-03-01 13:53:55 +0000
+++ b/include/mysql/plugin_ftparser.h.pp	2012-05-21 14:22:56 +0000
@@ -73,6 +73,35 @@ extern struct my_plugin_log_service
 } *my_plugin_log_service;
 int my_plugin_log_message(MYSQL_PLUGIN *plugin, enum plugin_log_level level,
                           const char *format, ...);
+#include <mysql/service_mysql_string.h>
+typedef void *mysql_string_iterator_handle;
+typedef void *mysql_string_handle;
+extern struct mysql_string_service_st {
+  int (*mysql_string_convert_to_char_ptr_type)
+       (mysql_string_handle, const char *, char *, int *);
+  mysql_string_iterator_handle (*mysql_string_get_iterator_type)
+                                (mysql_string_handle);
+  int (*mysql_string_iterator_next_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_isupper_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_islower_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_isdigit_type)(mysql_string_iterator_handle);
+  mysql_string_handle (*mysql_string_to_lowercase_type)(mysql_string_handle);
+  void (*mysql_string_free_type)(mysql_string_handle);
+  void (*mysql_string_iterator_free_type)(mysql_string_iterator_handle);
+} *mysql_string_service;
+int mysql_string_convert_to_char_ptr(mysql_string_handle string_handle,
+                                     const char *charset_name, char *buffer,
+                                     int *error);
+mysql_string_iterator_handle mysql_string_get_iterator(mysql_string_handle
+                                                       string_handle);
+int mysql_string_iterator_next(mysql_string_iterator_handle iterator_handle);
+int mysql_string_iterator_isupper(mysql_string_iterator_handle iterator_handle);
+int mysql_string_iterator_islower(mysql_string_iterator_handle iterator_handle);
+int mysql_string_iterator_isdigit(mysql_string_iterator_handle iterator_handle);
+mysql_string_handle mysql_string_to_lowercase(mysql_string_handle
+                                              string_handle);
+void mysql_string_free(mysql_string_handle);
+void mysql_string_iterator_free(mysql_string_iterator_handle);
 struct st_mysql_xid {
   long formatID;
   long gtrid_length;

=== added file 'include/mysql/plugin_validate_password.h'
--- a/include/mysql/plugin_validate_password.h	1970-01-01 00:00:00 +0000
+++ b/include/mysql/plugin_validate_password.h	2012-05-21 14:22:56 +0000
@@ -0,0 +1,46 @@
+/* Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
+
+#ifndef MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED
+#define MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED
+
+/* API for validate_password plugin. (MYSQL_VALIDATE_PASSWORD_PLUGIN) */
+
+#include <mysql/plugin.h>
+#define MYSQL_VALIDATE_PASSWORD_INTERFACE_VERSION 0x0100
+
+/*  
+  The descriptor structure for the plugin, that is referred from
+  st_mysql_plugin.
+*/
+
+typedef void* mysql_string_handle;
+
+struct st_mysql_validate_password
+{
+  int interface_version;
+  /*  
+    This function retuns TRUE for passwords which satisfy the password
+    policy (as choosen by plugin variable) and FALSE for all other
+    password
+  */
+  int (*validate_password)(mysql_string_handle password);
+  /*  
+    This function returns the password strength (0-100) depending
+    upon the policies
+  */
+  int (*get_password_strength)(mysql_string_handle password);
+};
+#endif

=== added file 'include/mysql/service_mysql_string.h'
--- a/include/mysql/service_mysql_string.h	1970-01-01 00:00:00 +0000
+++ b/include/mysql/service_mysql_string.h	2012-05-21 14:22:56 +0000
@@ -0,0 +1,132 @@
+/* Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
+
+/* This service provides functions to parse mysql String */
+
+#ifndef MYSQL_SERVICE_MYSQL_STRING_INCLUDED
+#define MYSQL_SERVICE_MYSQL_STRING_INCLUDED
+
+#ifndef MYSQL_ABI_CHECK
+#include <stdlib.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *mysql_string_iterator_handle;
+typedef void *mysql_string_handle;
+
+extern struct mysql_string_service_st {
+  int (*mysql_string_convert_to_char_ptr_type)
+       (mysql_string_handle, const char *, char *, int *);
+  mysql_string_iterator_handle (*mysql_string_get_iterator_type)
+                                (mysql_string_handle);
+  int (*mysql_string_iterator_next_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_isupper_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_islower_type)(mysql_string_iterator_handle);
+  int (*mysql_string_iterator_isdigit_type)(mysql_string_iterator_handle);
+  mysql_string_handle (*mysql_string_to_lowercase_type)(mysql_string_handle);
+  void (*mysql_string_free_type)(mysql_string_handle);
+  void (*mysql_string_iterator_free_type)(mysql_string_iterator_handle);
+} *mysql_string_service;
+
+#ifdef MYSQL_DYNAMIC_PLUGIN
+
+#define mysql_string_convert_to_char_ptr(string_handle, charset_name, \
+                                         buffer, error) \
+        mysql_string_service->mysql_string_convert_to_char_ptr_type \
+                              (string_handle, charset_name, buffer, error)
+
+#define mysql_string_get_iterator(string_handle) \
+        mysql_string_service->mysql_string_get_iterator_type(string_handle)
+
+#define mysql_string_iterator_next(iterator_handle) \
+        mysql_string_service->mysql_string_iterator_next_type(iterator_handle)
+
+#define mysql_string_iterator_isupper(iterator_handle) \
+        mysql_string_service->mysql_string_iterator_isupper_type \
+                                     (iterator_handle)
+
+#define mysql_string_iterator_islower(iterator_handle) \
+        mysql_string_service->mysql_string_iterator_islower_type \
+                                     (iterator_handle)
+
+#define mysql_string_iterator_isdigit(iterator_handle) \
+        mysql_string_service->mysql_string_iterator_isdigit_type \
+                                     (iterator_handle)
+
+#define mysql_string_to_lowercase(string_handle) \
+        mysql_string_service->mysql_string_to_lowercase_type(string_handle)
+
+#define mysql_string_free(mysql_string_handle) \
+        mysql_string_service->mysql_string_free_type(mysql_string_handle)
+
+#define mysql_string_iterator_free(mysql_string_iterator_handle) \
+        mysql_string_service->mysql_string_iterator_free_type \
+                                  (mysql_string_iterator_handle)
+#else
+
+/* This service function convert string into given character set */
+int mysql_string_convert_to_char_ptr(mysql_string_handle string_handle,
+                                     const char *charset_name, char *buffer,
+                                     int *error);
+
+/* This service function returns the beginning of the iterator handle */
+mysql_string_iterator_handle mysql_string_get_iterator(mysql_string_handle
+                                                       string_handle);
+/*  
+  This service function gets the next iterator handle
+  returns 0 if reached the end else return 1
+*/
+int mysql_string_iterator_next(mysql_string_iterator_handle iterator_handle);
+
+/*  
+  This service function return 1 if current iterator handle points to a
+  uppercase character else return 0 for client character set.
+*/
+int mysql_string_iterator_isupper(mysql_string_iterator_handle iterator_handle);
+
+/*  
+  This service function return 1 if current iterator handle points to a
+  lowercase character else return 0 for client character set.
+*/
+int mysql_string_iterator_islower(mysql_string_iterator_handle iterator_handle);
+
+/*  
+  This service function return 1 if current iterator handle points to a digit
+  else return 0 for client character sets.
+*/
+int mysql_string_iterator_isdigit(mysql_string_iterator_handle iterator_handle);
+
+/* convert string_handle into lowercase */
+mysql_string_handle mysql_string_to_lowercase(mysql_string_handle
+                                              string_handle);
+
+/* It deallocates the string created on server side during plugin operations */
+void mysql_string_free(mysql_string_handle);
+
+/*  
+  It deallocates the string iterator created on server side
+  during plugin operations
+*/
+void mysql_string_iterator_free(mysql_string_iterator_handle);
+
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif

=== modified file 'include/mysql/services.h'
--- a/include/mysql/services.h	2011-06-30 15:50:45 +0000
+++ b/include/mysql/services.h	2012-05-21 14:22:56 +0000
@@ -23,6 +23,7 @@ extern "C" {
 #include <mysql/service_thd_wait.h>
 #include <mysql/service_thread_scheduler.h>
 #include <mysql/service_my_plugin_log.h>
+#include <mysql/service_mysql_string.h>
 
 #ifdef __cplusplus
 }

=== modified file 'include/service_versions.h'
--- a/include/service_versions.h	2011-06-30 15:50:45 +0000
+++ b/include/service_versions.h	2012-05-21 14:22:56 +0000
@@ -24,3 +24,4 @@
 #define VERSION_thd_wait        0x0100
 #define VERSION_my_thread_scheduler 0x0100
 #define VERSION_my_plugin_log 0x0100
+#define VERSION_mysql_string  0x0100

=== modified file 'libservices/CMakeLists.txt'
--- a/libservices/CMakeLists.txt	2011-06-30 15:50:45 +0000
+++ b/libservices/CMakeLists.txt	2012-05-21 14:22:56 +0000
@@ -20,7 +20,8 @@ SET(MYSQLSERVICES_SOURCES
   thd_alloc_service.c
   thd_wait_service.c
   my_plugin_log_service.c
-  my_thread_scheduler_service.c)
+  my_thread_scheduler_service.c
+  mysql_string_service.c)
 
 ADD_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
 INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)

=== added file 'libservices/mysql_string_service.c'
--- a/libservices/mysql_string_service.c	1970-01-01 00:00:00 +0000
+++ b/libservices/mysql_string_service.c	2012-05-21 14:22:56 +0000
@@ -0,0 +1,18 @@
+/*  Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
+    
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License as
+    published by the Free Software Foundation; version 2 of the
+    License.
+    
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+    GNU General Public License for more details.
+    
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION *mysql_string_service= (void*)VERSION_mysql_string;

=== added file 'mysql-test/include/have_validate_password_plugin.inc'
--- a/mysql-test/include/have_validate_password_plugin.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/have_validate_password_plugin.inc	2012-05-21 14:22:56 +0000
@@ -0,0 +1,20 @@
+#
+# Check if server has support for loading plugins
+#
+if (`SELECT @@have_dynamic_loading != 'YES'`) {
+  --skip validate password requires dynamic loading
+}
+
+#
+# Check if the variable VALIDATE_PASSWORD is set
+#
+if (!$VALIDATE_PASSWORD) {
+  --skip validate password requires the environment variable \$VALIDATE_PASSWORD to be set (normally done by mtr)
+}
+
+#
+# Check if --plugin-dir was setup for validate password
+#
+if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$VALIDATE_PASSWORD_OPT/'`) {
+  --skip validate password requires that --plugin-dir is set to the validate password dir (either the .opt file does not contain \$VALIDATE_PASSWORD_OPT or another plugin is in use)
+}

=== modified file 'mysql-test/include/plugin.defs'
--- a/mysql-test/include/plugin.defs	2012-02-20 16:29:18 +0000
+++ b/mysql-test/include/plugin.defs	2012-05-21 14:22:56 +0000
@@ -44,3 +44,4 @@ adt_null           plugin/audit_null  AU
 libdaemon_example  plugin/daemon_example DAEMONEXAMPLE
 libmemcached       plugin/innodb_memcached/daemon_memcached DAEMON_MEMCACHED daemon_memcached
 innodb_engine      plugin/innodb_memcached/innodb_memcache INNODB_ENGINE
+validate_password  plugin/password_validation VALIDATE_PASSWORD

=== added file 'mysql-test/r/validate_password_plugin.result'
--- a/mysql-test/r/validate_password_plugin.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/validate_password_plugin.result	2012-05-21 14:22:56 +0000
@@ -0,0 +1,104 @@
+CREATE USER 'base_user'@'localhost' IDENTIFIED BY 'pass';
+GRANT ALL ON mysql.* TO 'user1'@'localhost' IDENTIFIED BY 'pass';
+INSTALL PLUGIN validate_password SONAME 'validate_password.so';
+# password policy LOW (which only check for password length)
+# default case: password length should be minimum 8
+SET @@global.validate_password_policy_number=LOW;
+CREATE USER 'user'@'localhost' IDENTIFIED BY '';
+ERROR HY000: Your password does not satisfy the current policy requirements 
+SET PASSWORD FOR 'base_user'@'localhost'= PASSWORD('password');
+SET @@global.validate_password_length= 12;
+UPDATE mysql.user SET PASSWORD= PASSWORD('password') WHERE user='base_user';
+ERROR HY000: Your password does not satisfy the current policy requirements 
+GRANT USAGE ON *.* TO 'base_user'@'localhost' IDENTIFIED BY 'password1234';
+SET @@global.validate_password_length= 8;
+# password policy MEDIUM (check for mixed_case, digits, special_chars)
+# default case : atleast 1 mixed_case, 1 digit, 1 special_char
+SET @@global.validate_password_policy_number=MEDIUM;
+CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
+ERROR HY000: Your password does not satisfy the current policy requirements 
+SET PASSWORD FOR 'base_user'@'localhost'= PASSWORD('password1A#');
+SET @@global.validate_password_number_count= 2;
+UPDATE mysql.user SET PASSWORD= PASSWORD('password1A#') WHERE user='base_user';
+ERROR HY000: Your password does not satisfy the current policy requirements 
+UPDATE mysql.user SET PASSWORD= PASSWORD('password12A#') WHERE user='base_user';
+SET @@global.validate_password_number_count= 1;
+SET @@global.validate_password_mixed_case_count= 2;
+UPDATE mysql.user SET PASSWORD= PASSWORD('password1A#') WHERE user='base_user';
+ERROR HY000: Your password does not satisfy the current policy requirements 
+UPDATE mysql.user SET PASSWORD= PASSWORD('password1AB#') WHERE user='base_user';
+SET @@global.validate_password_mixed_case_count= 1;
+SET @@global.validate_password_special_char_count= 2;
+GRANT USAGE ON *.* TO 'base_user'@'localhost' IDENTIFIED BY 'password1A#';
+ERROR HY000: Your password does not satisfy the current policy requirements 
+GRANT USAGE ON *.* TO 'base_user'@'localhost' IDENTIFIED BY 'password1A#$';
+SET @@global.validate_password_special_char_count= 1;
+# No dictionary file present, no dictionary check
+SET @@global.validate_password_policy_number=STRONG;
+SET PASSWORD FOR 'base_user'@'localhost'= PASSWORD('password1A#');
+UPDATE mysql.user SET PASSWORD= PASSWORD('password1A#') WHERE user='base_user';
+UNINSTALL PLUGIN validate_password;
+# restarting the server with dictionary file.
+# Restart server.
+INSTALL PLUGIN validate_password SONAME 'validate_password.so';
+# password policy strong
+# default_file : dictionary.txt
+SET @@global.validate_password_policy_number=STRONG;
+CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
+ERROR HY000: Your password does not satisfy the current policy requirements 
+SET PASSWORD FOR 'base_user'@'localhost'= PASSWORD('password1A#');
+ERROR HY000: Your password does not satisfy the current policy requirements 
+UPDATE mysql.user SET PASSWORD= PASSWORD('pass12345A#') WHERE user='base_user';
+ERROR HY000: Your password does not satisfy the current policy requirements 
+UPDATE mysql.user SET PASSWORD= PASSWORD('pass0000A#') WHERE user='base_user';
+ERROR HY000: Your password does not satisfy the current policy requirements 
+GRANT USAGE ON *.* TO 'base_user'@'localhost' IDENTIFIED BY 'PA00wrd!#';
+# test for password_validate_strength function
+SELECT VALIDATE_PASSWORD_STRENGTH('password', 0);
+ERROR 42000: Incorrect parameter count in the call to native function 'VALIDATE_PASSWORD_STRENGTH'
+SELECT VALIDATE_PASSWORD_STRENGTH();
+ERROR 42000: Incorrect parameter count in the call to native function 'VALIDATE_PASSWORD_STRENGTH'
+SELECT VALIDATE_PASSWORD_STRENGTH('');
+VALIDATE_PASSWORD_STRENGTH('')
+0
+SELECT VALIDATE_PASSWORD_STRENGTH('pass');
+VALIDATE_PASSWORD_STRENGTH('pass')
+25
+SELECT VALIDATE_PASSWORD_STRENGTH('password');
+VALIDATE_PASSWORD_STRENGTH('password')
+50
+SELECT VALIDATE_PASSWORD_STRENGTH('password0000');
+VALIDATE_PASSWORD_STRENGTH('password0000')
+50
+SELECT VALIDATE_PASSWORD_STRENGTH('password1A#');
+VALIDATE_PASSWORD_STRENGTH('password1A#')
+75
+SELECT VALIDATE_PASSWORD_STRENGTH('PA12wrd!#');
+VALIDATE_PASSWORD_STRENGTH('PA12wrd!#')
+100
+SELECT VALIDATE_PASSWORD_STRENGTH('PA00wrd!#');
+VALIDATE_PASSWORD_STRENGTH('PA00wrd!#')
+100
+SET NAMES 'ujis';
+SELECT VALIDATE_PASSWORD_STRENGTH('PA12wrd!#');
+VALIDATE_PASSWORD_STRENGTH('PA12wrd!#')
+100
+SET @@global.validate_password_policy_number=MEDIUM;
+SET @@global.validate_password_policy_number=LOW;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SET @@global.validate_password_length= 4;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SET @@global.validate_password_special_char_count= 0;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SET @@global.validate_password_mixed_case_count= 0;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+CREATE USER 'user2'@'localhost' IDENTIFIED BY 'password';
+ERROR HY000: Your password does not satisfy the current policy requirements 
+CREATE USER 'user2'@'localhost' IDENTIFIED BY 'PA00wrd!#';
+UPDATE mysql.user SET PASSWORD= PASSWORD('password') WHERE user='user2';
+ERROR HY000: Your password does not satisfy the current policy requirements 
+UPDATE mysql.user SET PASSWORD= PASSWORD('PA00wrd!#') WHERE user='user2';
+DROP USER 'user2'@'localhost';
+DROP USER 'base_user'@'localhost';
+DROP USER 'user1'@'localhost';
+UNINSTALL PLUGIN validate_password;

=== added file 'mysql-test/t/validate_password_plugin-master.opt'
--- a/mysql-test/t/validate_password_plugin-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/validate_password_plugin-master.opt	2012-05-21 14:22:56 +0000
@@ -0,0 +1 @@
+$VALIDATE_PASSWORD_OPT

=== added file 'mysql-test/t/validate_password_plugin.test'
--- a/mysql-test/t/validate_password_plugin.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/validate_password_plugin.test	2012-05-21 14:22:56 +0000
@@ -0,0 +1,152 @@
+--source include/not_embedded.inc
+--source include/have_validate_password_plugin.inc
+
+let $MYSQL_ERRMSG_BASEDIR=`select @@lc_messages_dir`;
+
+# plugin is not installed so even 'pass' (very weak)
+# is accepted as a password
+CREATE USER 'base_user'@'localhost' IDENTIFIED BY 'pass';
+GRANT ALL ON mysql.* TO 'user1'@'localhost' IDENTIFIED BY 'pass';
+
+--replace_regex /\.dll/.so/
+eval INSTALL PLUGIN validate_password SONAME '$VALIDATE_PASSWORD';
+
+# test for all the three password policy
+# policy: LOW, MEDIUM, STRONG 
+
+--echo # password policy LOW (which only check for password length)
+--echo # default case: password length should be minimum 8
+
+SET @@global.validate_password_policy_number=LOW;
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user'@'localhost' IDENTIFIED BY '';
+SET PASSWORD FOR 'base_user'@'localhost'= PASSWORD('password');
+SET @@global.validate_password_length= 12;
+--error ER_NOT_VALID_PASSWORD
+UPDATE mysql.user SET PASSWORD= PASSWORD('password') WHERE user='base_user';
+GRANT USAGE ON *.* TO 'base_user'@'localhost' IDENTIFIED BY 'password1234';
+SET @@global.validate_password_length= 8;
+
+--echo # password policy MEDIUM (check for mixed_case, digits, special_chars)
+--echo # default case : atleast 1 mixed_case, 1 digit, 1 special_char
+
+SET @@global.validate_password_policy_number=MEDIUM;
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
+SET PASSWORD FOR 'base_user'@'localhost'= PASSWORD('password1A#');
+SET @@global.validate_password_number_count= 2;
+--error ER_NOT_VALID_PASSWORD
+UPDATE mysql.user SET PASSWORD= PASSWORD('password1A#') WHERE user='base_user';
+UPDATE mysql.user SET PASSWORD= PASSWORD('password12A#') WHERE user='base_user';
+SET @@global.validate_password_number_count= 1;
+SET @@global.validate_password_mixed_case_count= 2;
+--error ER_NOT_VALID_PASSWORD
+UPDATE mysql.user SET PASSWORD= PASSWORD('password1A#') WHERE user='base_user';
+UPDATE mysql.user SET PASSWORD= PASSWORD('password1AB#') WHERE user='base_user';
+SET @@global.validate_password_mixed_case_count= 1;
+SET @@global.validate_password_special_char_count= 2;
+--error ER_NOT_VALID_PASSWORD
+GRANT USAGE ON *.* TO 'base_user'@'localhost' IDENTIFIED BY 'password1A#';
+GRANT USAGE ON *.* TO 'base_user'@'localhost' IDENTIFIED BY 'password1A#$';
+SET @@global.validate_password_special_char_count= 1;
+
+--echo # No dictionary file present, no dictionary check
+SET @@global.validate_password_policy_number=STRONG;
+SET PASSWORD FOR 'base_user'@'localhost'= PASSWORD('password1A#');
+UPDATE mysql.user SET PASSWORD= PASSWORD('password1A#') WHERE user='base_user';
+
+UNINSTALL PLUGIN validate_password;
+
+--echo # restarting the server with dictionary file.
+
+# Write file to make mysql-test-run.pl wait for the server to stop
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Request shutdown
+-- send_shutdown
+
+# Call script that will poll the server waiting for it to disapear
+-- source include/wait_until_disconnected.inc
+
+--echo # Restart server.
+
+--exec echo "restart:--loose-validate_password_dictionary_file=$MYSQL_ERRMSG_BASEDIR/dictionary.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Turn on reconnect
+--enable_reconnect
+
+# Call script that will poll the server waiting for it to be back online again
+--source include/wait_until_connected_again.inc
+
+# Turn off reconnect again
+--disable_reconnect
+
+--replace_regex /\.dll/.so/
+eval INSTALL PLUGIN validate_password SONAME '$VALIDATE_PASSWORD';
+
+--echo # password policy strong
+--echo # default_file : dictionary.txt
+
+# file should contain 1 word per line
+# error if substring of password is a dictionary word
+
+SET @@global.validate_password_policy_number=STRONG;
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
+--error ER_NOT_VALID_PASSWORD
+SET PASSWORD FOR 'base_user'@'localhost'= PASSWORD('password1A#');
+--error ER_NOT_VALID_PASSWORD
+UPDATE mysql.user SET PASSWORD= PASSWORD('pass12345A#') WHERE user='base_user';
+--error ER_NOT_VALID_PASSWORD
+UPDATE mysql.user SET PASSWORD= PASSWORD('pass0000A#') WHERE user='base_user';
+GRANT USAGE ON *.* TO 'base_user'@'localhost' IDENTIFIED BY 'PA00wrd!#';
+
+--echo # test for password_validate_strength function
+
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT VALIDATE_PASSWORD_STRENGTH('password', 0);
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT VALIDATE_PASSWORD_STRENGTH();
+SELECT VALIDATE_PASSWORD_STRENGTH('');
+SELECT VALIDATE_PASSWORD_STRENGTH('pass');
+SELECT VALIDATE_PASSWORD_STRENGTH('password');
+SELECT VALIDATE_PASSWORD_STRENGTH('password0000');
+SELECT VALIDATE_PASSWORD_STRENGTH('password1A#');
+SELECT VALIDATE_PASSWORD_STRENGTH('PA12wrd!#');
+SELECT VALIDATE_PASSWORD_STRENGTH('PA00wrd!#');
+
+# Test for multibyte character set that have greater size when converted
+# from uppercase to lowercase.
+SET NAMES 'ujis';
+SELECT VALIDATE_PASSWORD_STRENGTH('PA12wrd!#');
+
+# default policy is set, all other plugin variables set to default
+# Test to ensure that only the privileged user can access the plugin variables
+SET @@global.validate_password_policy_number=MEDIUM;
+
+# New connection
+connect (plug_con,localhost,user1,pass);
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.validate_password_policy_number=LOW;
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.validate_password_length= 4;
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.validate_password_special_char_count= 0;
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.validate_password_mixed_case_count= 0;
+# user has the update/create privilege but needs to satisfy password policy
+# to update/create new account 
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user2'@'localhost' IDENTIFIED BY 'password';
+CREATE USER 'user2'@'localhost' IDENTIFIED BY 'PA00wrd!#';
+--error ER_NOT_VALID_PASSWORD
+UPDATE mysql.user SET PASSWORD= PASSWORD('password') WHERE user='user2';
+UPDATE mysql.user SET PASSWORD= PASSWORD('PA00wrd!#') WHERE user='user2';
+DROP USER 'user2'@'localhost';
+disconnect plug_con;
+--source include/wait_until_disconnected.inc
+
+connection default;
+DROP USER 'base_user'@'localhost';
+DROP USER 'user1'@'localhost';
+UNINSTALL PLUGIN validate_password;

=== added directory 'plugin/password_validation'
=== added file 'plugin/password_validation/CMakeLists.txt'
--- a/plugin/password_validation/CMakeLists.txt	1970-01-01 00:00:00 +0000
+++ b/plugin/password_validation/CMakeLists.txt	2012-05-21 14:22:56 +0000
@@ -0,0 +1,17 @@
+# Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+MYSQL_ADD_PLUGIN(validate_password validate_password.cc
+    MODULE_ONLY)

=== added file 'plugin/password_validation/validate_password.cc'
--- a/plugin/password_validation/validate_password.cc	1970-01-01 00:00:00 +0000
+++ b/plugin/password_validation/validate_password.cc	2012-05-21 14:22:56 +0000
@@ -0,0 +1,319 @@
+/* Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
+
+#include <my_sys.h>
+#include <string>
+#include <mysql/plugin_validate_password.h>
+#include <set>
+#include <iostream>
+#include <fstream>
+
+
+/*  
+  __attribute__(A) needs to be defined for Windows else complier
+  do not recognise it. Argument in plugin_init and plugin_deinit
+  Used in other plugins as well.
+*/
+#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__)  || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
+#define __attribute__(A)
+#endif
+
+#define MAX_DICTIONARY_FILE_LENGTH    1024 * 1024
+#define PASSWORD_SCORE                25
+#define MIN_DICTIONARY_WORD_LENGTH    4
+#define MAX_PASSWORD_LENGTH           100
+
+/*  
+  These are the 3 password policies that this plugin allow to set
+  and configure as per the requirements.
+*/
+
+enum password_policy_enum { PASSWORD_POLICY_LOW,
+                            PASSWORD_POLICY_MEDIUM,
+                            PASSWORD_POLICY_STRONG
+};
+
+static const char* policy_names[] = { "LOW", "MEDIUM", "STRONG", NullS };
+
+static TYPELIB password_policy_typelib_t = {
+        array_elements(policy_names) - 1,
+        "password_policy_typelib_t",
+        policy_names,
+        NULL
+};
+
+typedef std::string string_type;
+typedef std::set<string_type> set_type;
+static set_type dictionary_words;
+
+static int validate_password_length;
+static int validate_password_number_count;
+static int validate_password_mixed_case_count;
+static int validate_password_special_char_count;
+static ulong validate_password_policy_number;
+static char *validate_password_dictionary_file;
+
+/* To read dictionary file into std::set */
+static void read_dictionary_file()
+{
+  string_type words;
+  long file_length;
+
+  if (validate_password_dictionary_file == NULL)
+    return;
+  std::ifstream dictionary_stream(validate_password_dictionary_file);
+  if (!dictionary_stream)
+    return;
+  dictionary_stream.seekg(0, std::ios::end);
+  file_length= dictionary_stream.tellg();
+  dictionary_stream.seekg(0, std::ios::beg);
+  if (file_length > MAX_DICTIONARY_FILE_LENGTH)
+  {
+    dictionary_stream.close();
+    return;
+  }
+  while (dictionary_stream.good())
+  {
+    std::getline(dictionary_stream, words);
+    dictionary_words.insert(words);
+  }
+  dictionary_stream.close();
+}
+
+/* Clear words from std::set */
+static void free_dictionary_file()
+{
+  if (!dictionary_words.empty())
+    dictionary_words.clear();
+}
+
+/*  
+  Checks weather password or substring of password
+  is present in dictionary file stored as std::set
+*/
+static int validate_dictionary_check(mysql_string_handle password)
+{
+  int length;
+  int error= 0;
+  char *buffer;
+  mysql_string_handle lower_string_handle= mysql_string_to_lowercase(password);
+  if (!(buffer= (char*) malloc(MAX_PASSWORD_LENGTH)))
+    return (0);
+
+  if ((length= mysql_string_convert_to_char_ptr(lower_string_handle, "utf8",
+                                         buffer, &error)) > 0 && error == 0)
+     buffer[length]= '\0';
+
+  int substr_pos= 0;
+  int substr_length= length;
+  string_type password_str= (const char *)buffer;
+  string_type password_substr;
+  set_type::iterator itr;
+  /*  
+    std::set as container stores the dictionary words,
+    binary comparison between dictionary words and password
+  */
+  if (!dictionary_words.empty())
+  {
+    while (substr_length >= MIN_DICTIONARY_WORD_LENGTH)
+    {
+      substr_pos= 0;
+      while (substr_pos + substr_length <= length)
+      {
+        password_substr= password_str.substr(substr_pos, substr_length);
+        itr= dictionary_words.find(password_substr);
+        if (itr != dictionary_words.end())
+        {
+          free(buffer);
+          return (0);
+        }
+        substr_pos++;
+      }
+      substr_length--;
+    }
+  }
+  free(buffer);
+  return (1);
+}
+
+static int validate_password_policy(mysql_string_handle password, int policy)
+{
+  int has_digit= 0;
+  int has_lower= 0;
+  int has_upper= 0;
+  int has_special_chars= 0;
+  int n_chars= 0;
+  mysql_string_iterator_handle iter;
+
+  iter = mysql_string_get_iterator(password);
+  while(mysql_string_iterator_next(iter))
+  {
+    n_chars++;
+    if (policy > PASSWORD_POLICY_LOW)
+    {
+      if (mysql_string_iterator_islower(iter))
+        has_lower++;
+      else if (mysql_string_iterator_isupper(iter))
+        has_upper++;
+      else if (mysql_string_iterator_isdigit(iter))
+        has_digit++;
+      else
+        has_special_chars++;
+    }
+  }
+
+  mysql_string_iterator_free(iter);
+  if (n_chars >= validate_password_length)
+  {
+    if (policy == PASSWORD_POLICY_LOW)
+      return (1);
+    if (has_upper >= validate_password_mixed_case_count &&
+        has_lower >= validate_password_mixed_case_count &&
+        has_special_chars >= validate_password_special_char_count &&
+        has_digit >= validate_password_number_count)
+    {
+      if (policy == PASSWORD_POLICY_MEDIUM || validate_dictionary_check
+                                              (password))
+        return (1);
+    }
+  }
+  return (0);
+}
+
+/* Actual plugin function which acts as a wrapper */
+static int validate_password(mysql_string_handle password)
+{
+  return validate_password_policy(password, validate_password_policy_number);
+}
+
+/* Password strength between (0-100) */
+static int get_password_strength(mysql_string_handle password)
+{
+  int policy= 0;
+  int n_chars= 0;
+  mysql_string_iterator_handle iter;
+
+  iter = mysql_string_get_iterator(password);
+  while(mysql_string_iterator_next(iter))
+    n_chars++;
+  
+  mysql_string_iterator_free(iter);
+  if (n_chars < MIN_DICTIONARY_WORD_LENGTH)
+    return (policy);
+  if (n_chars < validate_password_length)
+    return (PASSWORD_SCORE);
+  else
+  {
+    policy= PASSWORD_POLICY_LOW;
+    if (validate_password_policy(password, PASSWORD_POLICY_MEDIUM))
+    {
+      policy= PASSWORD_POLICY_MEDIUM;
+      if (validate_dictionary_check(password))
+        policy= PASSWORD_POLICY_STRONG;
+    }
+  }
+  return ((policy+1) * PASSWORD_SCORE + PASSWORD_SCORE);
+}
+
+/* Plugin type-specific descriptor */
+static struct st_mysql_validate_password validate_password_descriptor=
+{
+  MYSQL_VALIDATE_PASSWORD_INTERFACE_VERSION,
+  validate_password,                         /* validate function          */
+  get_password_strength                      /* validate strength function */
+};
+
+/*  
+  Initialize the password plugin at server start or plugin installation,
+  read dictionary file into std::set.
+*/
+
+static int validate_password_init(void *arg __attribute__((unused)))
+{
+  read_dictionary_file();
+  return (0);
+}
+
+/*  
+  Terminate the password plugin at server shutdown or plugin deinstallation.
+  It empty the std::set and returns 0
+*/
+
+static int validate_password_deinit(void *arg __attribute__((unused)))
+{
+  free_dictionary_file();
+  return (0);
+}
+
+/* Plugin system variables */
+
+static MYSQL_SYSVAR_INT(length, validate_password_length,
+  PLUGIN_VAR_RQCMDARG,
+  "Password validate length to check for minimum password_length",
+  NULL, NULL, 8, 0, 0, 0);
+
+static MYSQL_SYSVAR_INT(number_count, validate_password_number_count,
+  PLUGIN_VAR_RQCMDARG,
+  "password validate digit to ensure minimum numeric character in password",
+  NULL, NULL, 1, 0, 0, 0);
+
+static MYSQL_SYSVAR_INT(mixed_case_count, validate_password_mixed_case_count,
+  PLUGIN_VAR_RQCMDARG,
+  "Password validate mixed case to ensure minimum upper/lower case in password",
+  NULL, NULL, 1, 0, 0, 0);
+
+static MYSQL_SYSVAR_INT(special_char_count,
+  validate_password_special_char_count, PLUGIN_VAR_RQCMDARG,
+  "password validate special to ensure minimum special character in password",
+  NULL, NULL, 1, 0, 0, 0);
+
+static MYSQL_SYSVAR_ENUM(policy_number, validate_password_policy_number,
+  PLUGIN_VAR_RQCMDARG,
+  "password_validate_policy choosen policy to validate password"
+  "possible values are LOW MEDIUM (default), STRONG",
+  NULL, NULL, PASSWORD_POLICY_MEDIUM, &password_policy_typelib_t);
+
+static MYSQL_SYSVAR_STR(dictionary_file, validate_password_dictionary_file,
+  PLUGIN_VAR_READONLY,
+  "password_validate_dictionary file to be loaded and check for password",
+  NULL, NULL, NULL);
+
+static struct st_mysql_sys_var* validate_password_system_variables[]= {
+  MYSQL_SYSVAR(length),
+  MYSQL_SYSVAR(number_count),
+  MYSQL_SYSVAR(mixed_case_count),
+  MYSQL_SYSVAR(special_char_count),
+  MYSQL_SYSVAR(policy_number),
+  MYSQL_SYSVAR(dictionary_file),
+  NULL
+};
+
+mysql_declare_plugin(validate_password)
+{
+  MYSQL_VALIDATE_PASSWORD_PLUGIN,     /*   type                            */
+  &validate_password_descriptor,      /*   descriptor                      */
+  "validate_password",                /*   name                            */
+  "Oracle Corporation",               /*   author                          */
+  "check password strength",          /*   description                     */
+  PLUGIN_LICENSE_GPL,
+  validate_password_init,             /*   init function (when loaded)     */
+  validate_password_deinit,           /*   deinit function (when unloaded) */
+  0x0100,                             /*   version                         */
+  NULL,
+  validate_password_system_variables, /*   system variables                */
+  NULL,
+  0,
+}
+mysql_declare_plugin_end;

=== modified file 'sql/CMakeLists.txt'
--- a/sql/CMakeLists.txt	2012-05-18 14:39:25 +0000
+++ b/sql/CMakeLists.txt	2012-05-21 14:22:56 +0000
@@ -114,6 +114,7 @@ SET(SQL_SHARED_SOURCES
   sp_pcontext.cc 
   sp_rcontext.cc
   spatial.cc
+  string_service.cc
   sql_acl.cc
   sql_admin.cc
   sql_alloc_error_handler.cc

=== modified file 'sql/item_create.cc'
--- a/sql/item_create.cc	2012-05-16 11:03:43 +0000
+++ b/sql/item_create.cc	2012-05-21 14:22:56 +0000
@@ -2481,6 +2481,19 @@ protected:
 };
 
 
+class Create_func_validate_password_strength : public Create_func_arg1
+{
+public:
+  virtual Item *create(THD *thd, Item *arg1);
+
+  static Create_func_validate_password_strength s_singleton;
+
+protected:
+  Create_func_validate_password_strength() {}
+  virtual ~Create_func_validate_password_strength() {}
+};
+
+
 class Create_func_version : public Create_func_arg0
 {
 public:
@@ -5181,6 +5194,16 @@ Create_func_uuid_short::create(THD *thd)
 }
 
 
+Create_func_validate_password_strength
+                     Create_func_validate_password_strength::s_singleton;
+
+Item*
+Create_func_validate_password_strength::create(THD *thd, Item *arg1)
+{
+  return new (thd->mem_root) Item_func_validate_password_strength(arg1);
+}
+
+
 Create_func_version Create_func_version::s_singleton;
 
 Item*
@@ -5608,6 +5631,7 @@ static Native_func_registry func_array[]
   { { C_STRING_WITH_LEN("UPPER") }, BUILDER(Create_func_ucase)},
   { { C_STRING_WITH_LEN("UUID") }, BUILDER(Create_func_uuid)},
   { { C_STRING_WITH_LEN("UUID_SHORT") }, BUILDER(Create_func_uuid_short)},
+  { { C_STRING_WITH_LEN("VALIDATE_PASSWORD_STRENGTH") }, BUILDER(Create_func_validate_password_strength)},
   { { C_STRING_WITH_LEN("VERSION") }, BUILDER(Create_func_version)},
   { { C_STRING_WITH_LEN("WEEKDAY") }, BUILDER(Create_func_weekday)},
   { { C_STRING_WITH_LEN("WEEKOFYEAR") }, BUILDER(Create_func_weekofyear)},

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2012-05-18 14:08:49 +0000
+++ b/sql/item_func.cc	2012-05-21 14:22:56 +0000
@@ -3219,6 +3219,15 @@ void Item_func_locate::print(String *str
 }
 
 
+longlong Item_func_validate_password_strength::val_int()
+{
+  String *field;
+  if (!(field= args[0]->val_str(&value)))
+    return 0;
+  return (check_password_strength(field));
+}
+
+
 longlong Item_func_field::val_int()
 {
   DBUG_ASSERT(fixed == 1);

=== modified file 'sql/item_func.h'
--- a/sql/item_func.h	2012-05-18 14:08:49 +0000
+++ b/sql/item_func.h	2012-05-21 14:22:56 +0000
@@ -1106,6 +1106,17 @@ public:
 };
 
 
+class Item_func_validate_password_strength :public Item_int_func
+{
+  String value;
+public:
+  Item_func_validate_password_strength(Item *a) :Item_int_func(a) {}
+  longlong val_int();
+  const char *func_name() const { return "validate_password_strength"; }
+  void fix_length_and_dec() { max_length=10; }
+};
+
+
 class Item_func_field :public Item_int_func
 {
   String value,tmp;

=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc	2012-04-17 14:37:50 +0000
+++ b/sql/item_strfunc.cc	2012-05-21 14:22:56 +0000
@@ -1925,6 +1925,7 @@ String *Item_func_password::val_str_asci
   String *res= args[0]->val_str(str); 
   if ((null_value=args[0]->null_value))
     return 0;
+  check_password_policy(res);
   if (res->length() == 0)
     return make_empty_result();
   my_make_scrambled_password(tmp_value, res->ptr(), res->length());
@@ -1937,7 +1938,12 @@ char *Item_func_password::alloc(THD *thd
 {
   char *buff= (char *) thd->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH+1);
   if (buff)
+  {
+    String *password_str= new (thd->mem_root)String(password, thd->variables.
+                                                    character_set_client);
+    check_password_policy(password_str);
     my_make_scrambled_password(buff, password, pass_len);
+  }
   return buff;
 }
 
@@ -1949,6 +1955,7 @@ String *Item_func_old_password::val_str_
   String *res= args[0]->val_str(str);
   if ((null_value=args[0]->null_value))
     return 0;
+  check_password_policy(res);
   if (res->length() == 0)
     return make_empty_result();
   my_make_scrambled_password_323(tmp_value, res->ptr(), res->length());
@@ -1961,7 +1968,12 @@ char *Item_func_old_password::alloc(THD
 {
   char *buff= (char *) thd->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH_323+1);
   if (buff)
+  {
+    String *password_str= new (thd->mem_root)String(password, thd->variables.
+                                                    character_set_client);
+    check_password_policy(password_str);
     my_make_scrambled_password_323(buff, password, pass_len);
+  }
   return buff;
 }
 

=== modified file 'sql/share/CMakeLists.txt'
--- a/sql/share/CMakeLists.txt	2011-06-30 15:46:53 +0000
+++ b/sql/share/CMakeLists.txt	2012-05-21 14:22:56 +0000
@@ -42,6 +42,7 @@ serbian
 
 SET(files 
  errmsg-utf8.txt
+ dictionary.txt
 )
 
 FOREACH (dir ${dirs})
@@ -51,5 +52,5 @@ ENDFOREACH()
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/charsets DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server
   PATTERN "languages.html" EXCLUDE
 )
-
+CONFIGURE_FILE(dictionary.txt ${CMAKE_BINARY_DIR}/sql/share/dictionary.txt)
 INSTALL(FILES ${files} DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server)

=== added file 'sql/share/dictionary.txt'
--- a/sql/share/dictionary.txt	1970-01-01 00:00:00 +0000
+++ b/sql/share/dictionary.txt	2012-05-21 14:22:56 +0000
@@ -0,0 +1,3538 @@
+0000
+1111
+123456
+12345
+password
+password1
+123456789
+12345678
+1234567890
+abc123
+computer
+tigger
+1234
+qwerty
+money
+carmen
+mickey
+secret
+summer
+internet
+a1b2c3
+service
+canada
+hello
+ranger
+shadow
+baseball
+donald
+harley
+hockey
+letmein
+maggie
+mike
+mustang
+snoopy
+buster
+dragon
+jordan
+michael
+michelle
+mindy
+patrick
+123abc
+andrew
+bear
+calvin
+changeme
+diamond
+fuckme
+fuckyou
+matthew
+miller
+tiger
+trustno1
+alex
+apple
+avalon
+brandy
+chelsea
+coffee
+falcon
+freedom
+gandalf
+green
+helpme
+linda
+magic
+merlin
+newyork
+soccer
+thomas
+wizard
+asdfgh
+bandit
+batman
+boris
+butthead
+dorothy
+eeyore
+fishing
+football
+george
+happy
+iloveyou
+jennifer
+jonathan
+love
+marina
+master
+missy
+monday
+monkey
+natasha
+ncc1701
+pamela
+pepper
+piglet
+poohbear
+pookie
+rabbit
+rachel
+rocket
+rose
+smile
+sparky
+spring
+steven
+success
+sunshine
+victoria
+whatever
+zapata
+8675309
+amanda
+andy
+angel
+august
+barney
+biteme
+boomer
+brian
+casey
+cowboy
+delta
+doctor
+fisher
+island
+john
+joshua
+karen
+marley
+orange
+please
+rascal
+richard
+sarah
+scooter
+shalom
+silver
+skippy
+stanley
+taylor
+welcome
+zephyr
+111111
+aaaaaa
+access
+albert
+alexander
+andrea
+anna
+anthony
+asdfjkl;
+ashley
+basketball
+beavis
+black
+bob
+booboo
+bradley
+brandon
+buddy
+caitlin
+camaro
+charlie
+chicken
+chris
+cindy
+cricket
+dakota
+dallas
+daniel
+david
+debbie
+dolphin
+elephant
+emily
+friend
+fucker
+ginger
+goodluck
+hammer
+heather
+iceman
+jason
+jessica
+jesus
+joseph
+jupiter
+justin
+kevin
+knight
+lacrosse
+lakers
+lizard
+madison
+mary
+mother
+muffin
+murphy
+nirvana
+paris
+pentium
+phoenix
+picture
+rainbow
+sandy
+saturn
+scott
+shannon
+shithead
+skeeter
+sophie
+special
+stephanie
+stephen
+steve
+sweetie
+teacher
+tennis
+test
+test123
+tommy
+topgun
+tristan
+wally
+william
+wilson
+1q2w3e
+654321
+666666
+a12345
+a1b2c3d4
+alpha
+amber
+angela
+angie
+archie
+asdf
+blazer
+bond007
+booger
+charles
+christin
+claire
+control
+danny
+david1
+dennis
+digital
+disney
+edward
+elvis
+felix
+flipper
+franklin
+frodo
+honda
+horses
+hunter
+indigo
+james
+jasper
+jeremy
+julian
+kelsey
+killer
+lauren
+marie
+maryjane
+matrix
+maverick
+mayday
+mercury
+mitchell
+morgan
+mountain
+niners
+nothing
+oliver
+peace
+peanut
+pearljam
+phantom
+popcorn
+princess
+psycho
+pumpkin
+purple
+randy
+rebecca
+reddog
+robert
+rocky
+roses
+salmon
+samson
+sharon
+sierra
+smokey
+startrek
+steelers
+stimpy
+sunflower
+superman
+support
+sydney
+techno
+walter
+willie
+willow
+winner
+ziggy
+zxcvbnm
+alaska
+alexis
+alice
+animal
+apples
+barbara
+benjamin
+billy
+blue
+bluebird
+bobby
+bonnie
+bubba
+camera
+chocolate
+clark
+claudia
+cocacola
+compton
+connect
+cookie
+cruise
+douglas
+dreamer
+dreams
+duckie
+eagles
+eddie
+einstein
+enter
+explorer
+faith
+family
+ferrari
+flamingo
+flower
+foxtrot
+francis
+freddy
+friday
+froggy
+giants
+gizmo
+global
+goofy
+happy1
+hendrix
+henry
+herman
+homer
+honey
+house
+houston
+iguana
+indiana
+insane
+inside
+irish
+ironman
+jake
+jasmin
+jeanne
+jerry
+joey
+justice
+katherine
+kermit
+kitty
+koala
+larry
+leslie
+logan
+lucky
+mark
+martin
+matt
+minnie
+misty
+mitch
+mouse
+nancy
+nascar
+nelson
+pantera
+parker
+penguin
+peter
+piano
+pizza
+prince
+punkin
+pyramid
+raymond
+robin
+roger
+rosebud
+route66
+royal
+running
+sadie
+sasha
+security
+sheena
+sheila
+skiing
+snapple
+snowball
+sparrow
+spencer
+spike
+star
+stealth
+student
+sunny
+sylvia
+tamara
+taurus
+teresa
+theresa
+thunderbird
+tigers
+tony
+toyota
+travel
+tuesday
+victory
+viper1
+wesley
+whisky
+winnie
+winter
+wolves
+xyz123
+zorro
+123123
+1234567
+696969
+888888
+Anthony
+Joshua
+Matthew
+Tigger
+aaron
+abby
+abcdef
+adidas
+adrian
+alfred
+arthur
+athena
+austin
+awesome
+badger
+bamboo
+beagle
+bears
+beatles
+beautiful
+beaver
+benny
+bigmac
+bingo
+bitch
+blonde
+boogie
+boston
+brenda
+bright
+bubba1
+bubbles
+buffy
+button
+buttons
+cactus
+candy
+captain
+carlos
+caroline
+carrie
+casper
+catch22
+chance
+charity
+charlotte
+cheese
+cheryl
+chloe
+chris1
+clancy
+compaq
+conrad
+cooper
+cooter
+copper
+cosmos
+cougar
+cracker
+crawford
+crystal
+curtis
+cyclone
+dance
+diablo
+dollars
+dookie
+dumbass
+dundee
+elizabeth
+eric
+europe
+farmer
+firebird
+fletcher
+fluffy
+france
+freak1
+friends
+fuckoff
+gabriel
+galaxy
+gambit
+garden
+garfield
+garnet
+genesis
+genius
+godzilla
+golfer
+goober
+grace
+greenday
+groovy
+grover
+guitar
+hacker
+harry
+hazel
+hector
+herbert
+horizon
+hornet
+howard
+icecream
+imagine
+impala
+jack
+janice
+jasmine
+jason1
+jeanette
+jeffrey
+jenifer
+jenni
+jesus1
+jewels
+joker
+julie
+julie1
+junior
+justin1
+kathleen
+keith
+kelly
+kelly1
+kennedy
+kevin1
+knicks
+larry1
+leonard
+lestat
+library
+lincoln
+lionking
+london
+louise
+lucky1
+lucy
+maddog
+margaret
+mariposa
+marlboro
+martin1
+marty
+master1
+mensuck
+mercedes
+metal
+midori
+mikey
+millie
+mirage
+molly
+monet
+money1
+monica
+monopoly
+mookie
+moose
+moroni
+music
+naomi
+nathan
+nguyen
+nicholas
+nicole
+nimrod
+october
+olive
+olivia
+online
+oscar
+oxford
+pacific
+painter
+peaches
+penelope
+pepsi
+petunia
+philip
+phoenix1
+photo
+pickle
+player
+poiuyt
+porsche
+porter
+puppy
+python
+quality
+raquel
+raven
+remember
+robbie
+robert1
+roman
+rugby
+runner
+russell
+ryan
+sailing
+sailor
+samantha
+savage
+scarlett
+school
+sean
+seven
+shadow1
+sheba
+shelby
+shit
+shoes
+simba
+simple
+skipper
+smiley
+snake
+snickers
+sniper
+snoopdog
+snowman
+sonic
+spitfire
+sprite
+spunky
+starwars
+station
+stella
+stingray
+storm
+stormy
+stupid
+sunny1
+sunrise
+surfer
+susan
+tammy
+tango
+tanya
+teddy1
+theboss
+theking
+thumper
+tina
+tintin
+tomcat
+trebor
+trevor
+tweety
+unicorn
+valentine
+valerie
+vanilla
+veronica
+victor
+vincent
+viper
+warrior
+warriors
+weasel
+wheels
+wilbur
+winston
+wisdom
+wombat
+xavier
+yellow
+zeppelin
+1111
+1212
+Andrew
+Family
+Friends
+Michael
+Michelle
+Snoopy
+abcd1234
+abcdefg
+abigail
+account
+adam
+alex1
+alice1
+allison
+alpine
+andre1
+andrea1
+angel1
+anita
+annette
+antares
+apache
+apollo
+aragorn
+arizona
+arnold
+arsenal
+asdfasdf
+asdfg
+asdfghjk
+avenger
+baby
+babydoll
+bailey
+banana
+barry
+basket
+batman1
+beaner
+beast
+beatrice
+bella
+bertha
+bigben
+bigdog
+biggles
+bigman
+binky
+biology
+bishop
+blondie
+bluefish
+bobcat
+bosco
+braves
+brazil
+bruce
+bruno
+brutus
+buffalo
+bulldog
+bullet
+bullshit
+bunny
+business
+butch
+butler
+butter
+california
+carebear
+carol
+carol1
+carole
+cassie
+castle
+catalina
+catherine
+cccccc
+celine
+center
+champion
+chanel
+chaos
+chelsea1
+chester1
+chicago
+chico
+christian
+christy
+church
+cinder
+colleen
+colorado
+columbia
+commander
+connie
+cookies
+cooking
+corona
+cowboys
+coyote
+craig
+creative
+cuddles
+cuervo
+cutie
+daddy
+daisy
+daniel1
+danielle
+davids
+death
+denis
+derek
+design
+destiny
+diana
+diane
+dickhead
+digger
+dodger
+donna
+dougie
+dragonfly
+dylan
+eagle
+eclipse
+electric
+emerald
+etoile
+excalibur
+express
+fender
+fiona
+fireman
+flash
+florida
+flowers
+foster
+francesco
+francine
+francois
+frank
+french
+fuckface
+gemini
+general
+gerald
+germany
+gilbert
+goaway
+golden
+goldfish
+goose
+gordon
+graham
+grant
+gregory
+gretchen
+gunner
+hannah
+harold
+harrison
+harvey
+hawkeye
+heaven
+heidi
+helen
+helena
+hithere
+hobbit
+ibanez
+idontknow
+integra
+ireland
+irene
+isaac
+isabel
+jackass
+jackie
+jackson
+jaguar
+jamaica
+japan
+jenny1
+jessie
+johan
+johnny
+joker1
+jordan23
+judith
+julia
+jumanji
+kangaroo
+karen1
+kathy
+keepout
+keith1
+kenneth
+kimberly
+kingdom
+kitkat
+kramer
+kristen
+laura
+laurie
+lawrence
+lawyer
+legend
+liberty
+light
+lindsay
+lindsey
+lisa
+liverpool
+lola
+lonely
+louis
+lovely
+loveme
+lucas
+madonna
+malcolm
+malibu
+marathon
+marcel
+maria1
+mariah
+mariah1
+marilyn
+mario
+marvin
+maurice
+maxine
+maxwell
+me
+meggie
+melanie
+melissa
+melody
+mexico
+michael1
+michele
+midnight
+mike1
+miracle
+misha
+mishka
+molly1
+monique
+montreal
+moocow
+moore
+morris
+mouse1
+mulder
+nautica
+nellie
+newton
+nick
+nirvana1
+nissan
+norman
+notebook
+ocean
+olivier
+ollie
+oranges
+oregon
+orion
+panda
+pandora
+panther
+passion
+patricia
+pearl
+peewee
+pencil
+penny
+people
+percy
+person
+peter1
+petey
+picasso
+pierre
+pinkfloyd
+polaris
+police
+pookie1
+poppy
+power
+predator
+preston
+q1w2e3
+queen
+queenie
+quentin
+ralph
+random
+rangers
+raptor
+reality
+redrum
+remote
+reynolds
+rhonda
+ricardo
+ricardo1
+ricky
+river
+roadrunner
+robinhood
+rocknroll
+rocky1
+ronald
+roxy
+ruthie
+sabrina
+sakura
+sally
+sampson
+samuel
+sandra
+santa
+sapphire
+scarlet
+scorpio
+scott1
+scottie
+scruffy
+seattle
+serena
+shanti
+shark
+shogun
+simon
+singer
+skull
+skywalker
+slacker
+smashing
+smiles
+snowflake
+snuffy
+soccer1
+soleil
+sonny
+spanky
+speedy
+spider
+spooky
+stacey
+star69
+start
+steven1
+stinky
+strawberry
+stuart
+sugar
+sundance
+superfly
+suzanne
+suzuki
+swimmer
+swimming
+system
+taffy
+tarzan
+teddy
+teddybear
+terry
+theatre
+thunder
+thursday
+tinker
+tootsie
+tornado
+tracy
+tricia
+trident
+trojan
+truman
+trumpet
+tucker
+turtle
+tyler
+utopia
+voyager
+warcraft
+warlock
+warren
+water
+wayne
+wendy
+williams
+willy
+winona
+woody
+woofwoof
+wrangler
+wright
+xfiles
+xxxxxx
+yankees
+yvonne
+zebra
+zenith
+zigzag
+zombie
+zxc123
+zxcvb
+000000
+007007
+11111
+11111111
+123321
+171717
+181818
+1a2b3c
+1chris
+4runner
+54321
+55555
+6969
+7777777
+789456
+88888888
+Alexis
+Bailey
+Charlie
+Chris
+Daniel
+Dragon
+Elizabeth
+HARLEY
+Heather
+Jennifer
+Jessica
+Jordan
+KILLER
+Nicholas
+Password
+Princess
+Purple
+Rebecca
+Robert
+Shadow
+Steven
+Summer
+Sunshine
+Superman
+Taylor
+Thomas
+Victoria
+abcd123
+abcde
+accord
+active
+africa
+airborne
+alfaro
+alicia
+aliens
+alina
+aline
+alison
+allen
+aloha
+alpha1
+althea
+altima
+amanda1
+amazing
+america
+amour
+anderson
+andre
+andrew1
+andromeda
+angels
+angie1
+annie
+anything
+apple1
+apple2
+applepie
+april
+aquarius
+ariane
+ariel
+arlene
+artemis
+asdf1234
+asdfjkl
+ashley1
+ashraf
+ashton
+asterix
+attila
+autumn
+avatar
+babes
+bambi
+barbie
+barney1
+barrett
+bball
+beaches
+beanie
+beans
+beauty
+becca
+belize
+belle
+belmont
+benji
+benson
+bernardo
+berry
+betsy
+betty
+bigboss
+bigred
+billy1
+birdie
+birthday
+biscuit
+bitter
+blackjack
+blah
+blanche
+blood
+blowjob
+blowme
+blueeyes
+blues
+bogart
+bombay
+boobie
+boots
+bootsie
+boxers
+brandi
+brent
+brewster
+bridge
+bronco
+bronte
+brooke
+brother
+bryan
+bubble
+buddha
+budgie
+burton
+butterfly
+byron
+calendar
+calvin1
+camel
+camille
+campbell
+camping
+cancer
+canela
+cannon
+carbon
+carnage
+carolyn
+carrot
+cascade
+catfish
+cathy
+catwoman
+cecile
+celica
+change
+chantal
+charger
+cherry
+chiara
+chiefs
+china
+chris123
+christ1
+christmas
+christopher
+chuck
+cindy1
+cinema
+civic
+claude
+clueless
+cobain
+cobra
+cody
+colette
+college
+colors
+colt45
+confused
+cool
+corvette
+cosmo
+country
+crusader
+cunningham
+cupcake
+cynthia
+dagger
+dammit
+dancer
+daphne
+darkstar
+darren
+darryl
+darwin
+deborah
+december
+deedee
+deeznuts
+delano
+delete
+demon
+denise
+denny
+desert
+deskjet
+detroit
+devil
+devine
+devon
+dexter
+dianne
+diesel
+director
+dixie
+dodgers
+doggy
+dollar
+dolly
+dominique
+domino
+dontknow
+doogie
+doudou
+downtown
+dragon1
+driver
+dude
+dudley
+dutchess
+dwight
+eagle1
+easter
+eastern
+edith
+edmund
+eight
+element
+elissa
+ellen
+elliot
+empire
+enigma
+enterprise
+erin
+escort
+estelle
+eugene
+evelyn
+explore
+family1
+fatboy
+felipe
+ferguson
+ferret
+ferris
+fireball
+fishes
+fishie
+flight
+florida1
+flowerpot
+forward
+freddie
+freebird
+freeman
+frisco
+fritz
+froggie
+froggies
+frogs
+fucku
+future
+gabby
+games
+garcia
+gaston
+gateway
+george1
+georgia
+german
+germany1
+getout
+ghost
+gibson
+giselle
+gmoney
+goblin
+goblue
+gollum
+grandma
+gremlin
+grizzly
+grumpy
+guess
+guitar1
+gustavo
+haggis
+haha
+hailey
+halloween
+hamilton
+hamlet
+hanna
+hanson
+happy123
+happyday
+hardcore
+harley1
+harriet
+harris
+harvard
+health
+heart
+heather1
+heather2
+hedgehog
+helene
+hello1
+hello123
+hellohello
+hermes
+heythere
+highland
+hilda
+hillary
+history
+hitler
+hobbes
+holiday
+holly
+honda1
+hongkong
+hootie
+horse
+hotrod
+hudson
+hummer
+huskies
+idiot
+iforget
+iloveu
+impact
+indonesia
+irina
+isabelle
+israel
+italia
+italy
+jackie1
+jacob
+jakey
+james1
+jamesbond
+jamie
+jamjam
+jeffrey1
+jennie
+jenny
+jensen
+jesse
+jesse1
+jester
+jethro
+jimbob
+jimmy
+joanna
+joelle
+john316
+jordie
+jorge
+josh
+journey
+joyce
+jubilee
+jules
+julien
+juliet
+junebug
+juniper
+justdoit
+karin
+karine
+karma
+katerina
+katie
+katie1
+kayla
+keeper
+keller
+kendall
+kenny
+ketchup
+kings
+kissme
+kitten
+kittycat
+kkkkkk
+kristi
+kristine
+labtec
+laddie
+ladybug
+lance
+laurel
+lawson
+leader
+leland
+lemon
+lester
+letter
+letters
+lexus1
+libra
+lights
+lionel
+little
+lizzy
+lolita
+lonestar
+longhorn
+looney
+loren
+lorna
+loser
+lovers
+loveyou
+lucia
+lucifer
+lucky14
+maddie
+madmax
+magic1
+magnum
+maiden
+maine
+management
+manson
+manuel
+marcus
+maria
+marielle
+marine
+marino
+marshall
+martha
+maxmax
+meatloaf
+medical
+megan
+melina
+memphis
+mermaid
+miami
+michel
+michigan
+mickey1
+microsoft
+mikael
+milano
+miles
+millenium
+million
+miranda
+miriam
+mission
+mmmmmm
+mobile
+monkey1
+monroe
+montana
+monty
+moomoo
+moonbeam
+morpheus
+motorola
+movies
+mozart
+munchkin
+murray
+mustang1
+nadia
+nadine
+napoleon
+nation
+national
+nestle
+newlife
+newyork1
+nichole
+nikita
+nikki
+nintendo
+nokia
+nomore
+normal
+norton
+noway
+nugget
+number9
+numbers
+nurse
+nutmeg
+ohshit
+oicu812
+omega
+openup
+orchid
+oreo
+orlando
+packard
+packers
+paloma
+pancake
+panic
+parola
+parrot
+partner
+pascal
+patches
+patriots
+paula
+pauline
+payton
+peach
+peanuts
+pedro1
+peggy
+perfect
+perry
+peterpan
+philips
+phillips
+phone
+pierce
+pigeon
+pink
+pioneer
+piper1
+pirate
+pisces
+playboy
+pluto
+poetry
+pontiac
+pookey
+popeye
+prayer
+precious
+prelude
+premier
+puddin
+pulsar
+pussy
+pussy1
+qwert
+qwerty12
+qwertyui
+rabbit1
+rachelle
+racoon
+rambo
+randy1
+ravens
+redman
+redskins
+reggae
+reggie
+renee
+renegade
+rescue
+revolution
+richard1
+richards
+richmond
+riley
+ripper
+robby
+roberts
+rock
+rocket1
+rockie
+rockon
+roger1
+rogers
+roland
+rommel
+rookie
+rootbeer
+rosie
+rufus
+rusty
+ruthless
+sabbath
+sabina
+safety
+saint
+samiam
+sammie
+sammy
+samsam
+sandi
+sanjose
+saphire
+sarah1
+saskia
+sassy
+saturday
+science
+scooby
+scoobydoo
+scooter1
+scorpion
+scotty
+scouts
+search
+september
+server
+seven7
+sexy
+shaggy
+shanny
+shaolin
+shasta
+shayne
+shelly
+sherry
+shirley
+shorty
+shotgun
+sidney
+simba1
+sinatra
+sirius
+skate
+skipper1
+skyler
+slayer
+sleepy
+slider
+smile1
+smitty
+smoke
+snakes
+snapper
+snoop
+solomon
+sophia
+space
+sparks
+spartan
+spike1
+sponge
+spurs
+squash
+stargate
+starlight
+stars
+steph1
+steve1
+stevens
+stewart
+stone
+stranger
+stretch
+strong
+studio
+stumpy
+sucker
+suckme
+sultan
+summit
+sunfire
+sunset
+super
+superstar
+surfing
+susan1
+sutton
+sweden
+sweetpea
+sweety
+swordfish
+tabatha
+tacobell
+taiwan
+tamtam
+tanner
+target
+tasha
+tattoo
+tequila
+terry1
+texas
+thankyou
+theend
+thompson
+thrasher
+tiger2
+timber
+timothy
+tinkerbell
+topcat
+topher
+toshiba
+tototo
+travis
+treasure
+trees
+tricky
+trish
+triton
+trombone
+trouble
+trucker
+turbo
+twins
+tyler1
+ultimate
+unique
+united
+ursula
+vacation
+valley
+vampire
+vanessa
+venice
+venus
+vermont
+vicki
+vicky
+victor1
+vincent1
+violet
+violin
+virgil
+virginia
+vision
+volley
+voodoo
+vortex
+waiting
+wanker
+warner
+water1
+wayne1
+webster
+weezer
+wendy1
+western
+white
+whitney
+whocares
+wildcat
+william1
+wilma
+window
+winniethepooh
+wolfgang
+wolverine
+wonder
+xxxxxxxx
+yamaha
+yankee
+yogibear
+yolanda
+yomama
+yvette
+zachary
+zebras
+zxcvbn
+00000000
+121212
+1234qwer
+131313
+13579
+90210
+99999999
+ABC123
+action
+amelie
+anaconda
+apollo13
+artist
+asshole
+benoit
+bernard
+bernie
+bigbird
+blizzard
+bluesky
+bonjour
+caesar
+cardinal
+carolina
+cesar
+chandler
+chapman
+charlie1
+chevy
+chiquita
+chocolat
+coco
+cougars
+courtney
+dolphins
+dominic
+donkey
+dusty
+eminem
+energy
+fearless
+forest
+forever
+glenn
+guinness
+hotdog
+indian
+jared
+jimbo
+johnson
+jojo
+josie
+kristin
+lloyd
+lorraine
+lynn
+maxime
+memory
+mimi
+mirror
+nebraska
+nemesis
+network
+nigel
+oatmeal
+patton
+pedro
+planet
+players
+portland
+praise
+psalms
+qwaszx
+raiders
+rambo1
+rancid
+shawn
+shelley
+softball
+speedo
+sports
+ssssss
+steele
+steph
+stephani
+sunday
+tiffany
+tigre
+toronto
+trixie
+undead
+valentin
+velvet
+viking
+walker
+watson
+young
+babygirl
+pretty
+hottie
+teamo
+987654321
+naruto
+spongebob
+daniela
+princesa
+christ
+blessed
+single
+qazwsx
+pokemon
+iloveyou1
+iloveyou2
+fuckyou1
+hahaha
+poop
+blessing
+blahblah
+blink182
+123qwe
+trinity
+passw0rd
+google
+looking
+spirit
+iloveyou!
+qwerty1
+onelove
+mylove
+222222
+ilovegod
+football1
+loving
+emmanuel
+1q2w3e4r
+red123
+blabla
+112233
+hallo
+spiderman
+simpsons
+monster
+november
+brooklyn
+poopoo
+darkness
+159753
+pineapple
+chester
+1qaz2wsx
+drowssap
+monkey12
+wordpass
+q1w2e3r4
+coolness
+11235813
+something
+alexandra
+estrella
+miguel
+iloveme
+sayang
+princess1
+555555
+999999
+alejandro
+brittany
+alejandra
+tequiero
+antonio
+987654
+00000
+fernando
+corazon
+cristina
+kisses
+myspace
+rebelde
+babygurl
+alyssa
+mahalkita
+gabriela
+pictures
+hellokitty
+babygirl1
+angelica
+mahalko
+mariana
+eduardo
+andres
+ronaldo
+inuyasha
+adriana
+celtic
+samsung
+angelo
+456789
+sebastian
+karina
+hotmail
+0123456789
+barcelona
+cameron
+slipknot
+cutiepie
+50cent
+bonita
+maganda
+babyboy
+natalie
+cuteako
+javier
+789456123
+123654
+bowwow
+portugal
+777777
+volleyball
+january
+cristian
+bianca
+chrisbrown
+101010
+sweet
+panget
+benfica
+love123
+lollipop
+camila
+qwertyuiop
+harrypotter
+ihateyou
+christine
+lorena
+andreea
+charmed
+rafael
+brianna
+aaliyah
+johncena
+lovelove
+gangsta
+333333
+hiphop
+mybaby
+sergio
+metallica
+myspace1
+babyblue
+badboy
+fernanda
+westlife
+sasuke
+steaua
+roberto
+slideshow
+asdfghjkl
+santiago
+jayson
+5201314
+jerome
+gandako
+gatita
+babyko
+246810
+sweetheart
+chivas
+alberto
+valeria
+nicole1
+12345678910
+leonardo
+jayjay
+liliana
+sexygirl
+232323
+amores
+anthony1
+bitch1
+fatima
+miamor
+lover
+lalala
+252525
+skittles
+colombia
+159357
+manutd
+123456a
+britney
+katrina
+christina
+pasaway
+mahal
+tatiana
+cantik
+0123456
+teiubesc
+147258369
+natalia
+francisco
+amorcito
+paola
+angelito
+manchester
+mommy1
+147258
+amigos
+marlon
+linkinpark
+147852
+diego
+444444
+iverson
+andrei
+justine
+frankie
+pimpin
+fashion
+bestfriend
+england
+hermosa
+456123
+102030
+sporting
+hearts
+potter
+iloveu2
+number1
+212121
+truelove
+jayden
+savannah
+hottie1
+ganda
+scotland
+ilovehim
+shakira
+estrellita
+brandon1
+sweets
+familia
+love12
+omarion
+monkeys
+loverboy
+elijah
+ronnie
+mamita
+999999999
+broken
+rodrigo
+westside
+mauricio
+amigas
+preciosa
+shopping
+flores
+isabella
+martinez
+elaine
+friendster
+cheche
+gracie
+connor
+valentina
+darling
+santos
+joanne
+fuckyou2
+pebbles
+sunshine1
+gangster
+gloria
+darkangel
+bettyboop
+jessica1
+cheyenne
+dustin
+iubire
+a123456
+purple1
+bestfriends
+inlove
+batista
+karla
+chacha
+marian
+sexyme
+pogiako
+jordan1
+010203
+daddy1
+daddysgirl
+billabong
+pinky
+erika
+skater
+nenita
+tigger1
+gatito
+lokita
+maldita
+buttercup
+bambam
+glitter
+123789
+sister
+zacefron
+tokiohotel
+loveya
+lovebug
+bubblegum
+marissa
+cecilia
+lollypop
+nicolas
+puppies
+ariana
+chubby
+sexybitch
+roxana
+mememe
+susana
+baller
+hotstuff
+carter
+babylove
+angelina
+playgirl
+sweet16
+012345
+bhebhe
+marcos
+loveme1
+milagros
+lilmama
+beyonce
+lovely1
+catdog
+armando
+margarita
+151515
+loves
+202020
+gerard
+undertaker
+amistad
+capricorn
+delfin
+cheerleader
+password2
+PASSWORD
+lizzie
+matthew1
+enrique
+badgirl
+141414
+dancing
+cuteme
+amelia
+skyline
+angeles
+janine
+carlitos
+justme
+legolas
+michelle1
+cinderella
+jesuschrist
+ilovejesus
+tazmania
+tekiero
+thebest
+princesita
+lucky7
+jesucristo
+buddy1
+regina
+myself
+lipgloss
+jazmin
+rosita
+chichi
+pangit
+mierda
+741852963
+hernandez
+arturo
+silvia
+melvin
+celeste
+pussycat
+gorgeous
+honeyko
+mylife
+babyboo
+loveu
+lupita
+panthers
+hollywood
+alfredo
+musica
+hawaii
+sparkle
+kristina
+sexymama
+crazy
+scarface
+098765
+hayden
+micheal
+242424
+0987654321
+marisol
+jeremiah
+mhine
+isaiah
+lolipop
+butterfly1
+xbox360
+madalina
+anamaria
+yourmom
+jasmine1
+bubbles1
+beatriz
+diamonds
+friendship
+sweetness
+desiree
+741852
+hannah1
+bananas
+julius
+leanne
+marie1
+lover1
+twinkle
+february
+bebita
+87654321
+twilight
+imissyou
+pollito
+ashlee
+cookie1
+147852369
+beckham
+simone
+nursing
+torres
+damian
+123123123
+joshua1
+babyface
+dinamo
+mommy
+juliana
+cassandra
+redsox
+gundam
+0000
+ou812
+dave
+golf
+molson
+Monday
+newpass
+thx1138
+Internet
+coke
+foobar
+abc
+fish
+fred
+help
+ncc1701d
+newuser
+none
+pat
+dog
+duck
+duke
+floyd
+guest
+joe
+kingfish
+micro
+sam
+telecom
+test1
+7777
+absolut
+babylon5
+backup
+bill
+bird33
+deliver
+fire
+flip
+galileo
+gopher
+hansolo
+jane
+jim
+mom
+passwd
+phil
+phish
+porsche911
+rain
+red
+sergei
+training
+truck
+video
+volvo
+007
+1969
+5683
+Bond007
+Friday
+Hendrix
+October
+Taurus
+aaa
+alexandr
+catalog
+challenge
+clipper
+coltrane
+cyrano
+dan
+dawn
+dean
+deutsch
+dilbert
+e-mail
+export
+ford
+fountain
+fox
+frog
+gabriell
+garlic
+goforit
+grateful
+hoops
+lady
+ledzep
+lee
+mailman
+mantra
+market
+mazda1
+metallic
+ncc1701e
+nesbitt
+open
+pete
+quest
+republic
+research
+supra
+tara
+testing
+xanadu
+xxxx
+zaphod
+zeus
+0007
+1022
+10sne1
+1973
+1978
+2000
+2222
+3bears
+Broadway
+Fisher
+Jeanne
+Killer
+Knight
+Master
+Pepper
+Sierra
+Tennis
+abacab
+abcd
+ace
+acropolis
+amy
+anders
+avenir
+basil
+bass
+beer
+ben
+bliss
+blowfish
+boss
+bridges
+buck
+bugsy
+bull
+cannondale
+canon
+catnip
+chip
+civil
+content
+cook
+cordelia
+crack1
+cyber
+daisie
+dark1
+database
+deadhead
+denali
+depeche
+dickens
+emmitt
+entropy
+farout
+farside
+feedback
+fidel
+firenze
+fish1
+fletch
+fool
+fozzie
+fun
+gargoyle
+gasman
+gold
+graphic
+hell
+image
+intern
+intrepid
+jeff
+jkl123
+joel
+johanna1
+kidder
+kim
+king
+kirk
+kris
+lambda
+leon
+logical
+lorrie
+major
+mariner
+mark1
+max
+media
+merlot
+midway
+mine
+mmouse
+moon
+mopar
+mortimer
+nermal
+nina
+olsen
+opera
+overkill
+pacers
+packer
+picard
+polar
+polo
+primus
+prometheus
+public
+radio
+rastafarian
+reptile
+rob
+robotech
+rodeo
+rolex
+rouge
+roy
+ruby
+salasana
+scarecrow
+scout
+scuba1
+sergey
+skibum
+skunk
+sound
+starter
+sting1
+sunbird
+tbird
+teflon
+temporal
+terminal
+the
+thejudge
+time
+toby
+today
+tokyo
+tree
+trout
+vader
+val
+valhalla
+windsurf
+wolf
+wolf1
+xcountry
+yoda
+yukon
+1213
+1214
+1225
+1313
+1818
+1975
+1977
+1991
+1kitty
+2001
+2020
+2112
+2kids
+333
+4444
+5050
+57chevy
+7dwarfs
+Animals
+Ariel
+Bismillah
+Booboo
+Boston
+Carol
+Computer
+Creative
+Curtis
+Denise
+Eagles
+Esther
+Fishing
+Freddy
+Gandalf
+Golden
+Goober
+Hacker
+Harley
+Henry
+Hershey
+Jackson
+Jersey
+Joanna
+Johnson
+Katie
+Kitten
+Liberty
+Lindsay
+Lizard
+Madeline
+Margaret
+Maxwell
+Money
+Monster
+Pamela
+Peaches
+Peter
+Phoenix
+Piglet
+Pookie
+Rabbit
+Raiders
+Random
+Russell
+Sammy
+Saturn
+Skeeter
+Smokey
+Sparky
+Speedy
+Sterling
+Theresa
+Thunder
+Vincent
+Willow
+Winnie
+Wolverine
+aaaa
+aardvark
+abbott
+acura
+admin
+admin1
+adrock
+aerobics
+agent
+airwolf
+ali
+alien
+allegro
+allstate
+altamira
+altima1
+andrew!
+ann
+anne
+anneli
+aptiva
+arrow
+asdf;lkj
+assmunch
+baraka
+barnyard
+bart
+bartman
+beasty
+beavis1
+bebe
+belgium
+beowulf
+beryl
+best
+bharat
+bichon
+bigal
+biker
+bilbo
+bills
+bimmer
+biochem
+birdy
+blinds
+blitz
+bluejean
+bogey
+bogus
+boulder
+bourbon
+boxer
+brain
+branch
+britain
+broker
+bucks
+buffett
+bugs
+bulls
+burns
+buzz
+c00per
+calgary
+camay
+carl
+cat
+cement
+cessna
+chad
+chainsaw
+chameleon
+chang
+chess
+chinook
+chouette
+chronos
+cicero
+circuit
+cirque
+cirrus
+clapton
+clarkson
+class
+claudel
+cleo
+cliff
+clock
+color
+comet
+concept
+concorde
+coolbean
+corky
+cornflake
+corwin
+cows
+crescent
+cross
+crowley
+cthulhu
+cunt
+current
+cutlass
+daedalus
+dagger1
+daily
+dale
+dana
+daytek
+dead
+decker
+dharma
+dillweed
+dipper
+disco
+dixon
+doitnow
+doors
+dork
+doug
+dutch
+effie
+ella
+elsie
+engage
+eric1
+ernie1
+escort1
+excel
+faculty
+fairview
+faust
+fenris
+finance
+first
+fishhead
+flanders
+fleurs
+flute
+flyboy
+flyer
+franka
+frederic
+free
+front242
+frontier
+fugazi
+funtime
+gaby
+gaelic
+gambler
+gammaphi
+garfunkel
+garth
+gary
+gateway2
+gator1
+gibbons
+gigi
+gilgamesh
+goat
+godiva
+goethe
+gofish
+good
+gramps
+gravis
+gray
+greed
+greg
+greg1
+greta
+gretzky
+guido
+gumby
+h2opolo
+hamid
+hank
+hawkeye1
+health1
+hello8
+help123
+helper
+homerj
+hoosier
+hope
+huang
+hugo
+hydrogen
+ib6ub9
+insight
+instructor
+integral
+iomega
+iris
+izzy
+jazz
+jean
+jeepster
+jetta1
+joanie
+josee
+joy
+julia2
+jumbo
+jump
+justice4
+kalamazoo
+kali
+kat
+kate
+kerala
+kids
+kiwi
+kleenex
+kombat
+lamer
+laser
+laserjet
+lassie1
+leblanc
+legal
+leo
+life
+lions
+liz
+logger
+logos
+loislane
+loki
+longer
+lori
+lost
+lotus
+lou
+macha
+macross
+madoka
+makeitso
+mallard
+marc
+math
+mattingly
+mechanic
+meister
+mercer
+merde
+merrill
+michal
+michou
+mickel
+minou
+mobydick
+modem
+mojo
+montana3
+montrose
+motor
+mowgli
+mulder1
+muscle
+neil
+neutrino
+newaccount
+nicklaus
+nightshade
+nightwing
+nike
+none1
+nopass
+nouveau
+novell
+oaxaca
+obiwan
+obsession
+orville
+otter
+ozzy
+packrat
+paint
+papa
+paradigm
+pass
+pavel
+peterk
+phialpha
+phishy
+piano1
+pianoman
+pianos
+pipeline
+plato
+play
+poetic
+print
+printing
+provider
+qqq111
+quebec
+qwer
+racer
+racerx
+radar
+rafiki
+raleigh
+rasta1
+redcloud
+redfish
+redwing
+redwood
+reed
+rene
+reznor
+rhino
+ripple
+rita
+robocop
+robotics
+roche
+roni
+rossignol
+rugger
+safety1
+saigon
+satori
+saturn5
+schnapps
+scotch
+scuba
+secret3
+seeker
+services
+sex
+shanghai
+shazam
+shelter
+sigmachi
+signal
+signature
+simsim
+skydive
+slick
+smegma
+smiths
+smurfy
+snow
+sober1
+sonics
+sony
+spazz
+sphynx
+spock
+spoon
+spot
+sprocket
+starbuck
+steel
+stephi
+sting
+stocks
+storage
+strat
+strato
+stud
+student2
+susanna
+swanson
+swim
+switzer
+system5
+t-bone
+talon
+tarheel
+tata
+tazdevil
+tester
+testtest
+thisisit
+thorne
+tightend
+tim
+tom
+tool
+total
+toucan
+transfer
+transit
+transport
+trapper
+trash
+trophy
+tucson
+turbo2
+unity
+upsilon
+vedder
+vette
+vikram
+virago
+visual
+volcano
+walden
+waldo
+walleye
+webmaster
+wedge
+whale1
+whit
+whoville
+wibble
+will
+wombat1
+word
+world
+x-files
+xxx123
+zack
+zepplin
+zoltan
+zoomer
+123go
+21122112
+5555
+911
+FuckYou
+Fuckyou
+Gizmo
+Hello
+Michel
+Qwerty
+Windows
+angus
+aspen
+ass
+bird
+booster
+byteme
+cats
+changeit
+christia
+christoph
+classroom
+cloclo
+corrado
+dasha
+fiction
+french1
+fubar
+gator
+gilles
+gocougs
+hilbert
+hola
+home
+judy
+koko
+lulu
+mac
+macintosh
+mailer
+mars
+meow
+ne1469
+niki
+paul
+politics
+pomme
+property
+ruth
+sales
+salut
+scrooge
+skidoo
+spain
+surf
+sylvie
+symbol
+forum
+rotimi
+god
+saved
+2580
+1998
+xxx
+1928
+777
+info
+a
+netware
+sun
+tech
+doom
+mmm
+one
+ppp
+1911
+1948
+1996
+5252
+Champs
+Tuesday
+bach
+crow
+don
+draft
+hal9000
+herzog
+huey
+jethrotull
+jussi
+mail
+miki
+nicarao
+snowski
+1316
+1412
+1430
+1952
+1953
+1955
+1956
+1960
+1964
+1qw23e
+2200
+2252
+3010
+3112
+4788
+6262
+Alpha
+Bastard
+Beavis
+Cardinal
+Celtics
+Cougar
+Darkman
+Figaro
+Fortune
+Geronimo
+Hammer
+Homer
+Janet
+Mellon
+Merlot
+Metallic
+Montreal
+Newton
+Paladin
+Peanuts
+Service
+Vernon
+Waterloo
+Webster
+aki123
+aqua
+aylmer
+beta
+bozo
+car
+chat
+chinacat
+cora
+courier
+dogbert
+eieio
+elina1
+fly
+funguy
+fuzz
+ggeorge
+glider1
+gone
+hawk
+heikki
+histoire
+hugh
+if6was9
+ingvar
+jan
+jedi
+jimi
+juhani
+khan
+lima
+midvale
+neko
+nesbit
+nexus6
+nisse
+notta1
+pam
+park
+pole
+pope
+pyro
+ram
+reliant
+rex
+rush
+seoul
+skip
+stan
+sue
+suzy
+tab
+testi
+thelorax
+tika
+tnt
+toto1
+tre
+wind
+x-men
+xyz
+zxc
+369
+Abcdef
+Asdfgh
+Changeme
+NCC1701
+Zxcvbnm
+demo
+doom2
+good-luck
+homebrew
+m1911a1
+nat
+ne1410s
+ne14a69
+zhongguo
+sample123
+0852
+basf
+OU812
+!@#$%
+informix
+majordomo
+news
+temp
+trek
+!@#$%^
+!@#$%^&*
+Pentium
+Raistlin
+adi
+bmw
+law
+new
+opus
+plus
+visa
+www
+zzz
+1332
+1950
+3141
+3533
+4055
+4854
+6301
+Bonzo
+ChangeMe
+Front242
+Gretel
+Michel1
+Noriko
+Sidekick
+Sverige
+Swoosh
+Woodrow
+ayelet
+barn
+betacam
+biz
+boat
+cuda
+doc
+hal
+hallowell
+haro
+hosehead
+ilmari
+irmeli
+j1l2t3
+jer
+kcin
+kerrya
+kissa2
+leaf
+lissabon
+mart
+matti1
+mech
+morecats
+paagal
+performa
+prof
+ratio
+ship
+slip
+stivers
+tapani
+targas
+test2
+test3
+tula
+unix
+user1
+xanth
+!@#$%^&
+1701d
+@#$%^&
+Qwert
+allo
+dirk
+newcourt
+nite
+notused
+sss

=== modified file 'sql/share/errmsg-utf8.txt'
--- a/sql/share/errmsg-utf8.txt	2012-05-11 10:15:28 +0000
+++ b/sql/share/errmsg-utf8.txt	2012-05-21 14:22:56 +0000
@@ -6763,6 +6763,8 @@ ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2
 ER_SLAVE_SILENT_RETRY_TRANSACTION
   eng "Slave must silently retry current transaction"
 
+ER_NOT_VALID_PASSWORD
+  eng "Your password does not satisfy the current policy requirements "
 #
 #  End of 5.6 error messages.
 #

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2012-05-16 11:03:43 +0000
+++ b/sql/sql_acl.cc	2012-05-21 14:22:56 +0000
@@ -49,6 +49,7 @@
 #include "sql_connect.h"
 #include "hostname.h"
 #include "sql_db.h"
+#include <mysql/plugin_validate_password.h>
 
 using std::min;
 using std::max;
@@ -180,6 +181,10 @@ static LEX_STRING old_password_plugin_na
   C_STRING_WITH_LEN("mysql_old_password")
 };
   
+static LEX_STRING validate_password_plugin_name= {
+  C_STRING_WITH_LEN("validate_password")
+};
+
 /// @todo make it configurable
 LEX_STRING *default_auth_plugin_name= &native_password_plugin_name;
 
@@ -9924,3 +9929,41 @@ mysql_declare_plugin(mysql_password)
 }
 mysql_declare_plugin_end;
 
+/*  
+ PASSWORD_VALIDATION_CODE, invoking appropriate plugin to validate
+ the password strength.
+*/
+
+/* for validate_password_strength SQL function */
+int check_password_strength(String *password)
+{
+  int res= 0;
+  plugin_ref plugin= my_plugin_lock_by_name(0, &validate_password_plugin_name,
+                                            MYSQL_VALIDATE_PASSWORD_PLUGIN);
+  if (plugin)
+  {
+    st_mysql_validate_password *password_strength=
+                      (st_mysql_validate_password *) plugin_decl(plugin)->info;
+
+    res= password_strength->get_password_strength(password);
+    plugin_unlock(0, plugin);
+  }
+  return(res);
+}
+
+/* called when new user is created or exsisting password is changed */
+void check_password_policy(String *password)
+{
+  plugin_ref plugin= my_plugin_lock_by_name(0, &validate_password_plugin_name,
+                                            MYSQL_VALIDATE_PASSWORD_PLUGIN);
+  if (plugin)
+  {
+    st_mysql_validate_password *password_validate=
+                      (st_mysql_validate_password *) plugin_decl(plugin)->info;
+
+    if (!password_validate->validate_password(password))
+      my_error(ER_NOT_VALID_PASSWORD, MYF(0));
+
+    plugin_unlock(0, plugin);
+  }
+}

=== modified file 'sql/sql_acl.h'
--- a/sql/sql_acl.h	2012-03-06 14:29:42 +0000
+++ b/sql/sql_acl.h	2012-05-21 14:22:56 +0000
@@ -251,7 +251,8 @@ int fill_schema_schema_privileges(THD *t
 int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, Item *cond);
 int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, Item *cond);
 int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr);
-
+int check_password_strength(String *password);
+void check_password_policy(String *password);
 #ifdef NO_EMBEDDED_ACCESS_CHECKS
 #define check_grant(A,B,C,D,E,F) 0
 #define check_grant_db(A,B) 0

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2012-04-13 12:00:39 +0000
+++ b/sql/sql_plugin.cc	2012-05-21 14:22:56 +0000
@@ -33,6 +33,7 @@
 #include "sql_audit.h"
 #include <mysql/plugin_auth.h>
 #include "lock.h"                               // MYSQL_LOCK_IGNORE_TIMEOUT
+#include <mysql/plugin_validate_password.h>
 
 #include <algorithm>
 
@@ -72,7 +73,8 @@ const LEX_STRING plugin_type_names[MYSQL
   { C_STRING_WITH_LEN("INFORMATION SCHEMA") },
   { C_STRING_WITH_LEN("AUDIT") },
   { C_STRING_WITH_LEN("REPLICATION") },
-  { C_STRING_WITH_LEN("AUTHENTICATION") }
+  { C_STRING_WITH_LEN("AUTHENTICATION") },
+  { C_STRING_WITH_LEN("VALIDATE PASSWORD") }
 };
 
 extern int initialize_schema_table(st_plugin_int *plugin);
@@ -89,13 +91,13 @@ extern int finalize_audit_plugin(st_plug
 plugin_type_init plugin_type_initialize[MYSQL_MAX_PLUGIN_TYPE_NUM]=
 {
   0,ha_initialize_handlerton,0,0,initialize_schema_table,
-  initialize_audit_plugin,0,0
+  initialize_audit_plugin,0,0,0
 };
 
 plugin_type_init plugin_type_deinitialize[MYSQL_MAX_PLUGIN_TYPE_NUM]=
 {
   0,ha_finalize_handlerton,0,0,finalize_schema_table,
-  finalize_audit_plugin,0,0
+  finalize_audit_plugin,0,0,0
 };
 
 #ifdef HAVE_DLOPEN
@@ -121,7 +123,8 @@ static int min_plugin_info_interface_ver
   MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION,
   MYSQL_AUDIT_INTERFACE_VERSION,
   MYSQL_REPLICATION_INTERFACE_VERSION,
-  MYSQL_AUTHENTICATION_INTERFACE_VERSION
+  MYSQL_AUTHENTICATION_INTERFACE_VERSION,
+  MYSQL_VALIDATE_PASSWORD_INTERFACE_VERSION
 };
 static int cur_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]=
 {
@@ -132,7 +135,8 @@ static int cur_plugin_info_interface_ver
   MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION,
   MYSQL_AUDIT_INTERFACE_VERSION,
   MYSQL_REPLICATION_INTERFACE_VERSION,
-  MYSQL_AUTHENTICATION_INTERFACE_VERSION
+  MYSQL_AUTHENTICATION_INTERFACE_VERSION,
+  MYSQL_VALIDATE_PASSWORD_INTERFACE_VERSION
 };
 
 /* support for Services */

=== modified file 'sql/sql_plugin_services.h'
--- a/sql/sql_plugin_services.h	2011-06-30 15:50:45 +0000
+++ b/sql/sql_plugin_services.h	2012-05-21 14:22:56 +0000
@@ -50,7 +50,17 @@ static struct my_plugin_log_service my_p
   my_plugin_log_message
 };
 
-
+static struct mysql_string_service_st mysql_string_handler= {
+  mysql_string_convert_to_char_ptr,
+  mysql_string_get_iterator,
+  mysql_string_iterator_next,
+  mysql_string_iterator_isupper,
+  mysql_string_iterator_islower,
+  mysql_string_iterator_isdigit,
+  mysql_string_to_lowercase,
+  mysql_string_free,
+  mysql_string_iterator_free,
+};
 
 static struct st_service_ref list_of_services[]=
 {
@@ -60,5 +70,7 @@ static struct st_service_ref list_of_ser
   { "my_thread_scheduler_service",
     VERSION_my_thread_scheduler, &my_thread_scheduler_handler },
   { "my_plugin_log_service", VERSION_my_plugin_log, &my_plugin_log_handler },
+  { "mysql_string_service",
+    VERSION_mysql_string, &mysql_string_handler },
 };
 

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2012-05-18 11:06:00 +0000
+++ b/sql/sql_yacc.yy	2012-05-21 14:22:56 +0000
@@ -15165,6 +15165,9 @@ grant_user:
             $$=$1; $1->password=$4;
             if (Lex->sql_command == SQLCOM_REVOKE)
               MYSQL_YYABORT;
+            String *password = new (YYTHD->mem_root) String((const char*)$4.str,
+                                    YYTHD->variables.character_set_client);
+            check_password_policy(password);
             if ($4.length)
             {
               if (YYTHD->variables.old_passwords)

=== added file 'sql/string_service.cc'
--- a/sql/string_service.cc	1970-01-01 00:00:00 +0000
+++ b/sql/string_service.cc	2012-05-21 14:22:56 +0000
@@ -0,0 +1,156 @@
+/* Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
+
+
+/*  
+  This file provide mysql_string service to plugins.
+  operations on mysql_string can be performed by plugins via these service
+  functions.
+*/
+
+#include <my_sys.h>
+#include "string_service.h"
+/*  
+  This service function converts the mysql_string to the character set
+  specified by charset_name parameter.
+*/
+extern "C"
+int mysql_string_convert_to_char_ptr(mysql_string_handle string_handle,
+                                     const char *charset_name, char *buffer,
+                                     int *error)
+{
+  String *str= (String *) string_handle;
+  int len= (int)my_convert(buffer, 100, &my_charset_utf8_general_ci, str->ptr(),
+                           str->length(), str->charset(), (uint*) error);
+  return (len);
+}
+
+/*  
+  This service function deallocates the mysql_string_handle allocated on
+  server and used in plugins.
+*/
+extern "C"
+void mysql_string_free(mysql_string_handle string_handle)
+{
+  my_free((String *) string_handle);
+}
+
+/*  
+  This service function deallocates the mysql_string_iterator_handle
+  allocated on server and used in plugins.
+*/
+extern "C"
+void mysql_string_iterator_free(mysql_string_iterator_handle iterator_handle)
+{
+  my_free((string_iterator *) iterator_handle);
+}
+
+/* This service function allocate mysql_string_iterator_handle and return it */
+extern "C"
+mysql_string_iterator_handle mysql_string_get_iterator(mysql_string_handle
+                                                       string_handle)
+{
+  String *str= (String *) string_handle;
+  string_iterator *iterator= (string_iterator *) my_malloc(sizeof
+                                                 (string_iterator *), MYF(0));
+  iterator->iterator_str= str;
+  iterator->iterator_ptr= str->ptr();
+  iterator->ctype= 0;
+  return (iterator);
+}
+
+/* Provide service which returns the next mysql_string_iterator_handle */
+extern "C"
+int mysql_string_iterator_next(mysql_string_iterator_handle iterator_handle)
+{
+  int char_len, char_type;
+  string_iterator *iterator= (string_iterator *) iterator_handle;
+  String *str= iterator->iterator_str;
+  const CHARSET_INFO *cs= str->charset();
+  char *end= (char*) str->ptr() + str->length();
+  if (iterator->iterator_ptr == (const char*) end)
+    return (0);
+  char_len= (cs->cset->ctype(cs, &char_type, (uchar*) iterator->iterator_ptr,
+                             (uchar*) end));
+  iterator->ctype= char_type;
+  iterator->iterator_ptr+= (char_len > 0 ? char_len : (char_len < 0
+                                                       ? -char_len : 1));
+  return (1);
+}
+
+/*  
+  Provide service which calculate weather the current iterator_ptr points to
+  upper case character or not
+*/
+extern "C"
+int mysql_string_iterator_isupper(mysql_string_iterator_handle iterator_handle)
+{
+  string_iterator *iterator= (string_iterator *) iterator_handle;
+  return (iterator->ctype & _MY_U);
+}
+
+/*  
+  Provide service which calculate weather the current iterator_ptr points to
+  lower case character or not
+*/
+extern "C"
+int mysql_string_iterator_islower(mysql_string_iterator_handle iterator_handle)
+{
+  string_iterator *iterator= (string_iterator *) iterator_handle;
+  return (iterator->ctype & _MY_L);
+}
+
+/*  
+  Provide service which calculate weather the current iterator_ptr points to
+  digit or not
+*/
+extern "C"
+int mysql_string_iterator_isdigit(mysql_string_iterator_handle iterator_handle)
+{
+  string_iterator *iterator= (string_iterator *) iterator_handle;
+  return (iterator->ctype & _MY_NMR);
+}
+
+/*  
+  This function provide plugin service to convert a String pointed by handle to
+  lower case. Conversion depends on the client character set info
+*/
+extern "C"
+mysql_string_handle mysql_string_to_lowercase(mysql_string_handle string_handle)
+{
+  String *str= (String *) string_handle;
+  String *res;
+  const CHARSET_INFO *cs= str->charset();
+
+  if (cs->casedn_multiply == 1)
+  {
+    uint len;
+    len= cs->cset->casedn(cs, (char*) str->ptr(), str->length(),
+                          (char*) str->ptr(), str->length());
+    str->length(len);
+    res= str;
+  }
+  else
+  {
+    uint len= str->length() * cs->casedn_multiply;
+    temp_str.alloc(len);
+    temp_str.set_charset(cs);
+    len= cs->cset->casedn(cs, (char*) str->ptr(), str->length(),
+                          (char*) temp_str.ptr(), len);
+    temp_str.length(len);
+    res= &temp_str;
+  }
+  return (res);
+}

=== added file 'sql/string_service.h'
--- a/sql/string_service.h	1970-01-01 00:00:00 +0000
+++ b/sql/string_service.h	2012-05-21 14:22:56 +0000
@@ -0,0 +1,31 @@
+/* Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
+
+#ifndef MY_STRING_SERVICE_INCLUDED
+#define MY_STRING_SERVICE_INCLUDED
+
+#include "sql_string.h"
+
+String temp_str;
+
+/* mysql_string_itrerator structure to provide service to plugins */
+struct string_iterator
+{
+  String *iterator_str;
+  const char *iterator_ptr;
+  int ctype;
+};
+
+#endif /* MY_STRING_SERVICE_INCLUDED */

=== modified file 'support-files/CMakeLists.txt'
--- a/support-files/CMakeLists.txt	2012-03-23 10:32:33 +0000
+++ b/support-files/CMakeLists.txt	2012-05-21 14:22:56 +0000
@@ -32,6 +32,8 @@ ELSE()
   SET(HOSTNAME "hostname")
 ENDIF()
 
+  SET(dictionary "${CMAKE_INSTALL_PREFIX}/${INSTALL_SHAREDIR}/dictionary.txt" )
+
 # XXX: shouldn't we just have variables for all this stuff and centralise
 # XXX: their configuration in install_layout.cmake?
 IF(WIN32)

=== modified file 'support-files/my-huge.cnf.sh'
--- a/support-files/my-huge.cnf.sh	2010-11-19 13:56:08 +0000
+++ b/support-files/my-huge.cnf.sh	2012-05-21 14:22:56 +0000
@@ -127,6 +127,9 @@ server-id	= 1
 #innodb_flush_log_at_trx_commit = 1
 #innodb_lock_wait_timeout = 50
 
+# dictionary file for validate_password plugin
+loose-validate_password_dictionary_file = @dictionary@
+
 [mysqldump]
 quick
 max_allowed_packet = 16M

=== modified file 'support-files/my-large.cnf.sh'
--- a/support-files/my-large.cnf.sh	2010-11-19 13:56:08 +0000
+++ b/support-files/my-large.cnf.sh	2012-05-21 14:22:56 +0000
@@ -127,6 +127,9 @@ server-id	= 1
 #innodb_flush_log_at_trx_commit = 1
 #innodb_lock_wait_timeout = 50
 
+# dictionary file for validate_password plugin
+loose-validate_password_dictionary_file = @dictionary@
+
 [mysqldump]
 quick
 max_allowed_packet = 16M

=== modified file 'support-files/my-medium.cnf.sh'
--- a/support-files/my-medium.cnf.sh	2010-11-19 13:56:08 +0000
+++ b/support-files/my-medium.cnf.sh	2012-05-21 14:22:56 +0000
@@ -125,6 +125,9 @@ server-id	= 1
 #innodb_flush_log_at_trx_commit = 1
 #innodb_lock_wait_timeout = 50
 
+# dictionary file for validate_password plugin
+loose-validate_password_dictionary_file = @dictionary@
+
 [mysqldump]
 quick
 max_allowed_packet = 16M

=== modified file 'support-files/my-small.cnf.sh'
--- a/support-files/my-small.cnf.sh	2010-11-19 13:59:45 +0000
+++ b/support-files/my-small.cnf.sh	2012-05-21 14:22:56 +0000
@@ -72,6 +72,9 @@ server-id	= 1
 #innodb_flush_log_at_trx_commit = 1
 #innodb_lock_wait_timeout = 50
 
+# dictionary file for validate_password plugin
+loose-validate_password_dictionary_file = @dictionary@
+
 [mysqldump]
 quick
 max_allowed_packet = 16M

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (ashish.y.agarwal:3898 to 3899) WL#2739Ashish Agarwal21 May