From: hickert Date: Tue, 12 Dec 2006 08:09:08 +0000 (+0000) Subject: Modified gid/uid handling to support 32bit ids. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ee628ce082565651e28b20120ca4ea17be717364;p=gosa.git 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 --- 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()