Commit 797dc6a8 authored by Paul Cammish's avatar Paul Cammish
Browse files

Re-enables password testing

parent 2117c159
......@@ -161,21 +161,28 @@ Symbiosis::Domains.each(prefix) do |domain|
next
end
# TODO: Again, repalce this with the updated calls to ruby-password.
# And yes, this means this doesn't really do anything now.
#
# c = CrackLib::Fascist(u.password)
#
# if c.ok?
# verbose "\tFTP password for #{u.username} is OK"
# else
# verbose "\tFTP password for #{u.username} is weak -- #{c.reason}"
# if u.username.include?('@')
# weak << "#{domain.ftp_users_file} (#{u.username}): #{c.reason}"
# else
# weak << "#{domain.ftp_password_file} (#{u.username}): #{c.reason}"
# end
# end
# Use ruby-password to check password strength
#
reason = "ok"
pw = Password.new( u.password )
begin
pw.check
rescue Password::WeakPassword => reason
end
if reason == 'ok'
verbose "\tFTP password for #{u.username} is OK"
else
verbose "\tFTP password for #{u.username} is weak -- #{reason}"
if u.username.include?('@')
weak << "#{domain.ftp_users_file} (#{u.username}): #{reason}"
else
weak << "#{domain.ftp_password_file} (#{u.username}): #{reason}"
end
end
end
......@@ -201,16 +208,25 @@ Symbiosis::Domains.each(prefix) do |domain|
next
end
# TODO: Replace this with ruby-password calls
# Beating in mind, this pretty much means this does nothing now.
#c = CrackLib::Fascist(mailbox.password)
#
#if c.ok?
# verbose "\tPassword for #{mailbox.local_part} is OK"
#else
# verbose "\tPassword for #{mailbox.local_part} is weak -- #{c.reason}"
# weak << "#{mailbox.password_file}: #{c.reason}"
#end
# Use ruby-password to check password strength
#
reason = "ok"
pw = Password.new( mailbox.password )
begin
pw.check
rescue Password::WeakPassword => reason
end
if reason == 'ok'
verbose "\tPassword for #{mailbox.local_part} is OK"
else
verbose "\tPassword for #{mailbox.local_part} is weak -- #{reason}"
weak << "#{mailbox.password_file}: #{reason}"
end
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment