From: Robert 'phaylon' Sedlacek Date: Mon, 18 Jun 2012 23:28:48 +0000 (+0000) Subject: simplified user group sanitation X-Git-Tag: v0.001_001~38 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=09a9d49a4db592eb65d5f2eaae9c54a200cc9195;p=scpubgit%2FSystem-Introspector.git simplified user group sanitation --- diff --git a/lib/System/Introspector/Probe/Users.pm b/lib/System/Introspector/Probe/Users.pm index 0327bb7..e0baa5b 100644 --- a/lib/System/Introspector/Probe/Users.pm +++ b/lib/System/Introspector/Probe/Users.pm @@ -78,7 +78,8 @@ sub _gather_ssh_keys { sub _gather_user_groups { my ($self, $user) = @_; my $groups = output_from_command [groups => $user]; - $groups =~ s{^ \Q$user\E \s* : \s* }{}x; + chomp $groups; + $groups =~ s{^ .* : \s* }{}x; return [split m{\s+}, $groups]; }