summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-server-install
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-12-06 16:16:49 -0500
committerSimo Sorce <ssorce@redhat.com>2010-12-07 08:35:42 -0500
commita1edfe8c51da802cd439cf98d200776f2cb81773 (patch)
treeb7b71524d67cf168dbc8df3cccccda3c6a4c19a6 /install/tools/ipa-server-install
parent6350686710c49b632ea7b1085e4db6755056d263 (diff)
downloadfreeipa-a1edfe8c51da802cd439cf98d200776f2cb81773.tar.gz
freeipa-a1edfe8c51da802cd439cf98d200776f2cb81773.tar.xz
freeipa-a1edfe8c51da802cd439cf98d200776f2cb81773.zip
Give back smaller and more readable ranges by default.
Instead of allocating a completely random start between 1M and 2G and a range of 1M values, give 10000 possible 200k ranges. They all start at a 200k boundary so they generate more readable IDs, at least until there arent't too many users/replicas involved.
Diffstat (limited to 'install/tools/ipa-server-install')
-rwxr-xr-xinstall/tools/ipa-server-install11
1 files changed, 6 insertions, 5 deletions
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index 020fc8ff8..bed9add9c 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -1,7 +1,9 @@
#! /usr/bin/python -E
# Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
+# Simo Sorce <ssorce@redhat.com>
+# Rob Crittenden <rcritten@redhat.com>
#
-# Copyright (C) 2007 Red Hat
+# Copyright (C) 2007-2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or
@@ -60,11 +62,10 @@ from ipapython.config import IPAOptionParser
pw_name = None
uninstalling = False
-# Used to determine the the highest possible uid/gid
-MAXINT_32BIT = 2147483648
def parse_options():
- namespace = random.randint(1000000, (MAXINT_32BIT - 1000000))
+ # Guaranteed to give a random 200k range below the 2G mark (uint32_t limit)
+ namespace = random.randint(1, 10000) * 200000
parser = IPAOptionParser(version=version.VERSION)
parser.add_option("-u", "--user", dest="ds_user",
help="ds user")
@@ -177,7 +178,7 @@ def parse_options():
parser.error("--external-cert-file must use an absolute path")
if options.idmax == 0:
- options.idmax = int(options.idstart) + 1000000 - 1
+ options.idmax = int(options.idstart) + 200000 - 1
if options.idmax < options.idstart:
parse.error("idmax (%u) cannot be smaller than idstart (%u)" %