summaryrefslogtreecommitdiffstats
path: root/ipalib
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:52:39 +0200
commitef14704e1e22c0998c7c3ab3ac4ab0d32228e74b (patch)
tree73297900180134c1b05844a6076fc0abfa8bc951 /ipalib
parent171bed5a23345dfc61af1f6da304f953009dfe4a (diff)
downloadfreeipa.git-ef14704e1e22c0998c7c3ab3ac4ab0d32228e74b.tar.gz
freeipa.git-ef14704e1e22c0998c7c3ab3ac4ab0d32228e74b.tar.xz
freeipa.git-ef14704e1e22c0998c7c3ab3ac4ab0d32228e74b.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')
-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 5af5111d..67f47932 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: