diff options
author | Ana Krivokapic <akrivoka@redhat.com> | 2013-05-31 12:01:23 +0200 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2013-06-24 14:20:01 +0200 |
commit | e5117bd995aa10aab59f487058b4a57c8b695be9 (patch) | |
tree | 0d3a857ba253f3ac5ed25fc2276a85fa178d3aa5 /ipaserver | |
parent | 6118b73fab1bfbbbaf0ce10ebb48fb3864b90a5e (diff) | |
download | freeipa-e5117bd995aa10aab59f487058b4a57c8b695be9.tar.gz freeipa-e5117bd995aa10aab59f487058b4a57c8b695be9.tar.xz freeipa-e5117bd995aa10aab59f487058b4a57c8b695be9.zip |
Fail when adding a trust with a different range
When adding a trust, if an id range already exists for this trust,
and options --base-id/--range-size are provided with the trust-add command,
trust-add should fail.
https://fedorahosted.org/freeipa/ticket/3635
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/dcerpc.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py index 5d052ea4..0f98ce83 100644 --- a/ipaserver/dcerpc.py +++ b/ipaserver/dcerpc.py @@ -816,7 +816,7 @@ class TrustDomainJoins(object): ld.retrieve(installutils.get_fqdn()) self.local_domain = ld - def __populate_remote_domain(self, realm, realm_server=None, realm_admin=None, realm_passwd=None): + def populate_remote_domain(self, realm, realm_server=None, realm_admin=None, realm_passwd=None): def get_instance(self): # Fetch data from foreign domain using password only rd = TrustDomainInstance('') @@ -860,7 +860,14 @@ class TrustDomainJoins(object): if not self.configured: return None - self.__populate_remote_domain(realm, realm_server, realm_admin, realm_passwd) + if not(isinstance(self.remote_domain, TrustDomainInstance)): + self.populate_remote_domain( + realm, + realm_server, + realm_admin, + realm_passwd + ) + if not self.remote_domain.read_only: trustdom_pass = samba.generate_random_password(128, 128) self.remote_domain.establish_trust(self.local_domain, trustdom_pass) @@ -873,6 +880,8 @@ class TrustDomainJoins(object): if not self.configured: return None - self.__populate_remote_domain(realm, realm_server, realm_passwd=None) + if not(isinstance(self.remote_domain, TrustDomainInstance)): + self.populate_remote_domain(realm, realm_server, realm_passwd=None) + self.local_domain.establish_trust(self.remote_domain, trustdom_passwd) return dict(local=self.local_domain, remote=self.remote_domain, verified=False) |