From ad564247cb3fe33a77959e4d9fa0f06edda59b7f Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 23 Aug 2006 04:51:35 +0000 Subject: [PATCH] Added patch done by Steffen Waitz git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4500 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/personal/posix/class_posixAccount.inc | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index c53f6bcd9..ea92f8544 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -1092,15 +1092,33 @@ class posixAccount extends plugin $ids[]= (int)$attrs["$attrib"][0]; } + /* Add the nobody id */ + $ids[]= 65534; + + /* get the ranges */ + if (preg_match('/posixAccount/', $oc)) { + $tmp= split('-',$this->config->current['UIDBASE']); + } else { + $tmp= split('-',$this->config->current['GIDBASE']); + } + + /* Set hwm to max if not set - for backward compatibility */ + $lwm= $tmp[0]; + if (isset($tmp[1])){ + $hwm= $tmp[1]; + } else { + $hwm= 65535; + } + /* Find out next free id near to UID_BASE */ - for ($id= $this->config->current['UIDBASE']; $id++; $id<65000){ + for ($id=$lwm; $id++; $id<$hwm){ if (!in_array($id, $ids)){ return ($id); } } /* Should not happen */ - if ($id == 65000){ + if ($id == $hwm){ print_red(_("Too many users, can't allocate a free ID!")); exit; } -- 2.30.2