From: Matt S Trout Date: Wed, 6 Jun 2012 19:47:45 +0000 (+0000) Subject: better users probe X-Git-Tag: v0.001_001~59 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=95c7aba8fb8377ec0a793a1d4223f41a2c4948d4;p=scpubgit%2FSystem-Introspector.git better users probe --- diff --git a/lib/System/Introspector/Probe/Users.pm b/lib/System/Introspector/Probe/Users.pm index 7189a41..a80a68d 100644 --- a/lib/System/Introspector/Probe/Users.pm +++ b/lib/System/Introspector/Probe/Users.pm @@ -48,19 +48,28 @@ sub _gather_crontab { sub _gather_ssh_keys { my ($self, $user, $home) = @_; - my $ssh_dir = "$home/.ssh/"; - return {} - unless -d $ssh_dir; + my $ssh_dir = "$home/.ssh"; + return { + files => {}, + authorized => { file_name => "$ssh_dir/authorized_keys", body => '' } + } unless -d $ssh_dir; my %key; for my $item (files_from_dir $ssh_dir) { next unless $item =~ m{\.pub$}; $key{ $item } = transform_exceptions { return { + file_name => "$ssh_dir/$item", body => scalar output_from_file "$ssh_dir/$item", }; }; } - return { files => \%key }; + my $auth_keys = transform_exceptions { + return { + file_name => "$ssh_dir/authorized_keys", + body => scalar output_from_file "$ssh_dir/authorized_keys", + }; + }; + return { files => \%key, authorized => $auth_keys }; } sub _gather_user_groups {