summaryrefslogtreecommitdiff
path: root/plugin/simple_password_check
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-09-09 08:33:08 +0200
committerSergei Golubchik <serg@mariadb.org>2016-09-09 08:33:08 +0200
commit06b7fce9f24116080168b924d17f71b979fc3a14 (patch)
tree5ff9f5684bb118abbee5a9fd3b838d0841661287 /plugin/simple_password_check
parent1f2ff25eba6c089b2698cd0dab96155ccbf2afd2 (diff)
parent8494039757a2f6353cc161e7824aab4fe2312d2a (diff)
downloadmariadb-git-06b7fce9f24116080168b924d17f71b979fc3a14.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'plugin/simple_password_check')
-rw-r--r--plugin/simple_password_check/simple_password_check.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/plugin/simple_password_check/simple_password_check.c b/plugin/simple_password_check/simple_password_check.c
index 7ad8bfc811a..8b460c5ed9d 100644
--- a/plugin/simple_password_check/simple_password_check.c
+++ b/plugin/simple_password_check/simple_password_check.c
@@ -14,6 +14,8 @@
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 <mysqld_error.h>
#include <mysql/plugin_password_validation.h>
#include <ctype.h>
#include <string.h>
@@ -49,15 +51,21 @@ static int validate(MYSQL_LEX_STRING *username, MYSQL_LEX_STRING *password)
others < min_others;
}
-
-static void
-fix_min_length(MYSQL_THD thd __attribute__((unused)),
- struct st_mysql_sys_var *var __attribute__((unused)),
- void *var_ptr, const void *save)
+static void fix_min_length(MYSQL_THD thd __attribute__((unused)),
+ struct st_mysql_sys_var *var __attribute__((unused)),
+ void *var_ptr, const void *save)
{
+ uint new_min_length;
*((unsigned int *)var_ptr)= *((unsigned int *)save);
- if (min_length < min_digits + 2 * min_letters + min_others)
- min_length= min_digits + 2 * min_letters + min_others;
+ new_min_length= min_digits + 2 * min_letters + min_others;
+ if (min_length < new_min_length)
+ {
+ my_printf_error(ER_TRUNCATED_WRONG_VALUE,
+ "Adjusted the value of simple_password_check_minimal_length "
+ "from %u to %u", ME_JUST_WARNING,
+ min_length, new_min_length);
+ min_length= new_min_length;
+ }
}
@@ -104,6 +112,6 @@ maria_declare_plugin(simple_password_check)
NULL,
sysvars,
"1.0",
- MariaDB_PLUGIN_MATURITY_GAMMA
+ MariaDB_PLUGIN_MATURITY_STABLE
}
maria_declare_plugin_end;