| 1 |
SET md5_password_warnings = off; |
| 2 |
LOAD 'passwordcheck'; |
| 3 |
|
| 4 |
CREATE USER regress_passwordcheck_user1; |
| 5 |
|
| 6 |
-- ok |
| 7 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'a_nice_long_password'; |
| 8 |
|
| 9 |
-- error: too short |
| 10 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'tooshrt'; |
| 11 |
|
| 12 |
-- ok |
| 13 |
SET passwordcheck.min_password_length = 6; |
| 14 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'v_shrt'; |
| 15 |
|
| 16 |
-- error: contains user name |
| 17 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'xyzregress_passwordcheck_user1'; |
| 18 |
|
| 19 |
-- error: contains only letters |
| 20 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'alessnicelongpassword'; |
| 21 |
|
| 22 |
-- encrypted ok (password is "secret") |
| 23 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'md592350e12ac34e52dd598f90893bb3ae7'; |
| 24 |
|
| 25 |
-- error: password is user name |
| 26 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'md507a112732ed9f2087fa90b192d44e358'; |
| 27 |
|
| 28 |
DROP USER regress_passwordcheck_user1; |