mirror of
https://github.com/inspec/inspec
synced 2024-11-14 00:47:10 +00:00
Update users.rb
Signed-off-by: mhackethal <mh@it31.de>
This commit is contained in:
parent
6772f0b301
commit
e48f672968
1 changed files with 2 additions and 10 deletions
|
@ -464,18 +464,10 @@ module Inspec::Resources
|
|||
).params
|
||||
|
||||
cmd = inspec.command("echo $((($(date +%s) - $(date -d '#{params["Last password change"]}' '+%s'))/86400))")
|
||||
if cmd.exit_status != 0
|
||||
dayslastset = nil
|
||||
else
|
||||
dayslastset = convert_to_i(cmd.stdout.chomp)
|
||||
end
|
||||
dayslastset = convert_to_i(cmd.stdout.chomp) if cmd.exit_status == 0
|
||||
|
||||
cmd = inspec.command("lastb -w -a | awk '{print $1}' | grep #{username} | wc -l")
|
||||
if cmd.exit_status != 0
|
||||
badpasswordattempts = nil
|
||||
else
|
||||
badpasswordattempts = convert_to_i(cmd.stdout.chomp)
|
||||
end
|
||||
badpasswordattempts = convert_to_i(cmd.stdout.chomp) if cmd.exit_status == 0
|
||||
|
||||
{
|
||||
mindays: convert_to_i(params["Minimum number of days between password change"]),
|
||||
|
|
Loading…
Reference in a new issue