Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ian Eiloart
Sympl
Commits
797dc6a8
Commit
797dc6a8
authored
Jun 10, 2019
by
Paul Cammish
Browse files
Re-enables password testing
parent
2117c159
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/sbin/sympl-password-test
View file @
797dc6a8
...
...
@@ -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
"
\t
FTP password for
#{
u
.
username
}
is OK"
else
verbose
"
\t
FTP 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
"
\t
Password for
#{
mailbox
.
local_part
}
is OK"
else
verbose
"
\t
Password for
#{
mailbox
.
local_part
}
is weak --
#{
reason
}
"
weak
<<
"
#{
mailbox
.
password_file
}
:
#{
reason
}
"
end
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment