summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/trust.py
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2012-07-16 13:12:42 +0300
committerAlexander Bokovoy <abokovoy@redhat.com>2012-07-18 16:55:57 +0300
commitdadfbf9d153bcf8f7ce659981698ffa2292b3967 (patch)
tree8731760a4a4ef25aeeb1810431cac18611807bd5 /ipalib/plugins/trust.py
parent2d75d8cc055887f354db947aac1d33e961e9c80c (diff)
downloadfreeipa.git-dadfbf9d153bcf8f7ce659981698ffa2292b3967.tar.gz
freeipa.git-dadfbf9d153bcf8f7ce659981698ffa2292b3967.tar.xz
freeipa.git-dadfbf9d153bcf8f7ce659981698ffa2292b3967.zip
Handle various forms of admin accounts when establishing trusts
Realm administrator account may be specified using different form: Administrator, DOM\Administrator, Administrator@DOMAIN This patch introduces handling of the second two forms: - In DOM\Administrator only user name is used, short domain name is then taken from a discovered record from the AD DC - In Administrator@DOMAIN first DOMAIN is verified to be the same as the domain we are establishing trust to, and then user name is taken, together with short domain name taken from a discovered record from the AD DC Note that we do not support using to-be-trusted domain's trusted domains' accounts to establish trust as there is basically zero chance to verify that things will work with them. In addition, in order to establish trust one needs to belong to Enterprise Admins group in AD or have specially delegated permissions. These permissions are unlikely delegated to the ones in already trusted domain. https://fedorahosted.org/freeipa/ticket/2864
Diffstat (limited to 'ipalib/plugins/trust.py')
-rw-r--r--ipalib/plugins/trust.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py
index 2932835e..792e6cac 100644
--- a/ipalib/plugins/trust.py
+++ b/ipalib/plugins/trust.py
@@ -180,6 +180,14 @@ class trust_add(LDAPCreate):
# generate random trustdom password to do work on both sides
if 'realm_admin' in options:
realm_admin = options['realm_admin']
+ names = realm_admin.split('@')
+ if len(names) > 1:
+ # realm admin name is in UPN format, user@realm, check that
+ # realm is the same as the one that we are attempting to trust
+ if keys[-1].lower() != names[-1].lower():
+ raise errors.ValidationError(name=_('AD Trust setup'),
+ error=_('Trusted domain and administrator account use different realms'))
+ realm_admin = names[0]
if 'realm_passwd' not in options:
raise errors.ValidationError(name=_('AD Trust setup'), error=_('Realm administrator password should be specified'))