You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
869 B
26 lines
869 B
12 months ago
|
#!/usr/bin/expect -f
|
||
|
# Author: Iain Douglas <centos@1n6.org.uk>
|
||
|
#
|
||
|
|
||
|
set testpassword [lindex $argv 0]
|
||
|
set timeout 10
|
||
|
match_max 6000
|
||
|
|
||
|
spawn su passtest -c passwd
|
||
|
expect -re "(UNIX|Current) password:" { send -- "passtest\r" }
|
||
|
expect {
|
||
|
"password:" {
|
||
|
send "$testpassword\r"
|
||
|
expect {
|
||
|
"BAD PASSWORD: is a palindrome" { exit 0 }
|
||
|
"BAD PASSWORD: The password is a palindrome" { exit 0 }
|
||
|
"BAD PASSWORD: it is WAY too short" { exit 0 }
|
||
|
"BAD PASSWORD: The password is shorter than 8 characters" { exit 0 }
|
||
|
"BAD PASSWORD: it is too short" { exit 0 }
|
||
|
"BAD PASSWORD: it does not contain enough DIFFERENT characters" { exit 0 }
|
||
|
"BAD PASSWORD: The password fails the dictionary check - it does not contain enough DIFFERENT characters" { exit 0 }
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
exit 1
|