summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAna Krivokapic <akrivoka@redhat.com>2013-01-03 08:40:40 -0500
committerMartin Kosek <mkosek@redhat.com>2013-01-14 14:10:15 +0100
commit27e49f01fe3292e5da47c3d589fcab2637662a07 (patch)
tree8f7a6e72ab1cdee08097862807006c7aa611a571
parent41b2febff00999dc6b477f18e2ad89cd49e39532 (diff)
downloadfreeipa.git-27e49f01fe3292e5da47c3d589fcab2637662a07.tar.gz
freeipa.git-27e49f01fe3292e5da47c3d589fcab2637662a07.tar.xz
freeipa.git-27e49f01fe3292e5da47c3d589fcab2637662a07.zip
Raise ValidationError for incorrect subtree option.
Ticket: https://fedorahosted.org/freeipa/ticket/3233
-rw-r--r--ipalib/plugins/aci.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipalib/plugins/aci.py b/ipalib/plugins/aci.py
index 24be1745..7c4e8a54 100644
--- a/ipalib/plugins/aci.py
+++ b/ipalib/plugins/aci.py
@@ -341,7 +341,10 @@ def _aci_to_kw(ldap, a, test=False, pkey_only=False):
else:
# See if the target is a group. If so we set the
# targetgroup attr, otherwise we consider it a subtree
- targetdn = DN(target.replace('ldap:///',''))
+ try:
+ targetdn = DN(target.replace('ldap:///',''))
+ except ValueError as e:
+ raise errors.ValidationError(name='subtree', error=_("invalid DN (%s)") % e.message)
if targetdn.endswith(DN(api.env.container_group, api.env.basedn)):
kw['targetgroup'] = targetdn[0]['cn']
else: