aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-10-10 23:20:37 +0200
committerAngelo Naselli <anaselli@linux.it>2014-10-10 23:20:37 +0200
commitff7c7697aaee4e71db4840e98ea747a8639471f4 (patch)
tree7ea57ded98778372384b3d31ccd08191b5fd3042 /lib/AdminPanel
parentfd51a5111a1af21053ce3c4935c1eec9e4d5ca9b (diff)
downloadcolin-keep-ff7c7697aaee4e71db4840e98ea747a8639471f4.tar
colin-keep-ff7c7697aaee4e71db4840e98ea747a8639471f4.tar.gz
colin-keep-ff7c7697aaee4e71db4840e98ea747a8639471f4.tar.bz2
colin-keep-ff7c7697aaee4e71db4840e98ea747a8639471f4.tar.xz
colin-keep-ff7c7697aaee4e71db4840e98ea747a8639471f4.zip
first attempt to hide some system group with 499 < gid < 1000
Diffstat (limited to 'lib/AdminPanel')
-rw-r--r--lib/AdminPanel/Module/Users.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/AdminPanel/Module/Users.pm b/lib/AdminPanel/Module/Users.pm
index f7815f4..12925e1 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/;
}