From ff7c7697aaee4e71db4840e98ea747a8639471f4 Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Fri, 10 Oct 2014 23:20:37 +0200 Subject: first attempt to hide some system group with 499 < gid < 1000 --- lib/AdminPanel/Module/Users.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/AdminPanel/Module') diff --git a/lib/AdminPanel/Module/Users.pm b/lib/AdminPanel/Module/Users.pm index f7815f4f..12925e1e 100644 --- a/lib/AdminPanel/Module/Users.pm +++ b/lib/AdminPanel/Module/Users.pm @@ -1196,6 +1196,14 @@ sub _refreshGroups { my @GroupReal; LOOP: foreach my $g (@$groups) { next LOOP if $filtergroups && $g->Gid($self->sh_users->USER_GetValue) <= 499 || $g->Gid($self->sh_users->USER_GetValue) == 65534; + + if ($filtergroups && $g->Gid($self->sh_users->USER_GetValue) > 499 && $g->Gid($self->sh_users->USER_GetValue) < 1000) { + my $groupname = $g->GroupName($self->sh_users->USER_GetValue); + my $l = $self->sh_users->ctx->LookupUserByName($groupname); + next if ! defined($l); + next LOOP if $l->HomeDir($self->sh_users->USER_GetValue) =~ /^\/($|var\/|run\/)/ || $l->LoginShell($self->sh_users->USER_GetValue) =~ /(nologin|false)$/; + } + push @GroupReal, $g if $g->GroupName($self->sh_users->USER_GetValue) =~ /^\Q$strfilt/; } -- cgit v1.2.1