Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c5d73186
Commit
c5d73186
authored
8 years ago
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-8227 simple_password_check_minimal_length gets adjusted without a warning
parent
4b88cf33
Branches unavailable
Tags unavailable
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
mysql-test/suite/plugins/r/simple_password_check.result
mysql-test/suite/plugins/r/simple_password_check.result
+4
-0
plugin/simple_password_check/simple_password_check.c
plugin/simple_password_check/simple_password_check.c
+13
-3
No files found.
mysql-test/suite/plugins/r/simple_password_check.result
View file @
c5d73186
...
...
@@ -85,7 +85,11 @@ grant select on *.* to foo1;
drop user foo1;
set global simple_password_check_digits=3;
set global simple_password_check_letters_same_case=3;
Warnings:
Warning 1292 Adjusted the value of simple_password_check_minimal_length from 8 to 10
set global simple_password_check_other_characters=3;
Warnings:
Warning 1292 Adjusted the value of simple_password_check_minimal_length from 10 to 12
show variables like 'simple_password_check_%';
Variable_name Value
simple_password_check_digits 3
...
...
This diff is collapsed.
Click to expand it.
plugin/simple_password_check/simple_password_check.c
View file @
c5d73186
...
...
@@ -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>
...
...
@@ -50,12 +52,20 @@ static int validate(MYSQL_LEX_STRING *username, MYSQL_LEX_STRING *password)
}
static
void
fix_min_length
(
MYSQL_THD
thd
__attribute__
((
unused
)),
struct
st_mysql_sys_var
*
var
,
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
;
}
}
static
MYSQL_SYSVAR_UINT
(
minimal_length
,
min_length
,
PLUGIN_VAR_RQCMDARG
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment