aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel/Shared
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-10-11 17:34:36 +0200
committerAngelo Naselli <anaselli@linux.it>2014-10-11 17:34:36 +0200
commit216e582df74a80c3f168eacf100501f1cff6c35c (patch)
treea805ec64dffac5a5e5ee5ddb5dab73afda8972b1 /lib/AdminPanel/Shared
parentd79e5d4de09d38882d111341ed17bdb1b181050b (diff)
downloadcolin-keep-216e582df74a80c3f168eacf100501f1cff6c35c.tar
colin-keep-216e582df74a80c3f168eacf100501f1cff6c35c.tar.gz
colin-keep-216e582df74a80c3f168eacf100501f1cff6c35c.tar.bz2
colin-keep-216e582df74a80c3f168eacf100501f1cff6c35c.tar.xz
colin-keep-216e582df74a80c3f168eacf100501f1cff6c35c.zip
managed minimum gid value
Diffstat (limited to 'lib/AdminPanel/Shared')
-rw-r--r--lib/AdminPanel/Shared/Users.pm20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/AdminPanel/Shared/Users.pm b/lib/AdminPanel/Shared/Users.pm
index bfce0e7..1c5b6a4 100644
--- a/lib/AdminPanel/Shared/Users.pm
+++ b/lib/AdminPanel/Shared/Users.pm
@@ -149,7 +149,7 @@ sub _USERInitialize {
return undef;
}
-## min UID was 500 now is 1000, let's change in a single point
+## min (custom) UID was 500 now is 1000, let's change in a single point
has 'min_UID' => (
default => 1000,
is => 'ro',
@@ -157,6 +157,14 @@ has 'min_UID' => (
init_arg => undef,
);
+## min (custom) GID was 500 now should be 1000 as for users
+has 'min_GID' => (
+ default => 1000,
+ is => 'ro',
+ isa => 'Int',
+ init_arg => undef,
+);
+
#=============================================================
=head2 BUILD
@@ -729,10 +737,10 @@ sub getGroupsInfo {
my $groups = $self->ctx->GroupsEnumerateFull;
my @GroupReal;
- LOOP: foreach my $g (@$groups) {
- next LOOP if $filtergroups && $g->Gid($self->USER_GetValue) <= 499 || $g->Gid($self->USER_GetValue) == 65534;
-
- if ($filtergroups && $g->Gid($self->USER_GetValue) > 499 && $g->Gid($self->USER_GetValue) < 1000) {
+ LOOP: foreach my $g (@{$groups}) {
+ my $gid = $g->Gid($self->USER_GetValue);
+ next LOOP if $filtergroups && $gid <= 499 || $gid == 65534;
+ if ($filtergroups && $gid > 499 && $gid < $self->min_GID) {
my $groupname = $g->GroupName($self->USER_GetValue);
my $l = $self->ctx->LookupUserByName($groupname);
if (!defined($l)) {
@@ -811,7 +819,7 @@ sub getUsersInfo {
$users = $self->ctx->UsersEnumerateFull;
my @UserReal;
- LOOP: foreach my $l (@$users) {
+ LOOP: foreach my $l (@{$users}) {
next LOOP if $filterusers && $l->Uid($self->USER_GetValue) <= 499 || $l->Uid($self->USER_GetValue) == 65534;
next LOOP if $filterusers && $l->Uid($self->USER_GetValue) > 499 && $l->Uid($self->USER_GetValue) < $self->min_UID &&
($l->HomeDir($self->USER_GetValue) =~ /^\/($|var\/|run\/)/ || $l->LoginShell($self->USER_GetValue) =~ /(nologin|false)$/);