You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Bug#14588145 - NEED ABILITY TO FLUSH PASSWORD VALIDATION DICTIONARY FILE
184
+
#
185
+
SET @@global.validate_password_policy=STRONG;
186
+
# No dictionary file, password is accepted
187
+
CREATE USER 'user1'@'localhost' IDENTIFIED BY 'passWORD123#';
188
+
SET @@global.validate_password_dictionary_file="MYSQLTEST_VARDIR/tmp/dictionary2.txt";
189
+
# must return 3
190
+
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS
191
+
WHERE VARIABLE_NAME = 'validate_password_dictionary_file_words_count';
192
+
VARIABLE_VALUE
193
+
3
194
+
Warnings:
195
+
Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead
196
+
SELECT VARIABLE_VALUE into @ts1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS
197
+
WHERE VARIABLE_NAME = "validate_password_dictionary_file_last_parsed";
198
+
Warnings:
199
+
Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead
200
+
# check format of the TS
201
+
SELECT @ts1;
202
+
@ts1
203
+
0000-00-00 00:00:00
204
+
# must return 19
205
+
SELECT LENGTH(@ts1);
206
+
LENGTH(@ts1)
207
+
19
208
+
# must sleep for at least 1 sec so that the timestamps differ
209
+
SET @@global.validate_password_dictionary_file="MYSQLTEST_VARDIR/tmp/dictionary.txt";
210
+
# must return 2
211
+
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS
212
+
WHERE VARIABLE_NAME = 'validate_password_dictionary_file_words_count';
213
+
VARIABLE_VALUE
214
+
2
215
+
Warnings:
216
+
Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead
217
+
SELECT VARIABLE_VALUE into @ts2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS
218
+
WHERE VARIABLE_NAME = "validate_password_dictionary_file_last_parsed";
219
+
Warnings:
220
+
Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead
221
+
# must return 1
222
+
SELECT @ts1 <> @ts2;
223
+
@ts1 <> @ts2
224
+
1
225
+
CREATE USER 'user2'@'localhost' IDENTIFIED BY 'passWORD123#';
226
+
ERROR HY000: Your password does not satisfy the current policy requirements
227
+
SET @@global.validate_password_dictionary_file=NULL;
228
+
# Cache flushed and no dictionary file is loaded
229
+
CREATE USER 'user2'@'localhost' IDENTIFIED BY 'passWORD123#';
230
+
# Select commands to show that the validate_password lock is instrumented
231
+
SELECT NAME FROM performance_schema.setup_instruments WHERE NAME LIKE '%validate%';
232
+
NAME
233
+
wait/synch/rwlock/validate/LOCK_dict_file
234
+
SELECT NAME FROM performance_schema.rwlock_instances WHERE NAME LIKE '%validate%';
235
+
NAME
236
+
wait/synch/rwlock/validate/LOCK_dict_file
237
+
# cleanup
238
+
DROP USER 'user1'@'localhost', 'user2'@'localhost';
0 commit comments