| 1 |
SET md5_password_warnings = off; |
| 2 |
LOAD 'passwordcheck'; |
| 3 |
CREATE USER regress_passwordcheck_user1; |
| 4 |
-- ok |
| 5 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'a_nice_long_password'; |
| 6 |
-- error: too short |
| 7 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'tooshrt'; |
| 8 |
ERROR: password is too short |
| 9 |
DETAIL: password must be at least "passwordcheck.min_password_length" (8) bytes long |
| 10 |
-- ok |
| 11 |
SET passwordcheck.min_password_length = 6; |
| 12 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'v_shrt'; |
| 13 |
-- error: contains user name |
| 14 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'xyzregress_passwordcheck_user1'; |
| 15 |
ERROR: password must not contain user name |
| 16 |
-- error: contains only letters |
| 17 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'alessnicelongpassword'; |
| 18 |
ERROR: password must contain both letters and nonletters |
| 19 |
-- encrypted ok (password is "secret") |
| 20 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'md592350e12ac34e52dd598f90893bb3ae7'; |
| 21 |
-- error: password is user name |
| 22 |
ALTER USER regress_passwordcheck_user1 PASSWORD 'md507a112732ed9f2087fa90b192d44e358'; |
| 23 |
DROP USER regress_passwordcheck_user1; |