From c9831d1cc67c5d12a15769c595da9aad7d996e87 Mon Sep 17 00:00:00 2001 From: Pavel Zuna Date: Tue, 16 Mar 2010 15:08:44 +0100 Subject: Use ldap2.make_*dn* methods in pwpolicy plugin. Fixes #572423. --- ipalib/plugins/pwpolicy.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ipalib') diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py index 22af9fb78..483fa9557 100644 --- a/ipalib/plugins/pwpolicy.py +++ b/ipalib/plugins/pwpolicy.py @@ -96,9 +96,13 @@ def make_policy_entry(group_cn, policy_entry): policy_dn = DN of the new password policy entry policy_entry = entry representing this new object """ + ldap = api.Backend.ldap2 # This DN must *NOT* have spaces between elements - policy_dn = "cn=%s,cn=%s,cn=kerberos,%s" % (group_cn, api.env.realm, api.env.basedn) + policy_dn = ldap.make_dn_from_attr( + 'cn', api.env.realm, 'cn=kerberos,%s' % api.env.basedn + ) + policy_dn = ldap.make_dn_from_attr('cn', group_cn, policy_dn) # Create the krb password policy entry. This MUST be located # in the same container as the REALM or the kldap plugin won't -- cgit