From a1edfe8c51da802cd439cf98d200776f2cb81773 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 6 Dec 2010 16:16:49 -0500 Subject: 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. --- install/tools/ipa-server-install | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'install/tools') diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install index 020fc8ff..bed9add9 100755 --- a/install/tools/ipa-server-install +++ b/install/tools/ipa-server-install @@ -1,7 +1,9 @@ #! /usr/bin/python -E # Authors: Karl MacMillan +# Simo Sorce +# Rob Crittenden # -# 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)" % -- cgit