summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8ba9ec8)
raw | patch | inline | side by side (parent: 8ba9ec8)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Aug 2006 04:51:35 +0000 (04:51 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Aug 2006 04:51:35 +0000 (04:51 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4500 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/personal/posix/class_posixAccount.inc | patch | blob | history |
diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc
index c53f6bcd93d04504723578bd12ebbe70d4221791..ea92f8544695b33b0ed6881fa5d0929d215af1a2 100644 (file)
$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;
}