Class: Inspec::Resources::AixUser
Instance Attribute Summary
Attributes inherited from UnixUser
#id_cmd, #inspec
Attributes inherited from UserInfo
#inspec
Instance Method Summary
collapse
Methods inherited from UnixUser
#initialize, #parse_id_entries, #parse_value
Methods inherited from UserInfo
#initialize
Methods included from Converter
#convert_to_i
Instance Method Details
#credentials(username) ⇒ Object
317
318
319
320
321
322
323
324
325
326
327
328
329
330
|
# File 'lib/resources/user.rb', line 317
def credentials(username)
cmd = inspec.command(
"lssec -c -f /etc/security/user -s #{username} -a minage -a maxage -a pwdwarntime",
)
return nil if cmd.exit_status != 0
user_sec = cmd.stdout.chomp.split("\n").last.split(':')
{
mindays: user_sec[1].to_i * 7,
maxdays: user_sec[2].to_i * 7,
warndays: user_sec[3].to_i,
}
end
|
#identity(username) ⇒ Object
291
292
293
294
295
296
297
298
299
300
301
302
303
304
|
# File 'lib/resources/user.rb', line 291
def identity(username)
id = super(username)
return nil if id.nil?
if id[:groups].first != id[:group]
id[:groups].reject! { |i| i == id[:group] } if id[:groups].include?(id[:group])
id[:groups].unshift(id[:group])
end
id
end
|
306
307
308
309
310
311
312
313
314
315
|
# File 'lib/resources/user.rb', line 306
def meta_info(username)
lsuser = inspec.command("lsuser -C -a home shell #{username}")
return nil if lsuser.exit_status != 0
user = lsuser.stdout.chomp.split("\n").last.split(':')
{
home: user[1],
shell: user[2],
}
end
|