From ee628ce082565651e28b20120ca4ea17be717364 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 12 Dec 2006 08:09:08 +0000 Subject: [PATCH] Modified gid/uid handling to support 32bit ids. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5358 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/groups/class_groupGeneric.inc | 8 ++++---- plugins/personal/posix/class_posixAccount.inc | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc index 588c842c8..dba7c496a 100644 --- a/plugins/admin/groups/class_groupGeneric.inc +++ b/plugins/admin/groups/class_groupGeneric.inc @@ -815,15 +815,15 @@ class group extends plugin } /* Find out next free id near to UID_BASE */ - for ($id= $this->config->current['UIDBASE']; $id++; $id<65000){ + for ($id= $this->config->current['UIDBASE']; $id++; $id < pow(2,32)){ if (!in_array($id, $ids)){ return ($id); } } - /* Should not happen */ - if ($id == 65000){ - print_red(_("Too many users, can't allocate a free ID!")); + /* check if id reached maximum of 32 bit*/ + if ($id >= pow(2,32)){ + echo _("Too many users, can't allocate a free ID!"); exit; } } diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index c6d8eea8e..8f44a6257 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -1084,18 +1084,17 @@ class posixAccount extends plugin } /* Find out next free id near to UID_BASE */ - for ($id= $this->config->current['UIDBASE']; $id++; $id<65000){ + for ($id= $this->config->current['UIDBASE']; $id++; $id < pow(2,32)){ if (!in_array($id, $ids)){ return ($id); } } - /* Should not happen */ - if ($id == 65000){ - print_red(_("Too many users, can't allocate a free ID!")); + /* Check if current id reaches the maximum of 32 bit */ + if ($id >= pow(2,32)){ + echo _("Too many users, can't allocate a free ID!"); exit; } - } function reload() -- 2.30.2