summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/trust.py
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-09-05 15:46:05 +0200
committerMartin Kosek <mkosek@redhat.com>2012-09-07 16:50:35 +0200
commite23acda5b816befab48bc46ec8f03ba7a0af9ae2 (patch)
tree73297900180134c1b05844a6076fc0abfa8bc951 /ipalib/plugins/trust.py
parentfe083fd5bf692e88a90bcd4b53f7a16e1a985ffd (diff)
downloadfreeipa-e23acda5b816befab48bc46ec8f03ba7a0af9ae2.tar.gz
freeipa-e23acda5b816befab48bc46ec8f03ba7a0af9ae2.tar.xz
freeipa-e23acda5b816befab48bc46ec8f03ba7a0af9ae2.zip
Do not create trust if murmur hash is not available and base-id not given
Fixes https://fedorahosted.org/freeipa/ticket/3018
Diffstat (limited to 'ipalib/plugins/trust.py')
-rw-r--r--ipalib/plugins/trust.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py
index 5af5111d5..67f479323 100644
--- a/ipalib/plugins/trust.py
+++ b/ipalib/plugins/trust.py
@@ -163,6 +163,11 @@ class trust_add(LDAPCreate):
msg_summary = _('Added Active Directory trust for realm "%(value)s"')
def execute(self, *keys, **options):
+ if not _murmur_installed and 'base_id' not in options:
+ raise errors.ValidationError(name=_('missing base_id'),
+ error=_('pysss_murmur is not available on the server ' \
+ 'and no base-id is given.'))
+
if 'trust_type' in options:
if options['trust_type'] == u'ad':
result = self.execute_ad(*keys, **options)
@@ -200,12 +205,6 @@ class trust_add(LDAPCreate):
if 'base_id' in options:
base_id = options['base_id']
else:
- if not _murmur_installed:
- raise errors.ValidationError(name=_('missing base_id'),
- error=_('pysss_murmur is not available on the server ' \
- 'and no base_id is given, ' \
- 'ID range must be create manually'))
-
base_id = 200000 + (pysss_murmur.murmurhash3(dom_sid, len(dom_sid), 0xdeadbeef) % 10000) * 200000
try: