From 76fcb8aaed7a9a53b5ecc0080fa6f47577c0c2d3 Mon Sep 17 00:00:00 2001
From: "Leigh B. Stoller" <stoller@flux.utah.edu>
Date: Thu, 21 Dec 2006 14:04:36 +0000
Subject: [PATCH] Bump where we starting hunting for an unused gid since there
 are bunch of dead groups at the bottom from the really early days of emulab.

---
 www/group_defs.php | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/www/group_defs.php b/www/group_defs.php
index 3764283397..48c6b9be38 100644
--- a/www/group_defs.php
+++ b/www/group_defs.php
@@ -187,6 +187,10 @@ class Group
 	global $TBBASE, $TBMAIL_APPROVAL, $TBMAIL_AUDIT, $TBMAIL_WWW;
 	global $MIN_UNIX_GID;
 
+	# There appear to be a lot of old groups still around on boss/ops.
+	$starting_gid = $MIN_UNIX_GID + 200;
+	$ending_gid   = 50000;
+
         #
         # Check that we can guarantee uniqueness of the unix group name.
         # 
@@ -218,8 +222,8 @@ class Group
 	    DBQueryWarn("select g.unix_gid + 1 as start from groups as g ".
 			"left outer join groups as r on ".
 			"  g.unix_gid + 1 = r.unix_gid ".
-			"where g.unix_gid>$MIN_UNIX_GID and ".
-			"      g.unix_gid<50000 and ".
+			"where g.unix_gid>$starting_gid and ".
+			"      g.unix_gid<$ending_gid and ".
 			"      r.unix_gid is null limit 1");
 
 	if (!$query_result || !mysql_num_rows($query_result)) {
-- 
GitLab