From e23acda5b816befab48bc46ec8f03ba7a0af9ae2 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Wed, 5 Sep 2012 15:46:05 +0200 Subject: Do not create trust if murmur hash is not available and base-id not given Fixes https://fedorahosted.org/freeipa/ticket/3018 --- ipalib/plugins/trust.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ipalib') 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: -- cgit