summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/trust.py
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-06-17 17:53:51 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-07-14 16:04:58 +0200
commite672a396374c05c5a06eb4e816ec6cc0939ad008 (patch)
tree24d85c142802b704d67ce835765b5844cae37b8a /ipalib/plugins/trust.py
parent73b2d0a81dc09acbcae0e4388d1043780a171f3b (diff)
downloadfreeipa-e672a396374c05c5a06eb4e816ec6cc0939ad008.tar.gz
freeipa-e672a396374c05c5a06eb4e816ec6cc0939ad008.tar.xz
freeipa-e672a396374c05c5a06eb4e816ec6cc0939ad008.zip
trusts: Validate missing trust secret properly
Detect the situation if the user passes empty trust secret and error out properly. https://fedorahosted.org/freeipa/ticket/4266 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipalib/plugins/trust.py')
-rw-r--r--ipalib/plugins/trust.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py
index 99acfb8f8..fe1a76719 100644
--- a/ipalib/plugins/trust.py
+++ b/ipalib/plugins/trust.py
@@ -721,11 +721,10 @@ sides.
ret['summary'] = self.msg_summary_existing % ret
return ret
-
# 2. We don't have access to the remote domain and trustdom password
# is provided. Do the work on our side and inform what to do on remote
# side.
- if 'trust_secret' in options:
+ if options.get('trust_secret'):
result = self.trustinstance.join_ad_ipa_half(
keys[-1],
self.realm_server,
@@ -740,8 +739,11 @@ sides.
if dn:
ret['summary'] = self.msg_summary_existing % ret
return ret
- raise errors.ValidationError(name=_('AD Trust setup'),
- error=_('Not enough arguments specified to perform trust setup'))
+ else:
+ raise errors.ValidationError(
+ name=_('AD Trust setup'),
+ error=_('Not enough arguments specified to perform trust '
+ 'setup'))
@register()
class trust_del(LDAPDelete):